This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/resources/views/yuuno/user/members.twig

103 lines
6.4 KiB
Twig
Raw Normal View History

2016-07-31 19:36:13 +00:00
{% extends 'master.twig' %}
{% set sorts = ['boxes', 'rectangles', 'list'] %}
2016-11-04 16:45:53 +00:00
{% set sort = get is defined and get.sort is defined and get.sort in sorts ? get.sort : sorts[0] %}
{% set notfound = rank == 0 %}
2016-11-09 18:32:23 +00:00
{% set title = notfound ? 'Not found' : ranks[rank].name(true) %}
{% set description = notfound ? 'The requested rank could not be found!' : ranks[rank].description %}
2016-09-13 22:05:03 +00:00
{% set users = ranks[rank].users|batch(30) %}
{% set currPage = get.page|default(1) - 1 %}
{% set paginationPages = users %}
{% set paginationUrl %}{% if rank %}{{ route('members.rank', rank) }}{% else %}{{ route('members.index') }}{% endif %}{% endset %}
{% block content %}
2016-11-09 18:32:23 +00:00
<div class="announce-box" style="margin-bottom: 1px;">
<h1 style="{% if rank %}text-shadow: 0 0 5px {{ ranks[rank].colour }}; color: {{ ranks[rank].colour }};{% else %}text-shadow: 0 0 5px #555;{% endif %}">{{ title }}</h1>
<h3>{{ description }}</h3>
</div>
2016-11-09 18:32:23 +00:00
<div class="members" style="min-height: 500px;">
2016-11-08 19:56:37 +00:00
<div style="display: inline-block; margin: 0 auto; font-size: 1.5em; line-height: 1.5em; height: 30px;">
<div class="dropdown" style="float: left; color: #FFF;">
2016-11-09 18:32:23 +00:00
<span class="dropdown__title">Rank:</span>
{% for r in ranks %}
{% if not r.hidden or (r.hidden and rank == r.id) %}
2016-11-08 19:56:37 +00:00
<a class="dropdown__option{% if rank == r.id %} dropdown__option--selected{% endif %}" href="{{ route('members.rank', r.id) }}{{ server['QUERY_STRING'] is defined ? '?' : '' }}{{ server['QUERY_STRING']|default('') }}" style="color: {{ r.colour }};">{{ r.id == 0 ? 'Not found' : r.name(true) }}</a>
{% endif %}
{% endfor %}
</div>
2016-11-08 19:56:37 +00:00
<div class="dropdown" style="float: left;">
2016-11-09 18:32:23 +00:00
<span class="dropdown__title">View:</span>
{% for s in sorts %}
2016-11-08 19:56:37 +00:00
<a class="dropdown__option {% if s == sort %} dropdown__option--selected{% endif %}" href="?{{ server['QUERY_STRING']|default('') }}{{ server['QUERY_STRING']|default('') ? '&' : '' }}sort={{ s }}">{{ s|capitalize }}</a>
{% endfor %}
</div>
</div>
2016-11-09 18:32:23 +00:00
{% if users|length < 1 %}
2016-11-08 19:56:37 +00:00
<h1 style="margin: 2em 0;">This rank has no members!</h1>
{% elseif not notfound %}
2016-11-09 18:32:23 +00:00
<div class="members__list members__list--{{ sort }}">
{% if sort == sorts[2] %}
2016-11-09 18:32:23 +00:00
<table class="members__table">
{% for elem in ['thead', 'tfoot'] %}
<{{ elem }}>
<tr>
<th class="members__table-column members__table-column--legend members__table-column--{{ elem }}">No.</th>
<th class="members__table-column members__table-column--legend members__table-column--{{ elem }}">Username</th>
<th class="members__table-column members__table-column--legend members__table-column--{{ elem }}">Registered</th>
<th class="members__table-column members__table-column--legend members__table-column--{{ elem }}">Last online</th>
<th class="members__table-column members__table-column--legend members__table-column--{{ elem }}">User title</th>
<th class="members__table-column members__table-column--legend members__table-column--{{ elem }}">Country</th>
</tr>
</{{ elem }}>
{% endfor %}
{% for count, user in users[currPage] %}
<tbody>
<tr>
<td class="members__table-column">
#{{ count }}
</td>
<td class="members__table-column">
<a href="{{ route('user.profile', user.id) }}" style="font-weight: bold; color: {{ user.colour }}; text-shadow: 0 0 5px {{ user.colour }};">{{ user.username }}</a>
</td>
<td class="members__table-column">
<time class="time-ago" datetime="{{ user.registered|date('r') }}">{{ user.registered|date(config('general.date_format')) }}</time>
</td>
<td class="members__table-column">
{% if user.lastOnline == 0 %}<i>Never logged in.</i>{% else %}<time class="time-ago" datetime="{{ user.lastOnline|date('r') }}">{{ user.lastOnline|date(config('general.date_format')) }}</time>{% endif %}
</td>
<td class="members__table-column">
{{ user.title }}
</td>
<td class="members__table-column">
<img src="/images/flags/{{ user.country|lower }}.png" alt="{% if user.country|lower == 'xx' %}?{% else %}{{ user.country(true) }}{% endif %}" title="{% if user.country|lower == 'xx' %}Unknown{% else %}{{ user.country(true) }}{% endif %}">
</td>
</tr>
</tbody>
{% endfor %}
</table>
{% else %}
{% for user in users[currPage] %}
2016-11-09 18:32:23 +00:00
{% spaceless %}
<a href="{{ route('user.profile', user.id) }}">
<div class="members__box" id="u{{ user.id }}">
<div class="avatar members__box-avatar" style="background-image: url('{{ route('user.avatar', user.id) }}')"></div>
<span class="members__box-text" style="color: {{ user.colour }};">
{{ user.username }}
</span>
</div>
</a>
{% endspaceless %}
{% endfor %}
{% endif %}
</div>
{% if users|length > 1 %}
{% include 'elements/pagination.twig' %}
{% endif %}
{% endif %}
</div>
{% endblock %}