-{% extends "base/base.html" %}
+{% extends "base_simple.html" %}
+{% load i18n %}
-{% block titleextra %}Towarzystwo Wolnych Lektur{% endblock %}
+{% block titleextra %}{% trans "Wolne Lektury need your help!" %}{% endblock %}
{% block body %}
-<div class="white-box normal-text">
-<h1>Plan płatności</h1>
+ <h1>
+ Cieszymy się, że jesteś z nami! Dziękujemy za wsparcie!
+ </h1>
+ <div class="white-box normal-text">
+ <p>
+
+
+ {% if schedule.payed_at %}
+ Kwota:
+ {{ schedule.amount }} zł
+
+ <br>
+
+ Pierwsza wpłata:
+ {{ schedule.payed_at.date }}
+
+ <br>
+
+ {% if schedule.is_expired %}
+ <strong style="color: red">
+ Status darczyńcy nieaktywny od
+ {{ schedule.expires_at.date }}
+ </strong>
+ {% else %}
+ <strong style="color: green">
+ Status darczyńcy aktywny
+ {% if schedule.get_payment_method.expiration_reliable %}
+ do
+ {{ schedule.expires_at.date }}
+ {% endif %}
+ </strong>
+ {% endif %}
+
+ <br>
+
+ {% endif %}
+
+
+
+{% if schedule.is_active %}
+ {% if schedule.is_recurring %}
+ {% if schedule.is_cancelled %}
+ <p><strong>Płatność anulowana.</strong></p>
+ <p>
+ <a style="background:#018189;color:white;border-radius: 10px;padding:1em 2em" href="/pomagam/">Wpłać ponownie</a>
+ </p>
+ {% else %}
+ {% if schedule.get_payment_method.updateable %}
+ <form method='post' action='' class="wlform">
+ {% csrf_token %}
+ <button type="submit" class="submit">
+ Zaktualizuj dane płatności
+ </button>
+ </form>
+ <br>
+ {% endif %}
+
+ {% if schedule.get_payment_method.cancellable %}
+ <form class="wlform" method='post' action="{% url 'club_cancel' schedule.key %}">
+ {% csrf_token %}
+ <button type="submit" class="submit" style="font-size: .9em">Zrezygnuj z kolejnych płatności</button>
+ </form>
+ {% endif %}
+ {% endif %}
+ {% else %}
+ <form class="wlform" method='post' action=''>
+ {% csrf_token %}
+ <button type="submit" class="submit">Dorzuć się ponownie</button>
+ </form>
+ {% endif %}
-<div>{{ schedule.email }}</div>
-<div>{{ schedule.amount }}</div>
-<div>{{ schedule.plan.get_interval_display }}</div>
-<div>{{ schedule.is_active|yesno:"Aktywne,Nieaktywne" }}</div>
+{% else %}
+ {% if schedule.is_expired %}
+
+ <form method='post' action='' class="wlform">
+ {% csrf_token %}
+ <button type="submit" class="submit">
+ {% if schedule.is_recurring %}
+ Zaktualizuj dane płatności
+ {% else %}
+ Dorzuć się ponownie
+ {% endif %}
+ </button>
+ </form>
+
+ {% if schedule.get_payment_method.cancellable %}
+ <br>
+ <form class="wlform" method='post' action="{% url 'club_cancel' schedule.key %}">
+ {% csrf_token %}
+ <button type="submit" class="submit" style="font-size: .9em">Zrezygnuj z kolejnych płatności</button>
+ </form>
+ {% endif %}
+
+
+ {% else %}
+ {% if not schedule.payed_at %}
+ <p>Płatność nie została jeszcze wykonana.</p>
+ {% if schedule.payuorder_set.exists %}
+ Czekamy na potwierdzenie płatności.
+ {% else %}
+
+ <form method='post' action='' class="wlform">
+ {% csrf_token %}
+ <button type="submit" class="submit">Dokończ płatność</button>
+ </form>
+
+ {% endif %}
+ {% endif %}
+ {% endif %}
+{% endif %}
-<div>Start: {{ schedule.started_at }}</div>
-<div>Opłacone do: {{ schedule.expires_at|default:"brak" }} {% if schedule.is_cancelled %}(anulowana){% endif %}</div>
-{% if schedule.expires_at and not schedule.is_cancelled %}
-<form method='post' action="{% url 'club_cancel' schedule.key %}">
- {% csrf_token %}
- <button type="submit">Anuluj płatność</button>
-</form>
-{% endif %}
+{% if not schedule.membership %}
+
+ <hr style="margin: 2em 0;">
+
+ <h2>Powiązanie z kontem użytkownika</h2>
-{% if schedule.is_expired %}
- Płatność wygasła. <a href="{% url 'club_join' %}">Wykonaj nową płatność</a>.
-{% endif %}
-{% if schedule.membership %}
- <p>
- Członek/członkini Towarzystwa nr {{ schedule.membership.id }} ({{ schedule.membership.user }}).
- </p>
-{% else %}
<p>
-Płatność nie przypisana do członkostwa.<br>
-<a href="{% url 'club_claim' schedule.key %}">Przypisz</a>
+Twoje wsparcie upoważnia Cię do przedpremierowego dostępu do publikacji.
+Aby z niego korzystać, powiąż darowiznę ze swoim kontem użytkownika na Wolnych Lekturach.
+</p>
+
+
+<p style="margin-top:2em;">
+ <a style="background:#018189;color:white;border-radius: 10px;padding:1em 2em;" href="{% url 'club_claim' schedule.key %}">
+ {% if request.user.is_authenticated %}
+ Powiąż darowiznę z kontem <strong>{{ request.user.username }}</strong>
+ {% else %}
+ Zaloguj się i powiąż darowiznę z kontem
+ {% endif %}
+ </a>
</p>
{% endif %}
-
+
<a href="">
</div>