Files
OpenBench/Templates/OpenBench/users.html
T

125 lines
5.6 KiB
HTML

{% extends "OpenBench/base.html" %}
{% load mytags %}
{% block page_head %}
<div>
<h1 class="page-title">Users</h1>
<p class="page-sub">Contributors and approvers, with games split by time control</p>
</div>
<div class="page-actions">
<div class="seg" role="group" aria-label="Rank users by">
<a class="seg-btn{% if sort == 'total' %} active{% endif %}" href="?sort=total">All games</a>
<a class="seg-btn{% if sort == 'stc' %} active{% endif %}" href="?sort=stc">STC</a>
<a class="seg-btn{% if sort == 'ltc' %} active{% endif %}" href="?sort=ltc">LTC</a>
<a class="seg-btn{% if sort == 'tests' %} active{% endif %}" href="?sort=tests">Tests</a>
</div>
</div>
{% endblock %}
{% block content %}
<div class="stat-grid">
<div class="stat-card stat-green">
<span class="stat-icon"><i class="fa-solid fa-users"></i></span>
<div>
<div class="stat-value">{{ summary.users|insertCommas }}</div>
<div class="stat-label">Contributors</div>
</div>
</div>
<div class="stat-card">
<span class="stat-icon"><i class="fa-solid fa-chess"></i></span>
<div>
<div class="stat-value">{{ summary.total|insertCommas }}</div>
<div class="stat-label">Total games</div>
</div>
</div>
<div class="stat-card">
<span class="stat-icon"><i class="fa-solid fa-bolt"></i></span>
<div>
<div class="stat-value">{{ summary.stc|insertCommas }}</div>
<div class="stat-label">STC games</div>
<div class="stat-sub">{{ summary.stc_share }}% of classified games</div>
</div>
</div>
<div class="stat-card stat-purple">
<span class="stat-icon"><i class="fa-solid fa-hourglass-half"></i></span>
<div>
<div class="stat-value">{{ summary.ltc|insertCommas }}</div>
<div class="stat-label">LTC games</div>
<div class="stat-sub">{{ summary.ltc_share }}% of classified games</div>
</div>
</div>
</div>
<section class="card">
<header class="card-head">
<h2 class="card-title">Games by time control</h2>
<div class="legend">
<span><i class="dot dot-stc"></i>STC</span>
<span><i class="dot dot-ltc"></i>LTC</span>
{% if show_other %}<span><i class="dot dot-other"></i>Other</span>{% endif %}
</div>
</header>
<div class="split-overview">
<div class="splitbar splitbar-lg">
<span class="splitbar-stc" style="width: {{ summary.stc_share }}%"></span>
<span class="splitbar-ltc" style="width: {{ summary.ltc_share }}%"></span>
<span class="splitbar-other" style="width: {{ summary.oth_share }}%"></span>
</div>
<p class="muted-small">
STC is a Fischer time control with a base time under {{ stc_limit }} seconds, like 10+0.1.
LTC is {{ stc_limit }} seconds or more, like 60+0.6.
Fixed nodes, depth, movetime, and cyclic controls count as Other.
Games are credited to the user whose machines played them.
</p>
</div>
</section>
<section class="card">
<table class="hoverable">
<tr class="table-header">
<th>#</th>
<th>Username</th>
<th class="numeric{% if sort == 'total' %} sorted{% endif %}">Games</th>
<th class="numeric{% if sort == 'stc' %} sorted{% endif %}">STC</th>
<th class="numeric{% if sort == 'ltc' %} sorted{% endif %}">LTC</th>
{% if show_other %}<th class="numeric">Other</th>{% endif %}
<th>Split</th>
<th class="numeric{% if sort == 'tests' %} sorted{% endif %}">Tests</th>
<th>Engine</th>
<th>Created</th>
</tr>
{% for row in rows %}
<tr>
<td class="rank">{{ forloop.counter }}</td>
<td>
<a href="/user/{{ row.username }}">{{ row.username|capfirst }}</a>
{% if row.approver %}<span class="badge badge-info">approver</span>{% endif %}
</td>
<td class="numeric">{{ row.total|insertCommas }}</td>
<td class="numeric num-stc">{{ row.stc|insertCommas }}</td>
<td class="numeric num-ltc">{{ row.ltc|insertCommas }}</td>
{% if show_other %}<td class="numeric">{{ row.other|insertCommas }}</td>{% endif %}
<td>
<div class="splitbar" title="STC {{ row.stc_share }}% / LTC {{ row.ltc_share }}%{% if show_other %} / Other {{ row.oth_share }}%{% endif %}">
<span class="splitbar-stc" style="width: {{ row.stc_share }}%"></span>
<span class="splitbar-ltc" style="width: {{ row.ltc_share }}%"></span>
<span class="splitbar-other" style="width: {{ row.oth_share }}%"></span>
</div>
</td>
<td class="numeric">{{ row.tests|insertCommas }}</td>
<td>{{ row.engine }}</td>
<td class="timestamp">{{ row.joined|date:'U' }}</td>
</tr>
{% empty %}
<tr class="empty-row"><td colspan="10"><i class="fa-regular fa-user"></i>No users yet.</td></tr>
{% endfor %}
</table>
</section>
{% endblock %}