{% extends "ui/base_ui.html" %} {% set t = tournament %} {% set fallback_name = "Tournament #" ~ t.id %} {% set custom_name = (t.config or {}).get("name") %} {% set name = custom_name or fallback_name %} {% set show_id_badge = custom_name and custom_name != fallback_name %} {% block title %}{{ name }} - ATP Platform{% endblock %} {% block extra_scripts %} {% endblock %} {% block content %} {% if pending_banner_show is defined %} {% include "ui/partials/pending_banner_wrapper.html" %} {% endif %}

{{ name }}{% if show_id_badge %} #{{ t.id }}{% endif %}

{# LABS-TSA PR-5: one-time join_token reveal. Only rendered when the POST handler passes ``join_token_once``; a normal GET never sets this so the token is shown exactly once, in the response body for the create form submit. #} {% if join_token_once %}
Tournament created — copy these into your bot config (the join token is shown once):

Tournament ID:

Join token:

{% endif %}
{% if t.status == "completed" %} completed {% elif t.status == "active" %} active {% elif t.status == "pending" %} pending {% elif t.status == "cancelled" %} cancelled {% endif %} {{ t.game_type }} by {{ creator_name }} {% if t.game_type == "el_farol" %} {% if cards_match_id %} Cards replay → {% else %} Browse El Farol matches → {% endif %} {% endif %} {% if t.game_type == "el_farol" and t.status == "completed" and t.join_token is none %} Winners → {% endif %} {% if t.status == "completed" and t.starts_at and t.ends_at %} {{ t.starts_at.strftime("%b %d, %H:%M") }} — {{ t.ends_at.strftime("%H:%M") }} {% elif t.status == "active" and t.starts_at %} Started {{ t.starts_at.strftime("%b %d, %H:%M") }} {% else %} Created {{ t.created_at.strftime("%b %d, %H:%M") if t.created_at else "—" }} {% endif %}
{% if t.status == "cancelled" %}
{% if t.cancelled_reason and t.cancelled_reason.value == "pending_timeout" %} Expired before full roster {% elif t.cancelled_reason and t.cancelled_reason.value == "admin_action" %} Cancelled by {{ cancelled_by_name or "admin" }} {% elif t.cancelled_reason and t.cancelled_reason.value == "abandoned" %} All participants left {% else %} Cancelled {% endif %}
{% if t.cancelled_reason and t.cancelled_reason.value == "pending_timeout" %} Tournament did not reach the required {{ t.num_players }} players. Auto-cancelled at {{ t.cancelled_at.strftime("%b %d, %H:%M") if t.cancelled_at else "—" }}. {% elif t.cancelled_reason and t.cancelled_reason.value == "admin_action" %} {{ t.cancelled_reason_detail or "" }} Cancelled at {{ t.cancelled_at.strftime("%b %d, %H:%M") if t.cancelled_at else "—" }}. {% elif t.cancelled_reason and t.cancelled_reason.value == "abandoned" %} {% set last_release = sorted_participants | map(attribute="released_at") | reject("none") | sort(reverse=true) | first %} Last departure at {{ last_release.strftime("%b %d, %H:%M") if last_release else "—" }}. {% endif %}
{% endif %}
{% include "ui/partials/tournament_live.html" %}
{% if is_admin and timeline %}

Event Timeline admin only

{% if timeline | length <= 10 %} {% for event_name, event_time, event_detail in timeline %}
{{ event_name }} {{ event_time.strftime("%H:%M:%S") }} {% if event_detail %}
{{ event_detail }}
{% endif %}
{% endfor %} {% else %} {% for event_name, event_time, event_detail in timeline[:5] %}
{{ event_name }} {{ event_time.strftime("%H:%M:%S") }} {% if event_detail %}
{{ event_detail }}
{% endif %}
{% endfor %}
... {{ timeline | length - 10 }} more events ...
{% for event_name, event_time, event_detail in timeline[-5:] %}
{{ event_name }} {{ event_time.strftime("%H:%M:%S") }} {% if event_detail %}
{{ event_detail }}
{% endif %}
{% endfor %} {% endif %}
{% endif %}

View raw JSON →

{% endblock %}