]> git.parisson.com Git - teleforma.git/commitdiff
Add payment info to student profile
authorYoan Le Clanche <yoanl@pilotsystems.net>
Thu, 6 Feb 2020 10:36:06 +0000 (11:36 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Thu, 6 Feb 2020 10:36:06 +0000 (11:36 +0100)
teleforma/templates/telemeta/profile_detail.html
teleforma/templatetags/payment.py

index 9237cb6f22e363b4f869e7286c0a50544582e53d..c3b519ac515a78cbf1030c8bbca04fd1d882b261 100644 (file)
@@ -2,6 +2,7 @@
 {% load i18n %}
 {% load telemeta_utils %}
 {% load teleforma_tags %}
+{% load payment %}
 
 {% block head_title %}{% trans "User Profile" %} : {{ usr.username }}{% endblock %}
 
       {%  endif %}
      </dl>
     </div>
-
   </div>
 
+  {% if payment %}
+    {% payment_summary payment with_pending=False %}
+  {% endif %}
+
 <div class="buttons">
 <!--<a href="{% url telemeta-password-change %}" class="component_icon button icon_login">{% trans "Password reset" %}</a>-->
 </div>
index 37a088c8c42fe261ae6a9d4584bd7581d3d264f3..490a41e78d6a5e68c3ba155fbfcc5083726f00d4 100644 (file)
@@ -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: