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

117 lines
5.7 KiB
Twig
Raw Normal View History

2016-07-31 19:36:13 +00:00
{% extends 'master.twig' %}
{% set sorts = ['boxes', 'rectangles', 'list'] %}
{% set sort = get.sort in sorts ? get.sort : sorts[0] %}
{% set notfound = rank == 0 %}
{% set rankTitle %}
{% if notfound %}Not found{% else %}{{ ranks[rank].name(true) }}{% endif %}
{% endset %}
{% set rankDescription %}
{% if notfound %}The requested rank could not be found!{% else %}{{ ranks[rank].description }}{% endif %}
{% endset %}
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 %}
2016-07-31 01:32:37 +00:00
{% set title = rankTitle %}
{% block content %}
<div class="headerNotify" 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 %}">{{ rankTitle }}</h1>
<h3>{{ rankDescription }}</h3>
</div>
<div class="membersPage" style="min-height: 500px;">
<div class="dropDown" style="margin: 0 auto; font-size: 1.5em; line-height: 1.5em; height: 30px;">
<div class="dropDownInner" style="float: left; color: #FFF;">
<a class="dropDownDesc">Rank:</a>
{% for r in ranks %}
{% if not r.hidden or (r.hidden and rank == r.id) %}
<a href="{{ route('members.rank', r.id) }}{{ server['QUERY_STRING'] ? '?' : '' }}{{ server['QUERY_STRING'] }}" style="color: {{ r.colour }};"{% if rank == r.id %} class="dropDownSelected"{% endif %}>{{ r.id == 0 ? 'Not found' : r.name(true) }}</a>
{% endif %}
{% endfor %}
</div>
<div class="dropDownInner" style="float: left;">
<a class="dropDownDesc">View:</a>
{% for s in sorts %}
<a href="?{{ server['QUERY_STRING'] }}{{ server['QUERY_STRING'] ? '&' : '' }}sort={{ s }}"{% if s == sort %} class="dropDownSelected"{% endif %}>{{ s|capitalize }}</a>
{% endfor %}
</div>
</div>
{% if not users|length %}
<h1 class="stylised" style="margin: 2em 0;">This rank has no members!</h1>
{% elseif not notfound %}
<div class="membersPageList {{ sort }}">
{% if sort == sorts[2] %}
<table>
<thead>
<tr>
<th>No.</th>
<th>Username</th>
<th>Registered</th>
<th>Last online</th>
<th>User title</th>
<th>Country</th>
</tr>
</thead>
<tfoot>
<tr>
<th>No.</th>
<th>Username</th>
<th>Registered</th>
<th>Last online</th>
<th>User title</th>
<th>Country</th>
</tr>
</tfoot>
{% for count,user in users[currPage] %}
<tbody>
<tr>
<td>
#{{ rank ? count + 1 : count }}
</td>
<td>
<a href="{{ route('user.profile', user.id) }}" class="default" style="font-weight: bold; color: {{ user.colour }}; text-shadow: 0 0 5px {{ user.colour }};">{{ user.username }}</a>
</td>
<td>
2016-08-04 21:24:08 +00:00
<time class="time-ago" datetime="{{ user.registered|date('r') }}">{{ user.registered|date(config('general.date_format')) }}</time>
</td>
<td>
2016-08-04 21:24:08 +00:00
{% 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>
{{ user.title }}
</td>
<td>
<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] %}
<a href="{{ route('user.profile', user.id) }}">{# These comment tags are here to prevent the link extending too far
#}<div class="userBox" id="u{{ user.id }}">{#
2016-09-13 22:05:03 +00:00
#}<img src="/images/pixel.png" alt="{{ user.username }}" style="background: url('{{ route('user.avatar', user.id) }}') no-repeat center / contain;">{#
#}<span class="userBoxUserName" style="color: {{ user.colour }};">{#
#}{{ user.username }}{#
#}</span>{#
#}</div>{#
#}</a>
{% endfor %}
{% endif %}
</div>
{% if users|length > 1 %}
{% include 'elements/pagination.twig' %}
{% endif %}
{% endif %}
</div>
{% endblock %}