Sith/counter/templates/counter/stats.jinja
2017-01-04 17:38:09 +01:00

100 lines
3.3 KiB
Django/Jinja

{% extends "core/base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %}
{% block title %}
{% trans counter_name=counter %}{{ counter_name }} stats{% endtrans %}
{% endblock %}
{% block content %}
<h3>{% trans counter_name=counter %}{{ counter_name }} stats{% endtrans %}</h3>
<h4>{% trans counter_name=counter.name %}Top 100 {{ counter_name }}{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Nb{% endtrans %}</td>
<td>{% trans %}User{% endtrans %}</td>
<td>{% trans %}Promo{% endtrans %}</td>
<td>{% trans %}Clubs{% endtrans %}</td>
<td>{% trans %}Total{% endtrans %}</td>
<td>{% trans %}Percentage{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for r in top %}
{% set customer=Customer.objects.filter(user__id=r.customer__user).first() %}
{% if customer.user == user %}
<tr class="highlight">
{% else %}
<tr>
{% endif %}
<td>{{ loop.index }}</td>
<td>{{ customer.user.get_display_name() }}</td>
<td>{{ customer.user.promo or '' }}</td>
<td>
{% for m in customer.user.memberships.filter(club__parent=None, end_date=None,
role__gt=settings.SITH_MAXIMUM_FREE_ROLE).all() -%}
{%- if loop.index>1 -%}, {% endif -%}
{{ m.club.name }}
{%- endfor %}
</td>
<td>{{ r.selling_sum }} €</td>
<td>{{ '%.2f'|format(100 * r.selling_sum / total_sellings) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<h4>{% trans counter_name=counter.name %}Top 100 barman {{ counter_name }}{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Nb{% endtrans %}</td>
<td>{% trans %}User{% endtrans %}</td>
<td>{% trans %}Time{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for r in top_barman_semester %}
{% set u=User.objects.filter(id=r.user).first() %}
{% if u == user %}
<tr class="highlight">
{% else %}
<tr>
{% endif %}
<td>{{ loop.index }}</td>
<td>{{ u.get_display_name() }}</td>
<td>{{ r.perm_sum }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<h4>{% trans counter_name=counter.name %}Top 100 barman {{ counter_name }} (all semesters){% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Nb{% endtrans %}</td>
<td>{% trans %}User{% endtrans %}</td>
<td>{% trans %}Time{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for r in top_barman %}
{% set u=User.objects.filter(id=r.user).first() %}
{% if u == user %}
<tr class="highlight">
{% else %}
<tr>
{% endif %}
<td>{{ loop.index }}</td>
<td>{{ u.get_display_name() }}</td>
<td>{{ r.perm_sum }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}