{% load bootstrap %}
{% load i18n %}

{% if user_can_post_submit %}
    {% if submit_form %}
        <form class="form-inline" enctype="multipart/form-data" method="post" action="{% url 'post_submit' receiver.id %}">
            {% csrf_token %}
            {% if caption %}
                <div class="form-group" style="padding-right: 20px; min-width: 50px;"><label>{{ caption }}</label></div>
            {% endif %}
            {{ submit_form | bootstrap_inline }}
            <input type="hidden" name="redirect_to" value="{{ redirect_to }}" />
            <input class="btn btn-primary" type="submit" value="{% trans 'Submit solution' %}" />
        </form>
    {% endif %}

    {% if receiver.external_link %}
        <p>{% trans 'Use a special page to submit.' %}</p>
        <a class="btn btn-primary" href="{{ receiver.external_link }}">{% trans 'Page with external submit' %}</a>
    {% endif %}
{% else %}
    <p class="text-danger">{% trans "You can't submit solutions for this task." %}</p>
{% endif %}
