{% 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.info.HostName is defined %}{{ 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 }} |
{{ 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 %}
{% endblock %}