manage_classifications.html 1.34 KB
{% extends "base.html" %}
{% load dictionary_extras %}

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

{% block title %}Klasyfikacje{% endblock %}

{% block content %}
  <form action="" method="post">
    {% csrf_token %}
    {{ add_form.as_p }}
    <p>
      <input type="submit" value="Dodaj klasyfikację"/>
    </p>
  </form>
  {% for classification, value_form, vocab_form, using in classification_forms %}
    <h4>{{ classification.name }}</h4>
    <p>Wartości:</p>
    {% with tree=classification.value_tree %}
      {% if tree %}
        {% value_tree tree %}
      {% endif %}
    {% endwith %}
    <form action="" method="post">
      {% csrf_token %}
      {{ value_form.as_p }}
      <p>
        <input type="submit" value="Dodaj wartość"/>
      </p>
    </form>
    <p>Używające słowniki:</p>
    {% if using %}
      <ul>
        {% for vocab in using %}
          <li>{{ vocab.id }}</li>
        {% endfor %}
      </ul>
    {% else %}
      <p>brak</p>
    {% endif %}
    <form action="" method="post">
      {% csrf_token %}
      {{ vocab_form.as_p }}
      <p>
        <input type="submit" value="Dodaj słownik"/>
      </p>
    </form>
  {% endfor %}
{% endblock %}