{% extends "base.html" %}

{% load tags %}
{% load i18n %}
{% load staticfiles %}

{% block header %}
    <link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/motion.css' %}" />
    <link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/ckeditor.css' %}" />
    <link href="{% static 'styles/jquery.bsmselect.css' %}" type="text/css" rel="stylesheet" />
{% endblock %}

{% block javascript %}
    <script type="text/javascript" src="{% static 'javascript/ckeditor/ckeditor.js' %}"></script>
    <script type="text/javascript" src="{% static 'javascript/ckeditor-config.js' %}"></script>
    <script type="text/javascript" src="{% static 'javascript/jquery.bsmselect.js' %}"></script>
    <script type="text/javascript">
        // use jquery-bsmselect for all <select multiple> form elements
        $("select[multiple]").bsmSelect({
          removeLabel: '<sup><b>X</b></sup>',
          containerClass: 'bsmContainer',
          listClass: 'bsmList-custom',
          listItemClass: 'bsmListItem-custom',
          listItemLabelClass: 'bsmListItemLabel-custom',
          removeClass: 'bsmListItemRemove-custom'
        });
    </script>
{% endblock %}

{% block title %}
    {% if motion %}
        {% trans "Edit motion" %}
    {% else %}
        {% trans "New motion" %}
    {% endif %}
    – {{ block.super }}
{% endblock %}

{% block content %}
    <h1>
        {% if motion %}
            {% trans "Edit motion" %}
        {% else %}
            {% trans "New motion" %}
        {% endif %}
        <small class="pull-right">
        {% if motion %}
            <a href="{% model_url motion 'view' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to motion" %}</a>
        {% else %}
            <a href="{% url 'motion_list' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
        {% endif %}
        </small>
    </h1>
    <form action="" method="post">{% csrf_token %}
        {% include "form.html" %}
        <p>
        {% include "formbuttons_saveapply.html" %}
        <a href='{% url 'motion_list' %}' class="btn">
            {% trans 'Cancel' %}
        </a>
        </p>
        <small>* {% trans "required" %}</small>
    </form>
{% endblock %}
