{% 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" />
    
    <script type="text/javascript" src="{{ STATIC_URL }}trainings/js/django-admin.multiselect.js"></script>
    <script type="text/javascript">
        $(function(){
            jQuery.each($("select[multiple]"), function () {
            // "Locations" can be any label you want
            SelectFilter.init(this.id, "{% trans 'Trainer groups' %}", 0, "/static/admin/");
            });
        });
    </script>
{% endblock %}

{% block subtitle %}
	{% trans 'Add a training' %}
{% endblock %}

{% block actions %}
	<a href="{% url 'trainings:trainings_list' %}" class="btn btn-default">
		{% trans "Back to the trainings list" %}
    </a>
{% endblock %}

{% block main %}
  <form action="" method="post" enctype="multipart/form-data" >{% csrf_token %}
    {{ form.media }}
    <table class="table table-bordered table-hover">
    	{% include 'extras/form.html' with form=form %}
    	{% include 'extras/form.html' with form=imageForm %}
    </table>
    <div class="row">
    	<div class="col-md-12">
    		<input type="submit" class="btn btn-primary" value="{% trans 'Save' %}" />	
    	</div>
    </div>
  </form>
{% endblock %}
