{% extends "base.html" %} {% block title %}Statystyki{% endblock %} {% block content %}
Rozkład geograficzny
{% set ns = namespace(total_geo=0) %} {% for _, c in stats.geo_distribution.items() %}{% set ns.total_geo = ns.total_geo + (c|int) %}{% endfor %} {% for country, count in stats.geo_distribution.items() %} {% set pct = ((count|int) / (ns.total_geo if ns.total_geo>0 else 1) * 100) | round(1) %} {% set pct = 0 if pct < 0 else (100 if pct> 100 else pct) %} {% endfor %} {% if stats.geo_distribution|length == 0 %} {% endif %}
Kraj Udział Liczba
{{ country }}
{{ pct }}%
{{ count|int }}
Brak danych
Przyczyny banów
{% set nsr = namespace(total=0) %} {% for _, v in stats.ban_reasons.items() %}{% set nsr.total = nsr.total + (v|int) %}{% endfor %} {% if stats.ban_reasons|length == 0 %}
Brak danych
{% else %}
{% for reason, count in (stats.ban_reasons|dictsort(by='value', reverse=true)) %} {% set label = reason if reason else 'Manual ban' %} {% set pct = ((count|int) / (nsr.total if nsr.total>0 else 1) * 100) | round(1) %} {% set pct = 0 if pct < 0 else (100 if pct> 100 else pct) %}
{{ label }} {{ count|int }} ({{ pct }}%)
{% endfor %}
{% endif %}
{% endblock %} {% block scripts %} {{ super() }} {% endblock %}