|
1 {% extends "site/layout/base_workspace.html" %} |
|
2 {% load com %} |
|
3 {% load i18n %} |
|
4 {% load activity %} |
|
5 |
|
6 {% block title %} |
|
7 {% blocktrans %}People' list{% endblocktrans %} |
|
8 {% endblock %} |
|
9 |
|
10 {% block head %} |
|
11 {% endblock %} |
|
12 |
|
13 {% block main %} |
|
14 |
|
15 <script type="text/javascript"> |
|
16 <!-- |
|
17 tb_conf['current_tab'] = 'user'; |
|
18 --> |
|
19 </script> |
|
20 |
|
21 <script type="text/javascript"> |
|
22 <!-- |
|
23 $(function() { |
|
24 $(".hidden-user-actions").css('visibility','hidden'); |
|
25 }) ; |
|
26 --> |
|
27 </script> |
|
28 |
|
29 <div id="user" class="tab-meta"> |
|
30 |
|
31 <form id="user_form" action="." method="post"> |
|
32 |
|
33 <ul class="sub_list"> |
|
34 <li class="active_sub">{% blocktrans %}People' list{% endblocktrans %}</li> |
|
35 <li> / </li> |
|
36 <li><a href="{% url user-add %}">{% blocktrans %}Add a new user{% endblocktrans %}</a></li> |
|
37 <li> / </li> |
|
38 <li><a href="{% url user-mass-add %}">{% blocktrans %}Add users in bulk{% endblocktrans %}</a></li> |
|
39 </ul> |
|
40 |
|
41 <select id="bulk_actions" name="action"> |
|
42 <option selected="selected" value="-1">{% blocktrans %}Bulk Actions{% endblocktrans %}</option> |
|
43 <option value="disable">{% blocktrans %}Suspend access{% endblocktrans %}</option> |
|
44 <option value="enable">{% blocktrans %}Enable access{% endblocktrans %}</option> |
|
45 {% for bulk_role in all_roles %} |
|
46 <option value="role_{{ bulk_role.id }}">{% blocktrans with bulk_role as role_name %}Change role to {{ role_name }}{% endblocktrans %}</option> |
|
47 {% endfor %} |
|
48 </select> |
|
49 |
|
50 <input name="apply" type="hidden" value="apply"/> |
|
51 <input name="apply_action" id="apply" type="button" value="{% blocktrans %}Apply{% endblocktrans %}" disabled="disabled"/> |
|
52 |
|
53 {% if display_suspended_users %}<a href="?{% newparams 'display' '0' %}" title="{% blocktrans %}Hide suspended users{% endblocktrans %}">{% blocktrans %}Hide suspended users{% endblocktrans %}</a>{% else %}<a href="?{% newparams 'display' '1' %}" title="{% blocktrans %}Display suspended users{% endblocktrans %}">{% blocktrans %}Display suspended users{% endblocktrans %}</a>{% endif %} |
|
54 |
|
55 <script type="text/javascript"> |
|
56 <!-- |
|
57 function check_activate_apply() { |
|
58 if (($("input[name^=check-]:checked").length > 0) && ($("#bulk_actions").val() != -1)) { |
|
59 $('#apply').removeAttr('disabled'); |
|
60 } |
|
61 else { |
|
62 $('#apply').attr('disabled','disabled'); |
|
63 } |
|
64 }; |
|
65 |
|
66 $(function() { |
|
67 $("input[name^=check-]").click(function () { |
|
68 check_activate_apply() |
|
69 }); |
|
70 $("#bulk_actions").change(function () { |
|
71 check_activate_apply(); |
|
72 }); |
|
73 $("#apply").click(function () { |
|
74 question = "{% blocktrans %}Are you sure?{% endblocktrans %}"; |
|
75 if (confirm(question)) { |
|
76 $("#user_form").submit(); |
|
77 } |
|
78 }); |
|
79 |
|
80 }) ; |
|
81 --> |
|
82 </script> |
|
83 |
|
84 {% include "site/macros/paginator.html" %} |
|
85 |
|
86 <div style="clear:both;"></div> |
|
87 |
|
88 <table summary="user list" class="large_table"> |
|
89 <thead> |
|
90 <tr> |
|
91 <th class="check-column"><input type="checkbox" id="all_check" name="checkall"/> |
|
92 <script type="text/javascript"> |
|
93 <!-- |
|
94 $(function() { |
|
95 $("#all_check").click(function () { |
|
96 checked = $("#all_check").attr('checked'); |
|
97 $(".user_check").attr('checked', checked); |
|
98 check_activate_apply(); |
|
99 }); |
|
100 }) ; |
|
101 --> |
|
102 </script> |
|
103 </th> |
|
104 <th>{% up_down user__username %}{% blocktrans %}User{% endblocktrans %}{% endup_down %}</th> |
|
105 <th>{% up_down user__email %}{% blocktrans %}Email{% endblocktrans %}{% endup_down %}</th> |
|
106 <th>{% up_down user__date_joined %}{% blocktrans %}Date joined{% endblocktrans %}{% endup_down %}</th> |
|
107 <th>{% up_down role__name %}{% blocktrans %}Role{% endblocktrans %}{% endup_down %}</th> |
|
108 <th>{% blocktrans %}Last week activity{% endblocktrans %}</th> |
|
109 </tr> |
|
110 </thead> |
|
111 <tbody> |
|
112 {% for userrole in object_list %} |
|
113 {% with userrole.user as user %} |
|
114 |
|
115 <tr class="user-{{ user.get_profile.key }} {% cycle 'odd' 'even' %}"> |
|
116 <td><input type="checkbox" {% ifequal user request.user %}disabled="disabled"{% endifequal %} class="user_check" name="check-{{ user.get_profile.key }}"/></td> |
|
117 <td> |
|
118 {% include "site/macros/user_actions.html" %} |
|
119 </td> |
|
120 <td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td> |
|
121 <td>{{ user.date_joined|local_date }}</td> |
|
122 <td> |
|
123 <select name="user-role-{{ user.get_profile.key }}" {% ifequal user request.user %}disabled="disabled"{% endifequal %}> |
|
124 <option {% if userrole.role %}{% else %}selected="selected"{% endif %} value="">---------</option> |
|
125 {% for role in all_roles %} |
|
126 <option {% ifequal userrole.role role %}selected="selected"{% endifequal %} value="{{ role.id }}">{{ role.name_i18n }}</option> |
|
127 {% endfor %} |
|
128 </select> |
|
129 </td> |
|
130 <td><span id="ticker-{{ user.get_profile.key }}">{% blocktrans %}Loading...{% endblocktrans %}</span> |
|
131 <script type="text/javascript"> |
|
132 $(function() { |
|
133 $('#ticker-{{ user.get_profile.key }}').sparkline({% activity all user '1/4day' 28 'all' '' %}, {'width': '100px','height': '22px'}); |
|
134 }); |
|
135 </script> |
|
136 </td> |
|
137 |
|
138 |
|
139 </tr> |
|
140 |
|
141 {% endwith %} |
|
142 {% endfor %} |
|
143 <tr class="no-border"> |
|
144 <td></td><td></td><td></td><td></td> |
|
145 </tr> |
|
146 |
|
147 <tr class="full-border even"> |
|
148 <td></td> |
|
149 <td><a class="main_object_title" title="{% blocktrans %}Edit anonymous users{% endblocktrans %}" href="{% url user-anon-edit %}">{% blocktrans %}Anonymous users{% endblocktrans %}</a></td> |
|
150 <td>-</td> |
|
151 <td>-</td> |
|
152 <td> |
|
153 <select name="user-role-_"> |
|
154 <option selected="selected" value="">---------</option> |
|
155 {% for role in anon_roles %} |
|
156 <option {% ifequal anon_role role %}selected="selected"{% endifequal %} value="{{ role.id }}">{{ role.name_i18n }}</option> |
|
157 {% endfor %} |
|
158 </select> |
|
159 </td> |
|
160 <td><span id="ticker-_">{% blocktrans %}Loading...{% endblocktrans %}</span> |
|
161 <script type="text/javascript"> |
|
162 $(function() { |
|
163 $('#ticker-_').sparkline({% activity all None '1/4day' 28 'all' '' %}, {'width': '100px','height': '22px'}); |
|
164 }); |
|
165 </script> |
|
166 </td> |
|
167 </tr> |
|
168 |
|
169 </tbody> |
|
170 |
|
171 </table> |
|
172 |
|
173 <script type="text/javascript"> |
|
174 <!-- |
|
175 $(function() { |
|
176 $('select[name^=user-role-]').change(function(){ |
|
177 $('#save').removeAttr('disabled'); |
|
178 }); |
|
179 }) ; |
|
180 --> |
|
181 </script> |
|
182 <input style="margin-left:20px;" name="save" id="save" type="submit" value="{% blocktrans %}Save{% endblocktrans %}" disabled="disabled"/> |
|
183 |
|
184 </form> |
|
185 |
|
186 </div> |
|
187 {% endblock %} |