mirror of https://github.com/YGGverse/HLState.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
278 lines
19 KiB
278 lines
19 KiB
{% macro sort(request, crc32server, sort, field) %} |
|
{% if sort == request.get('sort') and crc32server == request.get('crc32server') %} |
|
{% if field == request.get('field') %} |
|
{% if 'asc' == request.get('order') %} |
|
<a href="{{ path('server_index', { sort : sort, field : field, order : 'desc', crc32server : crc32server, '_fragment' : sort }) }}" rel="nofollow"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 4a.5.5 0 0 0-.374.832l4 4.5a.5.5 0 0 0 .748 0l4-4.5A.5.5 0 0 0 12 6z"/> |
|
</svg></a> |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 9h8a.5.5 0 0 0 .374-.832l-4-4.5a.5.5 0 0 0-.748 0l-4 4.5A.5.5 0 0 0 4 11"/> |
|
</svg> |
|
{% else %} |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 4a.5.5 0 0 0-.374.832l4 4.5a.5.5 0 0 0 .748 0l4-4.5A.5.5 0 0 0 12 6z"/> |
|
</svg> |
|
<a href="{{ path('server_index', { sort : sort, field : field, order : 'asc', crc32server : crc32server, '_fragment' : sort }) }}" rel="nofollow"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 9h8a.5.5 0 0 0 .374-.832l-4-4.5a.5.5 0 0 0-.748 0l-4 4.5A.5.5 0 0 0 4 11"/> |
|
</svg></a> |
|
{% endif %} |
|
{% else %} |
|
<a href="{{ path('server_index', { sort : sort, field : field, order : 'desc', crc32server : crc32server, '_fragment' : sort }) }}" rel="nofollow"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 4a.5.5 0 0 0-.374.832l4 4.5a.5.5 0 0 0 .748 0l4-4.5A.5.5 0 0 0 12 6z"/> |
|
</svg></a> |
|
<a href="{{ path('server_index', { sort : sort, field : field, order : 'asc', crc32server : crc32server, '_fragment' : sort }) }}" rel="nofollow"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 9h8a.5.5 0 0 0 .374-.832l-4-4.5a.5.5 0 0 0-.748 0l-4 4.5A.5.5 0 0 0 4 11"/> |
|
</svg></a> |
|
{% endif %} |
|
{% else %} |
|
{% if 'online' == sort and 'time' == field %} |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 4a.5.5 0 0 0-.374.832l4 4.5a.5.5 0 0 0 .748 0l4-4.5A.5.5 0 0 0 12 6z"/> |
|
</svg> |
|
{% elseif 'players' == sort and 'frags' == field %} |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 4a.5.5 0 0 0-.374.832l4 4.5a.5.5 0 0 0 .748 0l4-4.5A.5.5 0 0 0 12 6z"/> |
|
</svg> |
|
{% else %} |
|
<a href="{{ path('server_index', { sort : sort, field : field, order : 'desc', crc32server : crc32server, '_fragment' : sort }) }}" rel="nofollow"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 4a.5.5 0 0 0-.374.832l4 4.5a.5.5 0 0 0 .748 0l4-4.5A.5.5 0 0 0 12 6z"/> |
|
</svg></a> |
|
{% endif %} |
|
<a href="{{ path('server_index', { sort : sort, field : field, order : 'asc', crc32server : crc32server, '_fragment' : sort }) }}" rel="nofollow"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4 9h8a.5.5 0 0 0 .374-.832l-4-4.5a.5.5 0 0 0-.748 0l-4 4.5A.5.5 0 0 0 4 11"/> |
|
</svg></a> |
|
{% endif %} |
|
{% endmacro %} |
|
{% from _self import sort %} |
|
{% extends 'default/layout.html.twig' %} |
|
{% block head_title_content %}{% if server.name %}{{ server.name }}{% elseif server.info.HostName %}{{ server.info.HostName }}{% else %}#{{ server.crc32server }}{% endif %} - {{ app.name }}{% endblock %} |
|
{% block main_content %} |
|
<div class="border-default padding-8-px margin-y-8-px"> |
|
<h2> |
|
{{ server.address }} |
|
{% if server.status %} |
|
<span class="color-success" title="{{ 'Online' | trans }}"> |
|
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16"> |
|
<path fill-rule="evenodd" d="M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10"/> |
|
</svg> |
|
</span> |
|
{% else %} |
|
<span class="color-error" title="{{ 'Offline' | trans }}"> |
|
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16"> |
|
<path fill-rule="evenodd" d="M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10"/> |
|
</svg> |
|
</span> |
|
{% endif %} |
|
</h2> |
|
<hr /> |
|
{% if server.info %} |
|
<h3 class="padding-y-8-px text-align-right">{{ 'Info' | trans }}</h3> |
|
<table> |
|
{% for key, value in server.info %} |
|
<tr> |
|
<td class="text-align-left"> |
|
{{ key }} |
|
</td> |
|
<td class="text-align-left"> |
|
{# let's show real connections for players {{ value }} #} |
|
{% if key == 'Players' %} |
|
{{ server.connections }} |
|
{% else %} |
|
{{ value }} |
|
{% endif %} |
|
</td> |
|
</tr> |
|
{% endfor %} |
|
</table> |
|
{% endif %} |
|
{% if server.session %} |
|
<h3 class="padding-y-8-px text-align-right">{{ 'Session' | trans }}</h3> |
|
<table> |
|
<tr> |
|
<th class="text-align-left">{{ 'Player' | trans }}</th> |
|
<th class="text-align-center">{{ 'Frags' | trans }}</th> |
|
<th class="text-align-center">{{ 'Time' | trans }}</th> |
|
</tr> |
|
{% for player in server.session %} |
|
<tr> |
|
<td class="text-align-left">{{ player.Name }}</td> |
|
<td class="text-align-center">{{ player.Frags }}</td> |
|
<td class="text-align-center"> |
|
{% if player.TimeF == '59:59' %} |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M5.68 5.792 7.345 7.75 5.681 9.708a2.75 2.75 0 1 1 0-3.916ZM8 6.978 6.416 5.113l-.014-.015a3.75 3.75 0 1 0 0 5.304l.014-.015L8 8.522l1.584 1.865.014.015a3.75 3.75 0 1 0 0-5.304l-.014.015zm.656.772 1.663-1.958a2.75 2.75 0 1 1 0 3.916z"/> |
|
</svg> |
|
{% else %} |
|
{{ player.TimeF }} |
|
{% endif %} |
|
</td> |
|
</tr> |
|
{% endfor %} |
|
</table> |
|
{% endif %} |
|
{% if server.online %} |
|
<a name="online"></a> |
|
<h3 class="padding-y-8-px text-align-right"> |
|
{{ 'Online' | trans }} |
|
<a href="{{ path('rss_online', { crc32server : server.crc32server }) }}" title="{{ 'RSS' | trans }}"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm1.5 2.5c5.523 0 10 4.477 10 10a1 1 0 1 1-2 0 8 8 0 0 0-8-8 1 1 0 0 1 0-2m0 4a6 6 0 0 1 6 6 1 1 0 1 1-2 0 4 4 0 0 0-4-4 1 1 0 0 1 0-2m.5 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/> |
|
</svg></a> |
|
</h3> |
|
<table> |
|
<tr> |
|
<th class="text-align-left"> |
|
{{ 'Time' | trans }} {{ sort(request, server.crc32server, 'online', 'time') }} |
|
</th> |
|
<th class="text-align-center"> |
|
{{ 'Players' | trans }} {{ sort(request, server.crc32server, 'online', 'players') }} |
|
</th> |
|
<th class="text-align-center"> |
|
{{ 'Bots' | trans }} {{ sort(request, server.crc32server, 'online', 'bots') }} |
|
</th> |
|
<th class="text-align-center"> |
|
{{ 'Total' | trans }} {{ sort(request, server.crc32server, 'online', 'total') }} |
|
</th> |
|
</tr> |
|
{% for online in server.online %} |
|
<tr> |
|
<td class="text-align-left"> |
|
<span title="{{ online.time | date('r') }}"> |
|
{{ online.time | format_ago }} |
|
</span> |
|
</td> |
|
<td class="text-align-center">{{ online.players }}</td> |
|
<td class="text-align-center">{{ online.bots }}</td> |
|
<td class="text-align-center">{{ online.total }}</td> |
|
</tr> |
|
{% endfor %} |
|
</table> |
|
<div class="padding-y-8-px"> |
|
{% if request.get('sort') == 'online' and request.get('page') > 1 %} |
|
<a rel="nofollow" href="{{ |
|
path( |
|
'server_index', |
|
{ |
|
sort : 'online', |
|
field : request.get('field') ? request.get('field') : 'frags', |
|
order : request.get('order') ? request.get('order') : 'desc', |
|
page : request.get('page') ? request.get('page') - 1 : 1, |
|
crc32server : server.crc32server, |
|
'_fragment' : 'online' |
|
} |
|
) }}"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-caret-left-square-fill" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm10.5 10V4a.5.5 0 0 0-.832-.374l-4.5 4a.5.5 0 0 0 0 .748l4.5 4A.5.5 0 0 0 10.5 12"/> |
|
</svg></a> |
|
{% else %} |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-caret-left-square-fill" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm10.5 10V4a.5.5 0 0 0-.832-.374l-4.5 4a.5.5 0 0 0 0 .748l4.5 4A.5.5 0 0 0 10.5 12"/> |
|
</svg> |
|
{% endif %} |
|
{% if server.pagination.online > 1 and (request.get('sort') != 'online' or server.pagination.online > request.get('page')) %} |
|
<a rel="nofollow" href="{{ |
|
path( |
|
'server_index', |
|
{ |
|
sort : 'online', |
|
field : request.get('sort') == 'online' and request.get('field') ? request.get('field') : 'time', |
|
order : request.get('sort') == 'online' and request.get('order') ? request.get('order') : 'desc', |
|
page : (request.get('sort') == 'online' and request.get('page') ? request.get('page') : 1) + 1, |
|
crc32server : server.crc32server, |
|
'_fragment' : 'online' |
|
} |
|
) }}"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4z"/> |
|
</svg></a> |
|
{% else %} |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4z"/> |
|
</svg> |
|
{% endif %} |
|
{{ 'page' | trans }} {{ request.get('sort') == 'online' and request.get('page') ? request.get('page') : 1 }}/{{ server.pagination.online }} |
|
</div> |
|
{% endif %} |
|
{% if server.players %} |
|
<a name="players"></a> |
|
<h3 class="padding-y-8-px text-align-right"> |
|
{{ 'Players' | trans }} |
|
<a href="{{ path('rss_players', { crc32server : server.crc32server }) }}" title="{{ 'RSS' | trans }}"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm1.5 2.5c5.523 0 10 4.477 10 10a1 1 0 1 1-2 0 8 8 0 0 0-8-8 1 1 0 0 1 0-2m0 4a6 6 0 0 1 6 6 1 1 0 1 1-2 0 4 4 0 0 0-4-4 1 1 0 0 1 0-2m.5 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/> |
|
</svg></a> |
|
</h3> |
|
<table> |
|
<tr> |
|
<th class="text-align-center"> |
|
{{ 'Frags' | trans }} {{ sort(request, server.crc32server, 'players', 'frags') }} |
|
</th> |
|
<th class="text-align-left"> |
|
{{ 'Name' | trans }} {{ sort(request, server.crc32server, 'players', 'name') }} |
|
</th> |
|
<th class="text-align-left"> |
|
{{ 'Joined' | trans }} {{ sort(request, server.crc32server, 'players', 'joined') }} |
|
</th> |
|
<th class="text-align-left"> |
|
{{ 'Online' | trans }} {{ sort(request, server.crc32server, 'players', 'online') }} |
|
</th> |
|
</tr> |
|
{% for player in server.players %} |
|
<tr> |
|
<td class="text-align-center">{{ player.frags }}</td> |
|
<td class="text-align-left">{{ player.name }}</td> |
|
<td class="text-align-left"> |
|
<span title="{{ player.joined | date('r') }}"> |
|
{{ player.joined | format_ago }} |
|
</span> |
|
</td> |
|
<td class="text-align-left"> |
|
<span title="{{ player.online | date('r') }}"> |
|
{{ player.online | format_ago }} |
|
</span> |
|
</td> |
|
</tr> |
|
{% endfor %} |
|
</table> |
|
<div class="padding-y-8-px"> |
|
{% if request.get('sort') == 'players' and request.get('page') > 1 %} |
|
<a rel="nofollow" href="{{ |
|
path( |
|
'server_index', |
|
{ |
|
sort : 'players', |
|
field : request.get('field') ? request.get('field') : 'frags', |
|
order : request.get('order') ? request.get('order') : 'desc', |
|
page : request.get('page') ? request.get('page') - 1 : 1, |
|
crc32server : server.crc32server, |
|
'_fragment' : 'players' |
|
} |
|
) }}"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-caret-left-square-fill" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm10.5 10V4a.5.5 0 0 0-.832-.374l-4.5 4a.5.5 0 0 0 0 .748l4.5 4A.5.5 0 0 0 10.5 12"/> |
|
</svg></a> |
|
{% else %} |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-caret-left-square-fill" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm10.5 10V4a.5.5 0 0 0-.832-.374l-4.5 4a.5.5 0 0 0 0 .748l4.5 4A.5.5 0 0 0 10.5 12"/> |
|
</svg> |
|
{% endif %} |
|
{% if server.pagination.players > 1 and (request.get('sort') != 'players' or server.pagination.players > request.get('page')) %} |
|
<a rel="nofollow" href="{{ |
|
path( |
|
'server_index', |
|
{ |
|
sort : 'players', |
|
field : request.get('sort') == 'players' and request.get('field') ? request.get('field') : 'frags', |
|
order : request.get('sort') == 'players' and request.get('order') ? request.get('order') : 'desc', |
|
page : (request.get('sort') == 'players' and request.get('page') ? request.get('page') : 1) + 1, |
|
crc32server : server.crc32server, |
|
'_fragment' : 'players' |
|
} |
|
) }}"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4z"/> |
|
</svg></a> |
|
{% else %} |
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16"> |
|
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4z"/> |
|
</svg> |
|
{% endif %} |
|
{{ 'page' | trans }} {{ request.get('sort') == 'players' and request.get('page') ? request.get('page') : 1 }}/{{ server.pagination.players }} |
|
</div> |
|
{% endif %} |
|
</div> |
|
{% endblock %} |