From: Yoan Le Clanche Date: Thu, 6 Feb 2020 10:36:06 +0000 (+0100) Subject: Add payment info to student profile X-Git-Tag: 1.4.1~5^2~4 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=7a6ee6d9d69c1ea2eeffd294084c39ec3813fda2;p=teleforma.git Add payment info to student profile --- diff --git a/teleforma/templates/telemeta/profile_detail.html b/teleforma/templates/telemeta/profile_detail.html index 9237cb6f..c3b519ac 100644 --- a/teleforma/templates/telemeta/profile_detail.html +++ b/teleforma/templates/telemeta/profile_detail.html @@ -2,6 +2,7 @@ {% load i18n %} {% load telemeta_utils %} {% load teleforma_tags %} +{% load payment %} {% block head_title %}{% trans "User Profile" %} : {{ usr.username }}{% endblock %} @@ -103,9 +104,12 @@ {% endif %} - + {% if payment %} + {% payment_summary payment with_pending=False %} + {% endif %} +
diff --git a/teleforma/templatetags/payment.py b/teleforma/templatetags/payment.py index 37a088c8..490a41e7 100644 --- a/teleforma/templatetags/payment.py +++ b/teleforma/templatetags/payment.py @@ -7,7 +7,7 @@ register = template.Library() @register.inclusion_tag('payment/payment_summary.html', takes_context=True) -def payment_summary(context, payment): +def payment_summary(context, payment, with_pending=True): objs = Payment.objects.filter(student = payment.student) payments = [] today = date.today() @@ -16,7 +16,7 @@ def payment_summary(context, payment): if obj.online_paid: status = 'payé' sclass = "paid" - elif obj.id == payment.id: + elif obj.id == payment.id and with_pending: status = 'en cours' sclass = "pending" elif obj.scheduled > today: