{% chunk 'club_form_top' %}
+ {% club_monthly_since '2020-12-01' as cc %}
+ {% club_monthly_missing_since '2020-12-01' 100 as cm %}
+ <p>Pomóż nam zdobyć 100 nowych Przyjaciół do końca roku. W grudniu stałą wpłatą wsparło nas już <b style="color: #0d7e85">{{ cc }}</b> czytelników i czytelniczek, brakuje <b style="color: #0d7e85">{{ cm }}</b>.</p>
+ <div class="funding" style="background: none;"><div class="description"><div class="progress" style="text-align: center; background-size: {{ cc }}% 1px;"><span class="piece progress-collected"> {{ cc }}</span><span class="piece progress-target">{{ cm }} </span><div style="clear: both"></div></div></div></div>
+
{% include "club/payment_form.html" %}
{% chunk 'club_form_bottom' %}
yearly=False, monthly=False,
payed_at__gte=now() - timedelta(days=30)
).aggregate(s=Sum('amount'))['s'] or 0
+
+
+@register.simple_tag
+def club_monthly_since(start):
+ return Schedule.objects.filter(
+ monthly=True, payed_at__gte=start).count()
+
+
+@register.simple_tag
+def club_monthly_missing_since(start, target):
+ return target - Schedule.objects.filter(
+ monthly=True, payed_at__gte=start).count()