Blame view

management/templates/manager_view.html 4.08 KB
janek37 authored
1
2
{% extends "base.html" %}
janek37 authored
3
{% load version_static i18n %}
janek37 authored
4
janek37 authored
5
{% block extrahead %}
janek37 authored
6
    <script type="text/javascript"
janek37 authored
7
            src="{% version_static 'js/manager-view.js' %}"></script>
janek37 authored
8
9
{% endblock %}
janek37 authored
10
{% block title %}{% trans 'Dictionaries' %}{% endblock %}
janek37 authored
11
janek37 authored
12
{% block text-content %}
janek37 authored
13
    <h3>{% trans 'Dictionaries' %}</h3>
janek37 authored
14
15
16
    <p>
        <input type="text" id="new-vocabulary"/>
        <button id="add-vocabulary">
janek37 authored
17
            {% trans 'add dictionary' %}
janek37 authored
18
19
20
21
        </button>
    </p>
    <div id="vocab-accordion">
        {% for vocab, managed, viewers, editors, managers in vocabularies_info %}
janek37 authored
22
            {% with forloop.counter as vocab_no %}
janek37 authored
23
24
25
26
27
28
            <h3><a href="#">{{ vocab.id }}</a></h3>
            <div>
                <table class="user-privileges"
                       id="vocab-privileges_{{ vocab.pk }}">
                    <tr>
                        <th></th>
janek37 authored
29
30
31
                        <th>{% trans 'can view' %}</th>
                        <th>{% trans 'can edit' %}</th>
                        <th>{% trans 'can manage' %}</th>
janek37 authored
32
33
34
35
36
37
38
39
                    </tr>
                    {% for u in users %}
                        <tr>
                            <td>{{ u.username }}</td>
                            <td>
                                {% if u.usersettings.views_lexeme %}
                                    <input
                                            type="checkbox"
janek37 authored
40
                                            id="view-{{ u.pk }}-{{ vocab_no }}"
janek37 authored
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
                                            class="checkbox-view"
                                            {% if u in viewers %}
                                            checked="checked"
                                            {% endif %}
                                            {% if u.usersettings.views_all_lexemes or not managed %}
                                            disabled="disabled"
                                            {% endif %}/>
                                {% else %}
                                    <input type="checkbox" disabled="disabled"/>
                                {% endif %}
                            </td>
                            <td>
                                {% if u.usersettings.changes_lexeme %}
                                    <input
                                            type="checkbox"
janek37 authored
56
                                            id="change-{{ u.pk }}-{{ vocab_no }}"
janek37 authored
57
58
59
60
61
62
63
64
65
66
67
68
69
                                            class="checkbox-change"
                                            {% if u in editors %}
                                            checked="checked"
                                            {% endif %}
                                            {% if not managed %}disabled="disabled"{% endif %}/>
                                {% else %}
                                    <input type="checkbox" disabled="disabled"/>
                                {% endif %}
                            </td>
                            <td>
                                {% if u.usersettings.manages_vocabulary %}
                                    <input
                                            type="checkbox"
janek37 authored
70
                                            id="manage-{{ u.pk }}-{{ vocab_no }}"
janek37 authored
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
                                            class="checkbox-manage"
                                            {% if u in managers %}
                                            checked="checked"
                                            {% endif %}
                                            {% if u == user or not managed or u.usersettings.manages_all_vocabs %}
                                            disabled="disabled"
                                            {% endif %}/>
                                {% else %}
                                    <input type="checkbox" disabled="disabled"/>
                                {% endif %}
                            </td>
                        </tr>
                    {% endfor %}
                </table>
            </div>
janek37 authored
86
            {% endwith %}
janek37 authored
87
88
        {% endfor %}
    </div>
janek37 authored
89
{% endblock %}