mirror of
https://github.com/ae-utbm/sith.git
synced 2026-09-23 12:44:22 +00:00
50 lines
1.5 KiB
Django/Jinja
50 lines
1.5 KiB
Django/Jinja
{% extends "core/base.jinja" %}
|
|
|
|
{% block title %}
|
|
{% trans %}Subscription stats{% endtrans %}
|
|
{% endblock %}
|
|
|
|
{% block head %}
|
|
{{ super() }}
|
|
<script type="module" src="{{ static('bundled/subscription/stats-index.ts') }}"></script>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<canvas id="statsChart" width="400" height="200"></canvas>
|
|
|
|
<br>
|
|
<table>
|
|
<thead>
|
|
<th>{% trans %}Subscription type{% endtrans %}</th>
|
|
{% for location in locations %}
|
|
<th>{{ location[1] }}</th>
|
|
{% endfor %}
|
|
<th id="graphLabel">{% trans %}Total{% endtrans %}</th>
|
|
</thead>
|
|
<tr>
|
|
<td>{% trans %}All subscriptions{% endtrans %}</td>
|
|
{% for location in locations %}
|
|
<td><i class="nb">{{ total_location[location[0]] }}</i><br></td>
|
|
{% endfor %}
|
|
<td><i class="nb">{{ total_location.values()|sum }}</i></td>
|
|
</tr>
|
|
{% for type in subscriptions_types %}
|
|
<tr>
|
|
<td><i class="types">{{ subscriptions_types[type]['name'] }}</i></td>
|
|
{% for location in locations %}
|
|
<td>
|
|
{% for p_type in payment_types %}
|
|
{% set subtotal = subscriptions[type][location[0]][p_type[0]] %}
|
|
{% if subtotal > 0 %}
|
|
{{ p_type[1] }} : <i class="nb">{{ subtotal }}</i><br>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</td>
|
|
{% endfor %}
|
|
<td class="total"><i class="nb">{{ total_type[type] }}</i></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endblock %}
|