{% extends "base.html" %}

{% block title %}Słowniki{% endblock %}

{% block extrahead %}
  <script type="text/javascript" src="{{ STATIC_URL }}js/manage-vocabularies.js"></script>
{% endblock %}

{% block content %}
<br/>

<table>
  <tr>
    <td colspan='2'>
      <strong>Statystyki/zarządzanie:</strong>
    </td>
  </tr>
  <tr> 
    <td>
      <div id='vocabulary-management'>
        <p>
          Słownik:
          <select id='vocabulary-select'>
            <option value="">--------</option>
  	        {% for vocabulary in vocabularies %}
              <option value="{{vocabulary.name}}">{{vocabulary.name}}</option>
	        {% endfor %}
          </select> 
        </p>
        {% if perms.dictionary.manage_vocabulary %}
		<p>
	      <div id="vocabulary-perm-management">
	      </div>
		</p>
  		{% endif %}
      </div>
    </td> 
    <td>
      <div id="vocabulary-statistisc" style="vertical-align:top;">
      </div>
    </td>
  </tr>
  <tr>
    <td colspan='2'>
      <div id="other-statistisc" style="vertical-align:top;">
      </div>
    </td>
  </tr>
</table>

{% if perms.dictionary.download_vocabulary %}
	<strong>Pobierz słowniki:</strong>
	<p></p>
	<form class="voc-download-form" method="post"> {% csrf_token %}
	  {{ download_form.non_field_errors }}
	  <div class='fieldWrapper'>
	    {{ download_form.vocabulary.errors }}
	    {{ download_form.vocabulary.label_tag }}: {{download_form.vocabulary}}</div>
	    {{ download_form.format.errors }}
	  <p class='fieldWrapper'>{{ download_form.format.label_tag }}: {{download_form.format}}</p>
	  {{ download_form.addframeopinion.errors }}
	  <p class='fieldWrapper'>{{ download_form.addframeopinion.label_tag }}: {{download_form.addframeopinion}}</p>
	  <p class='fieldWrapper'>
	    <table>
	      <tr>
	        {{ download_form.pos.errors }}
	        <td>{{ download_form.pos.label_tag }}:</td>
	        <td>  </td>
	        {{ download_form.frame_opinion.errors }}
	        <td>{{ download_form.frame_opinion.label_tag }}:</td>
	        <td>  </td>
	        {{ download_form.lemma_status.errors }}
	        <td>{{ download_form.lemma_status.label_tag }}:</td>
	        <td>  </td>
	        {{ download_form.owner.errors }}
	        <td>{{ download_form.owner.label_tag }}:</td>
	      </tr>
	      <tr>
	        <td>{{ download_form.pos }}</td>
	        <td>  </td>
	        <td>{{ download_form.frame_opinion }}</td>
	        <td>  </td>
	        <td>{{ download_form.lemma_status }}</td>
	         <td>  </td>
	        <td>{{ download_form.owner }}</td>
	      </tr>
	    </table>
	  </p>
	  <p class="lexeme-save">
	    <button type="submit" id="vocabulary-download-submit">
	      Pobierz
	    </button>
	    <button type="reset" id="vocabulary-download-cancel">
	      Wyczyść
	    </button>
	  </p>
	</form>
{% endif %}
{% endblock %}
