manage_qualifiers.html 2.72 KB
{% extends "base.html" %}

{% block extrahead %}
    <link rel="stylesheet" type="text/css"
          href="{{ MEDIA_URL }}css/manage_qualifiers.css"/>
    <script type="text/javascript"
            src="{{ MEDIA_URL }}js/manage-qualifiers.js"></script>
{% endblock %}

{% block title %}Kwalifikatory{% endblock %}

{% block content %}
    <div id="vocab-accordion">
        {% for vocab_name, add_exclusion_class_form, remove_exclusion_class_form, add_qualifier_form, qualifier_forms in form_list %}
            <h3><a href="#">{{ vocab_name }}</a></h3>
            <div>
                <form action="" method="post">
                    {% csrf_token %}
                    {{ add_exclusion_class_form.as_table }}
                    <button type="submit">
                        dodaj klasę wykluczania
                    </button>
                </form>
                {% if remove_exclusion_class_form %}
                    <form action="" method="post">
                        {% csrf_token %}
                        {{ remove_exclusion_class_form.as_table }}
                        <button type="submit">
                            usuń klasę wykluczania
                        </button>
                    </form>
                {% endif %}
                <form action="" method="post">
                    {% csrf_token %}
                    {{ add_qualifier_form.as_table }}
                    <button type="submit">
                        dodaj kwalifikator
                    </button>
                </form>
                <ul>
                    {% for qualifier, form in qualifier_forms %}
                        <li>
              <span class="qualifier-label">
                {{ qualifier.label }}
              </span>
              <span class="qualifier-controls">
                {% if qualifier.is_empty %}
                    <form action="" method="post">
                        {% csrf_token %}
                        <input type="hidden" name="det"
                               value="remove_qualifier"/>
                        <input type="hidden" name="id"
                               value="{{ qualifier.pk }}"/>
                        <button type="submit">
                            usuń
                        </button>
                    </form>
                {% endif %}
                  <form action="" method="post">
                      {% csrf_token %}
                      {{ form.as_table }}
                      <button type="submit">
                          zmień
                      </button>
                  </form>
              </span>
                        </li>
                    {% endfor %}
                </ul>
            </div>
        {% endfor %}
    </div>
{% endblock %}