manager_view.html 1.82 KB
{% extends "base.html" %}

{% block extrahead %}
  <script type="text/javascript" src="{{ MEDIA_URL }}js/manager-view.js"></script>
{% endblock %}

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

{% block content %}
  <h3>Zarządzane słowniki</h3>
  <p>
    <select id="vocabulary-select" size="10">
      {% for vocab in vocabularies %}
        <option value="{{ vocab.pk }}">{{ vocab.id }}</option>
      {% endfor %}
    </select>
  </p>
  <p>
    <input type="text" id="new-vocabulary"/>
    <button id="add-vocabulary">
      dodaj słownik
    </button>
  </p>
  <h3>Użytkownicy</h3>
  <table id="user-privileges">
    <tr>
      <th>Nazwa</th>
      <th>ogląda</th>
      <th>modyfikuje</th>
      <th>zarządza</th>
    </tr>
    {% for u in users %}
      <tr>
        <td>{{ u.username }}</td>
        <td>
          {% if u.usersettings.views_lexeme %}
            <input
              type="checkbox"
              id="view-{{ u.pk }}"
              class="checkbox-view"
              {% if u.usersettings.views_all_lexemes %}disabled="disabled"{% endif %}/>
          {% else %}
            <input type="checkbox" disabled="disabled"/>
          {% endif %}
        </td>
        <td>
          {% if u.usersettings.changes_lexeme %}
            <input type="checkbox" id="change-{{ u.pk }}" class="checkbox-change"/>
          {% else %}
            <input type="checkbox" disabled="disabled"/>
          {% endif %}
        </td>
        <td>
          {% if u.usersettings.manages_vocabulary %}
            <input
              type="checkbox"
              id="manage-{{ u.pk }}"
              class="checkbox-manage"
              {% if u == user %}disabled="disabled"{% endif %}/>
          {% else %}
            <input type="checkbox" disabled="disabled"/>
          {% endif %}
        </td>
      </tr>
    {% endfor %}
  </table>
{% endblock %}