|
1
2
|
{% extends "base.html" %}
|
|
3
|
{% load version_static i18n %}
|
|
4
|
|
|
5
|
{% block extrahead %}
|
|
6
|
<script type="text/javascript"
|
|
7
|
src="{% version_static 'js/manager-view.js' %}"></script>
|
|
8
9
|
{% endblock %}
|
|
10
|
{% block title %}{% trans 'Dictionaries' %}{% endblock %}
|
|
11
|
|
|
12
|
{% block text-content %}
|
|
13
|
<h3>{% trans 'Dictionaries' %}</h3>
|
|
14
15
16
|
<p>
<input type="text" id="new-vocabulary"/>
<button id="add-vocabulary">
|
|
17
|
{% trans 'add dictionary' %}
|
|
18
19
20
21
|
</button>
</p>
<div id="vocab-accordion">
{% for vocab, managed, viewers, editors, managers in vocabularies_info %}
|
|
22
|
{% with forloop.counter as vocab_no %}
|
|
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>
|
|
29
30
31
|
<th>{% trans 'can view' %}</th>
<th>{% trans 'can edit' %}</th>
<th>{% trans 'can manage' %}</th>
|
|
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"
|
|
40
|
id="view-{{ u.pk }}-{{ vocab_no }}"
|
|
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"
|
|
56
|
id="change-{{ u.pk }}-{{ vocab_no }}"
|
|
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"
|
|
70
|
id="manage-{{ u.pk }}-{{ vocab_no }}"
|
|
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>
|
|
86
|
{% endwith %}
|
|
87
88
|
{% endfor %}
</div>
|
|
89
|
{% endblock %}
|