Internationalize carousels and club progress bar.
[wolnelektury.git] / src / club / templates / club / membership_form.html
index 3a9a006..04a3e10 100644 (file)
@@ -1,83 +1,80 @@
 {% extends request.session.from_app|yesno:"base/app.html,base/base.html" %}
+{% load i18n %}
+{% load chunks %}
+{% load thumbnail %}
+{% load club %}
 
-
-{% block titleextra %}Towarzystwo Wolnych Lektur{% endblock %}
+{% block titleextra %}{% trans "Join us in freeing the books!" %}{% endblock %}
+{% block metadescription %}{% trans "„Wolne Lektury należy wspierać, bo są” - Filip Springer" %}{% endblock %}
 
 
 {% block body %}
-
-<style>
-  .payment-method.disabled {
-  opacity: .5;
-  filter: grayscale(100%);
-  }
-  
-  </style>
-
-
-<div class="white-box normal-text">
-
-       <h1>{% if membership %}Odnów swoje członkostwo w Towarzystwie Wolnych Lektur{% else %}Dołącz do Towarzystwa Wolnych Lektur{% endif %}</h1>
-
-<form method="POST" action="" id="payment-form" class="wlform">
-  {% csrf_token %}
-
-  <h2>Składka</h2>
-  
-  <ul class="errorlist">
-  {% for e in  form.non_field_errors %}
-    <li>{{ e }}</li>
-  {% endfor %}
-    {% for e in  form.plan.errors %}
-    <li>{{ e }}</li>
-  {% endfor %}
-    {% for e in  form.amount.errors %}
-    <li>{{ e }}</li>
-    {% endfor %}
-  </ul>
-
-  {% for plan in form.plans %}
-  
-  <div>
-    <input class="plan" type="radio" name="plan" value="{{ plan.id }}" id="plan{{ plan.id }}" data-methods="{% for m in plan.payment_methods %}{{ m.slug }} {% endfor %}">
-    <label for="plan{{ plan.id }}">
-      <input
-        name="amount-{{ plan.id }}"
-        type="number"
-        placeholder="min. {{ plan.min_amount|floatformat:0 }}"
-        value="{{ plan.default_amount|floatformat:0 }}"
-        min="{{ plan.min_amount|floatformat:0 }}"
-        step="1"
-        style="width: 5em;"
-        > zł
-      {{ plan.get_interval_display }}
-    </label>
-  </div>
-
-  {% endfor %}
-
-  <h2>Metoda płatności</h2>
-  
-  <ul class="errorlist">
-  {% for e in form.method.errors %}
-  <li>{{ e }}</li>
-  {% endfor %}
-  </ul>
-  
-  {% for payment_method in form.payment_methods %}
-  <div class="payment-method" id="payment-method-{{ payment_method.slug }}">
-    <input type="radio" id="method{{ payment_method.slug }}" name="method" value="{{ payment_method.slug }}">
-    <label for="method{{ payment_method.slug }}" style="display:inline-block">
-      {% include payment_method.template_name %}
-    </label>
-  </div>
-  {% endfor %}
-
-  <p style="margin-top: 2em;">
-    {{ form.email.label }}:
-    {{ form.email }}</p>
-  <button class="submit" type='submit'>Dołącz</button>
-</form>
+  <div class="white-box normal-text">
+
+    <h1>{% trans "Support Wolne Lektury" %}</h1>
+    <h2 style="margin-bottom:2em;">
+      {% if membership %}
+        {# Displays to members. #}
+        {% trans "Thank you for your support! Support us again!" %}
+      {% else %}
+        {# Displays to non-supporters. #}
+        {% trans "Thank you for wanting to free the books with us!" %}
+      {% endif %}</h2>
+
+      {% with schedule=request.user|active_schedule %}
+        {% if schedule %}
+          <p><a href="{{ schedule.get_absolute_url }}">{% trans "See your past support." %}</a></p>
+        {% endif %}
+      {% endwith %}
+
+      <div class='twocol'>
+
+      <form method="POST" action="" id="payment-form" class="wlform">
+        {% csrf_token %}
+
+        {% chunk 'club_form_top' %}
+
+        {% club_monthly_since '2020-12-01' as supporters %}
+        {% club_monthly_missing_since '2020-12-01' 100 as missing_supporters %}
+       <p>
+         {% blocktrans %}Help us get 100 new Friends by the end of the school semester.{% endblocktrans %}
+         {% blocktrans count supporters=supporters %}
+           So far <b style="color: #0d7e85">{{ supporters }}</b> reader has already supported us with a regular donation,
+           {% plural %}
+           So far <b style="color: #0d7e85">{{ supporters }}</b> readers have already supported us with a regular donation,
+         {% endblocktrans %}
+         {% blocktrans count missing_supporters=missing_supporters %}
+           <b style="color: #0d7e85">{{ missing_supporters }}</b> is missing.
+            {% plural %}
+            <b style="color: #0d7e85">{{ missing_supporters }}</b> are missing.
+         {% endblocktrans %}
+        </p>
+        <div class="funding" style="background: none;"><div class="description"><div class="progress" style="text-align: center; background-size: {{ supporters }}% 1px;"><span class="piece progress-collected">&nbsp;{{ supporters }}</span><span class="piece progress-target">{{ missing_supporters }}&nbsp;</span><div style="clear: both"></div></div></div></div>
+
+        {% include "club/payment_form.html" %}
+
+        {% chunk 'club_form_bottom' %}
+
+      </form>
+
+      <div class="club-form-info">
+        {% if ambassador %}
+       <div class="ambassador {% if ambassador.photo %}with-photo{% endif %}">
+            <div>
+              <em>
+                {{ ambassador.text }}
+              </em>
+              <div style="font-size: 1.2em">{{ ambassador.name }}</div>
+            </div>
+            {% if ambassador.photo %}
+              <img src="{% thumbnail ambassador.photo "100x100" as thumb %}{{ thumb.url }}{% empty %}{{ ambassador.photo.url }}{% endthumbnail %}">
+            {% endif %}
+          </div>
+        {% endif %}
+
+        {% include "club/payment_info.html" %}
+</div>
+</div>
 
 </div>