{% 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') %}
{% else %}
{% endif %}
{% else %}
{% endif %}
{% else %}
{% if 'online' == sort and 'time' == field %}
{% elseif 'players' == sort and 'frags' == field %}
{% else %}
{% endif %}
{% 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 %}
{{ server.address }}
{% if server.status %}
{% else %}
{% endif %}
{% if server.info %}
{{ 'Info' | trans }}
{% for key, value in server.info %}
{{ key }}
|
{# let's show real connections for players {{ value }} #}
{% if key == 'Players' %}
{{ server.connections }}
{% else %}
{{ value }}
{% endif %}
|
{% endfor %}
{% endif %}
{% if server.session %}
{{ 'Session' | trans }}
{{ 'Player' | trans }} |
{{ 'Frags' | trans }} |
{{ 'Time' | trans }} |
{% for player in server.session %}
{{ player.Name }} |
{{ player.Frags }} |
{% if player.TimeF == '59:59' %}
{% else %}
{{ player.TimeF }}
{% endif %}
|
{% endfor %}
{% endif %}
{% if server.online %}
{{ 'Online' | trans }}
{{ 'Time' | trans }} {{ sort(request, server.crc32server, 'online', 'time') }}
|
{{ 'Players' | trans }} {{ sort(request, server.crc32server, 'online', 'players') }}
|
{{ 'Bots' | trans }} {{ sort(request, server.crc32server, 'online', 'bots') }}
|
{{ 'Total' | trans }} {{ sort(request, server.crc32server, 'online', 'total') }}
|
{% for online in server.online %}
{{ online.time | format_ago }}
|
{{ online.players }} |
{{ online.bots }} |
{{ online.total }} |
{% endfor %}
{% if request.get('sort') == 'online' and request.get('page') > 1 %}
{% else %}
{% endif %}
{% if request.get('sort') != 'online' or request.get('page') ? request.get('page') : 1 < server.pagination.online %}
{% else %}
{% endif %}
{{ 'page' | trans }} {{ request.get('sort') == 'online' and request.get('page') ? request.get('page') : 1 }}/{{ server.pagination.online }}
{% endif %}
{% if server.players %}
{{ 'Players' | trans }}
{{ 'Frags' | trans }} {{ sort(request, server.crc32server, 'players', 'frags') }}
|
{{ 'Name' | trans }} {{ sort(request, server.crc32server, 'players', 'name') }}
|
{{ 'Joined' | trans }} {{ sort(request, server.crc32server, 'players', 'joined') }}
|
{{ 'Online' | trans }} {{ sort(request, server.crc32server, 'players', 'online') }}
|
{% for player in server.players %}
{{ player.frags }} |
{{ player.name }} |
{{ player.joined | format_ago }}
|
{{ player.online | format_ago }}
|
{% endfor %}
{% if request.get('sort') == 'players' and request.get('page') > 1 %}
{% else %}
{% endif %}
{% if request.get('sort') != 'players' or request.get('page') ? request.get('page') : 1 < server.pagination.players %}
{% else %}
{% endif %}
{{ 'page' | trans }} {{ request.get('sort') == 'players' and request.get('page') ? request.get('page') : 1 }}/{{ server.pagination.players }}
{% endif %}
{% endblock %}