{% 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 main_content %}
{% for server in servers %}
{% if server.info.HostName is defined %}
{{ server.info.HostName }} [#{{ server.crc32server }}]
{% else %}
#{{ server.crc32server }}
{% endif %}
{% if server.description.title is defined %}
{{ server.description.title }}
{% endif %}
{% if server.description.links %}
{% for link in server.description.links %}
- {{ link }}
{% endfor %}
{% endif %}
{{ 'Address' | trans }}
{{ server.host }}:{{ server.port }}
{% if server.status %}
{% else %}
{% endif %}
{% if server.aliases %}
{{ 'Alias' | trans }}
{% for alias in server.aliases %}
{{ alias.host }}:{{ alias.port }}
{% if alias.status %}
{% else %}
{% endif %}
{% endfor %}
{% endif %}
{% if server.info %}
{{ 'Info' | trans }}
{% for key, value in server.info %}
{{ key }} |
{{ value }} |
{% 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 | date('r') }} |
{{ online.players }} |
{{ online.bots }} |
{{ online.total }} |
{% endfor %}
{% endif %}
{% if server.players %}
{{ 'Players' | trans }}
{{ 'Frags' | trans }} {{ sort(request, server.crc32server, 'players', 'frags') }}
|
{{ 'Name' | trans }} {{ sort(request, server.crc32server, 'players', 'name') }}
|
{{ 'Online' | trans }} {{ sort(request, server.crc32server, 'players', 'online') }}
|
{{ 'Joined' | trans }} {{ sort(request, server.crc32server, 'players', 'joined') }}
|
{% for player in server.players %}
{{ player.frags }} |
{{ player.name }} |
{{ player.online | format_date }} |
{{ player.joined | format_date }} |
{% endfor %}
{% endif %}
{% endfor %}
{% endblock %}