{% extends "base.html" %}

{% load i18n %}

{% block head %}
    <link rel="stylesheet" href="{{ STATIC_URL }}trainings/css/django-admin-widgets.css" type="text/css" media="screen" charset="utf-8" />
    <link rel="stylesheet" href="{{ STATIC_URL }}trainings/css/themes/base/jquery-ui.css" type="text/css" media="screen" charset="utf-8" />

    <script type="text/javascript" src="{{ STATIC_URL }}trainings/js/ui/jquery-ui.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}trainings/js/ui/i18n/jquery-ui-i18n.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}trainings/js/django-admin.multiselect.js"></script>
    <script type="text/javascript">
        $(function() {
            $.each($("select[multiple]"), function() {
                SelectFilter.init(this.id, "{% trans 'Dimension' %}", 0, "/static/admin/");
            });
        });
    </script>
{% endblock %}

{% block actions %}
    <a class="btn btn-default" href="{{ exercise.get_edit_url }}">{% trans 'Back to the exercise' %}</a>
{% endblock %}

{% block main %}
	<form action="{% if criterion.pk %}{{ criterion.get_exercise_edit_url }}{% else %}{{ criterion.get_exercise_create_url }}{% endif %}" method="post">{% csrf_token %}
		<div class="panel panel-default">
			<table class="table table-bordered">
				{% include 'extras/form.html' %}
			</table>
			<div class="panel-footer clearfix">
				<input type="submit" value="{% trans 'Submit' %}" class="btn btn-primary pull-right">
			</div>
		</div>
	</form>
{% endblock %}
