You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/packages/ui-default/templates/ranking.html

78 lines
3.3 KiB
HTML

{% extends "layout/basic.html" %}
{% import "components/paginator.html" as paginator with context %}
{% import "components/nothing.html" as nothing with context %}
{% block content %}
<div class="row">
<div class="medium-12 columns">
<div class="section">
<div class="section__body no-padding">
<div data-fragment-id="ranking">
{% if not udocs.length %}
{{ nothing.render('Sorry, there are no users in this domain.') }}
{% else %}
<table class="data-table">
<colgroup>
<col class="col--rank">
<col class="col--user">
<col class="col--rp">
{% for key, def in model.rp %}
{% if not def.hidden %}
<col class="col--detail rp-{{ key }}">
{% endif %}
{% endfor %}
<col class="col--ac">
<col class="col--bio">
</colgroup>
<thead>
<tr>
<th class="col--rank">{{ _('Rank') }}</th>
<th class="col--user">{{ _('Username') }}</th>
<th class="col--rp">{{ _('RP') }}</th>
{% for key, def in model.rp %}
{% if not def.hidden %}
<th class="col--detail rp-{{ key }}">{{ _('rpDetailText_' + key) }}</th>
{% endif %}
{% endfor %}
<th class="col--ac">{{ _('Accept') }}</th>
<th class="col--bio">{{ _('Bio') }}</th>
</tr>
</thead>
<tbody>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<tr>
<td class="col--rank">{{ handler.user.rank|default('-') }}</td>
<td class="col--user">{{ user.render_inline(handler.user) }}</td>
<td class="col--rp">{{ handler.user.rp|default(0)|round(0) }}</td>
{% for key, def in model.rp %}
{% if not def.hidden %}
<td class="col--detail rp-{{ key }}">{{ handler.user.rpInfo[key]|round if (handler.user.rpInfo|default({}))[key] else '-' }}</td>
{% endif %}
{% endfor %}
<td class="col--ac">{{ handler.user.nAccept|default(0) }}</td>
<td class="col--bio">{{ handler.user.bio|default('')|truncate(64, true)|markdownInline|safe }}</td>
</tr>
{% endif %}
{%- for udoc in udocs -%}
<tr>
<td class="col--rank">{{ (page - 1) * 100 + loop.index }}</td>
<td class="col--user">{{ user.render_inline(udoc) }}</td>
<td class="col--rp">{{ udoc.rp|default(0)|round(0) }}</td>
{% for key, def in model.rp %}
{% if not def.hidden %}
<td class="col--detail rp-{{ key }}">{{ udoc.rpInfo[key]|round if udoc.rpInfo[key] else '-' }}</td>
{% endif %}
{% endfor %}
<td class="col--ac">{{ udoc.nAccept|default(0) }}</td>
<td class="col--bio">{{ udoc.bio|default('')|truncate(64, true)|markdownInline|safe }}</td>
</tr>
{%- endfor -%}
</tbody>
</table>
{{ paginator.render(page, upcount) }}
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}