Sith/core/templates/core/user_account.jinja

78 lines
2.2 KiB
Plaintext
Raw Normal View History

{% extends "core/base.jinja" %}
2016-09-06 19:47:15 +00:00
{% macro monthly(obj) %}
<div>
<table>
<thead>
2016-09-06 16:43:39 +00:00
<tr>
<td>{% trans %}Year{% endtrans %}</td>
<td>{% trans %}Month{% endtrans %}</td>
<td>{% trans %}Total{% endtrans %}</td>
2016-09-06 16:43:39 +00:00
</tr>
</thead>
<tbody>
{% for array in obj %}
{% for tuple in array %}
{% if tuple[0] != 0 %}
{% set link=url('core:user_account_detail', user_id=profile.id, year=tuple[1].year, month=tuple[1].month) %}
<tr>
<td><a href="{{ link }}">{{ tuple[1].year }}</a></td>
<td><a href="{{ link }}">{{ tuple[1]|date("E") }}</a></td>
<td><a href="{{ link }}">{{ tuple[0] }} €</a></td>
</tr>
{% endif %}
{% endfor %}
2016-09-06 16:43:39 +00:00
{% endfor %}
</tbody>
</table>
</div>
2016-09-06 19:47:15 +00:00
{% endmacro %}
{% block title %}
{% trans user_name=profile.get_display_name() %}{{ user_name }}'s account{% endtrans %}
{% endblock %}
{% block content %}
{% if customer %}
<h3>{% trans %}User account{% endtrans %}</h3>
<p>{% trans %}Amount: {% endtrans %}{{ customer.amount }} €</p>
<div id="drop">
2016-09-06 19:47:15 +00:00
{% if customer.refillings.exists() %}
{% if customer.buyings.exists() %}
<h5>{% trans %}Account buyings{% endtrans %}</h5>
{{ monthly(buyings_month) }}
{% endif %}
<h5>{% trans %}Refillings{% endtrans %}</h5>
{{ monthly(refilling_month) }}
{% endif %}
{% if customer.user.invoices.exists() %}
<h5>{% trans %}Eboutic invoices{% endtrans %}</h5>
{{ monthly(invoices_month) }}
{% endif %}
{% if etickets %}
<h4>{% trans %}Etickets{% endtrans %}</h4>
<div>
<ul>
{% for s in etickets %}
<li><a href="{{ url('counter:eticket_pdf', selling_id=s.id) }}">{{ s.quantity }} x {{ s.product.eticket }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
2016-08-05 07:52:19 +00:00
{% else %}
<p>{% trans %}User has no account{% endtrans %}</p>
{% endif %}
{% endblock %}
{% block script %}
{{ super() }}
<script>
$(function(){
$("#drop").accordion();
});
</script>
{% endblock %}