{% extends "submit/base.html" %}

{% load submit_parts %}
{% load i18n %}
{% load staticfiles %}

{% block title %}{% trans 'Submit details' %} ({{ submit.id }}){% endblock title %}

{% block stylesheets %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'submit/google-code-prettify/prettify.css' %}" type="text/css" />
{% endblock %}

{% block js %}
    {{ block.super }}
    <script src="{% static 'submit/google-code-prettify/prettify.js' %}" type="text/javascript"></script>
    <script>
        !function ($) {
            $(function(){
            window.prettyPrint && prettyPrint()
            })
        }(window.jQuery)
    </script>
{% endblock %}

{% block page_header %}
    <h1>{% trans 'Submit details' %}</h1>

    <a href={{ submit.receiver.task.get_absolute_url }}>
        <span class="glyphicon glyphicon-list"></span> {% trans 'Task statement' %}
    </a>

    {% if user_has_admin_privileges %}
        <a href="{% url 'admin:submit_submit_change' submit.id %}">
            <span class="glyphicon glyphicon-pencil"></span> {% trans 'Edit and review' %}
        </a>
        {% if submit.receiver.send_to_judge %}
            <a href="{% url 'rejudge_submit' submit.id %}">
                <span class="glyphicon glyphicon-send"></span> {% trans 'Rejudge submit' %}
            </a>
        {% endif %}
    {% endif %}
{% endblock %}

{% block page_content %}
    <div class="row">
        <div class="col col-md-6">
            {% include 'submit/submit_info.html' %}
        </div>
        <div class="col col-md-6">
            {% include 'submit/review_info.html' %}
        </div>
    </div>

    {% if submit.receiver.show_submitted_file %}
        <pre class="prettyprint collapse" id="collapse-submitted-file">{{ submitted_file }}</pre>
    {% endif %}

    {% if review and submit.receiver.send_to_judge %}
        <h3>{% trans 'Protocol' %}</h3>
        {% include 'submit/protocol.html' %}
    {% endif %}

    <h3>{% trans 'All submits' %}</h3>
    {% submit_list submit.receiver submit.user %}
{% endblock page_content %}
