Sith/counter/templates/counter/stats.jinja

50 lines
1.8 KiB
Plaintext
Raw Normal View History

2016-09-15 09:07:03 +00:00
{% 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>
2016-09-15 09:51:05 +00:00
{% 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 -%}
2016-09-15 09:07:03 +00:00
{{ m.club.name }}
2016-09-15 09:51:05 +00:00
{%- endfor %}
2016-09-15 09:07:03 +00:00
</td>
<td>{{ r.selling_sum }} €</td>
<td>{{ '%.2f'|format(100 * r.selling_sum / total_sellings) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}