|
1 {% extends "site/layout/base_text.html" %} |
|
2 {% load com %} |
|
3 {% load i18n %} |
|
4 |
|
5 {% block head %} |
|
6 {% endblock %} |
|
7 |
|
8 {% block main %} |
|
9 |
|
10 <script type="text/javascript"> |
|
11 <!-- |
|
12 tb_conf['current_tab'] = 'share'; |
|
13 --> |
|
14 </script> |
|
15 |
|
16 <script type="text/javascript"> |
|
17 <!-- |
|
18 $(function() { |
|
19 $(".hidden-user-actions").css('visibility','hidden'); |
|
20 }) ; |
|
21 --> |
|
22 </script> |
|
23 |
|
24 <div id="text_share" class="tab-meta"> |
|
25 |
|
26 <form id="text_share_form" action="." method="post"> |
|
27 |
|
28 <ul class="sub_list"> |
|
29 <li class="active_sub">{% blocktrans %}Users' list{% endblocktrans %}</li> |
|
30 <li> / </li> |
|
31 <li><a href="{% url user-add-text text.key %}">{% blocktrans %}Add a new user{% endblocktrans %}</a></li> |
|
32 <li> / </li> |
|
33 <li><a href="{% url user-mass-add-text text.key %}">{% blocktrans %}Add users in bulk{% endblocktrans %}</a></li> |
|
34 </ul> |
|
35 |
|
36 {% include "site/macros/paginator.html" %} |
|
37 |
|
38 <div style="clear:both;"></div> |
|
39 |
|
40 <table summary="user list" class="large_table"> |
|
41 <thead> |
|
42 <tr> |
|
43 <th class="check-column"><input type="checkbox" id="all_check" name="checkall"/> |
|
44 <script type="text/javascript"> |
|
45 <!-- |
|
46 $(function() { |
|
47 $("#all_check").click(function () { |
|
48 checked = $("#all_check").attr('checked'); |
|
49 $(".user_check").attr('checked', checked); |
|
50 check_activate_apply(); |
|
51 }); |
|
52 }) ; |
|
53 --> |
|
54 </script> |
|
55 </th> |
|
56 <th>{% up_down user__username %}User{% endup_down %}</th> |
|
57 <th><a class="tip" href="#" title="{% blocktrans %}The 'Workspace role' is the global role that applies to every text, you can give a user a particular role on this text using the 'local role' column on the right{% endblocktrans %}">{% blocktrans %}Workspace role{% endblocktrans %}</a></th> |
|
58 <th>{% up_down role__name %}{% blocktrans %}Local role{% endblocktrans %}{% endup_down %}</th> |
|
59 </tr> |
|
60 </thead> |
|
61 <tbody> |
|
62 {% for userrole in object_list %} |
|
63 {% with userrole.user as user %} |
|
64 |
|
65 <tr class="user-{{ user.get_profile.key }} {% cycle 'odd' 'even' %}"> |
|
66 <td><input type="checkbox" class="user_check" name="check-{{ user.get_profile.key }}"/></td> |
|
67 <td> |
|
68 {% include "site/macros/user_actions.html" %} |
|
69 </td> |
|
70 <td> |
|
71 {% if userrole.role and user.get_profile.global_role %}<a class="tip" href="#" title="{% blocktrans with userrole.role.name_i18n as rolename %}This role has been overriden on this text by a local role: {{ rolename }}{% endblocktrans %}">{% endif %} |
|
72 |
|
73 <span {% if userrole.role %}class="non_active"{% endif %}> |
|
74 {% if user.get_profile.global_role %}{{ user.get_profile.global_role.name_i18n}}{% else %}-{% endif %} |
|
75 </span> |
|
76 |
|
77 {% if userrole.role and user.get_profile.global_role %}</a>{% endif %} |
|
78 </td> |
|
79 <td> |
|
80 <select name="user-role-{{ user.get_profile.key }}" {% ifequal user request.user %}disabled="disabled"{% endifequal %}> |
|
81 <option {% if userrole.role %}{% else %}selected="selected"{% endif %} value="">---------</option> |
|
82 {% for role in all_roles %} |
|
83 <option {% ifequal userrole.role role %}selected="selected"{% endifequal %} value="{{ role.id }}">{{ role.name_i18n }}</option> |
|
84 {% endfor %} |
|
85 </select> |
|
86 </td> |
|
87 |
|
88 </tr> |
|
89 |
|
90 {% endwith %} |
|
91 {% endfor %} |
|
92 <tr class="no-border"> |
|
93 <td></td><td></td><td></td><td></td> |
|
94 </tr> |
|
95 |
|
96 <tr class="full-border even"> |
|
97 <td></td> |
|
98 <td><a class="main_object_title" title="{% blocktrans %}Edit anonymous users{% endblocktrans %}" href="{% url user-anon-edit %}">{% blocktrans %}Anonymous users{% endblocktrans %}</a></td> |
|
99 <td>{% if global_anon_role %}{{ global_anon_role.name_i18n }}{% else %}-{% endif %}</td> |
|
100 <td> |
|
101 <select name="user-role-_"> |
|
102 <option selected="selected" value="">---------</option> |
|
103 {% for role in anon_roles %} |
|
104 <option {% ifequal anon_role role %}selected="selected"{% endifequal %} value="{{ role.id }}">{{ role.name_i18n }}</option> |
|
105 {% endfor %} |
|
106 </select> |
|
107 </td> |
|
108 </tr> |
|
109 |
|
110 </tbody> |
|
111 |
|
112 </table> |
|
113 |
|
114 <script type="text/javascript"> |
|
115 <!-- |
|
116 $(function() { |
|
117 $('select[name^=user-role-]').change(function(){ |
|
118 $('#save').removeAttr('disabled'); |
|
119 }); |
|
120 }) ; |
|
121 --> |
|
122 </script> |
|
123 <input style="margin-left:20px;" name="save" id="save" type="submit" value="{% blocktrans %}Save{% endblocktrans %}" disabled="disabled"/> |
|
124 |
|
125 </form> |
|
126 |
|
127 </div> |
|
128 {% endblock %} |