{% set status = tr.get_status() if tr is defined else UserTestResult.COMPILING %} {% if show_date %} {{ t.timestamp|format_datetime }} {% else %} {{ t.timestamp|format_time }} {% endif %} {% if status == UserTestResult.COMPILING %} {% trans %}Compiling...{% endtrans %} {% elif status == UserTestResult.COMPILATION_FAILED %} {% trans %}Compilation failed{% endtrans %} {% trans %}details{% endtrans %} {% elif status == UserTestResult.EVALUATING %} {% trans %}Executing...{% endtrans %} {% elif status == UserTestResult.EVALUATED %} {% trans %}Executed{% endtrans %} {% trans %}details{% endtrans %} {% endif %} {% if tr is undefined or tr.execution_time is none %} {% trans %}N/A{% endtrans %} {% else %} {{ tr.execution_time|format_duration }} {% endif %} {% if tr is undefined or tr.execution_memory is none %} {% trans %}N/A{% endtrans %} {% else %} {{ tr.execution_memory|format_size }} {% endif %} {% trans %}Download{% endtrans %} {% if status == UserTestResult.COMPILING or status == UserTestResult.EVALUATING %} {% trans %}Wait...{% endtrans %} {% else %} {% if tr.output is none %} {% trans %}N/A{% endtrans %} {% else %} {% trans %}Download{% endtrans %} {% endif %} {% endif %} {# 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. #} {% set files = iterkeys(t.files)|list + iterkeys(t.managers)|list %} {% if files|length == 0 %} {% trans %}None{% endtrans %} {% elif files|length == 1 %} {% set filename = next(iterkeys(t.files)) %} {% set real_filename = filename|replace(".%l", (t.language|to_language).source_extension) %} {% trans %}Download{% endtrans %} {% else %}
{% trans %}Download{% endtrans %}
{% endif %}