{% endif %}
{% endif %}
{% if score_type is defined and score_type.max_public_score < score_type.max_score %}
{% if status == SubmissionResult.SCORED and (s.token is not none or actual_phase == 3) %}
{# We replace '.%l' with the actual language only when it occurs as an extension at the end of the string and only when #}
{# there isn't another file with that name. This allows to securily reverse the replacement and should work great in #}
{# the common case. Yet, it still allows the marginal case of both 'foo.%l' and 'foo.c' in the submission format. #}
{% if s.files|length == 0 %}
{% trans %}None{% endtrans %}
{% elif s.files|length == 1 %}
{% set filename = next(iterkeys(s.files)) %}
{% if s.language is not none %}
{% set filename = filename|replace(".%l", (s.language|to_language).source_extension) %}
{% endif %}
{% trans %}Download{% endtrans %}
{% else %}
{% for filename in s.files %}
{% if s.language is not none %}
{% set temp_filename = filename|replace(".%l", (s.language|to_language).source_extension) %}
{% if temp_filename not in s.files %}
{% set filename = temp_filename %}
{% endif %}
{% endif %}
{% endif %}
{% if can_use_tokens and actual_phase == 0 %}
{% if s.token is not none %}
{% trans %}Played{% endtrans %}
{% else %}
{# TODO If the expiration or generation time are greater than valid_phase_end they "don't exist". It's useless to show "Wait..." in those cases. #}
{% if can_play_token and not need_to_wait %}
{% elif (can_play_token and need_to_wait) or (not can_play_token and tokens_info[1] is not none) %}
{% trans %}Wait...{% endtrans %}
{% else %}
{% trans %}No tokens{% endtrans %}
{% endif %}
{% endif %}