| author | gibus |
| Mon, 21 May 2012 16:50:42 +0200 | |
| changeset 439 | 8994d24e4b2f |
| parent 438 | fcc5e2f0befd |
| child 565 | 95a5c06c4008 |
| permissions | -rw-r--r-- |
| 0 | 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 |
<ul class="sub_list"> |
|
32 |
<li class="active_sub">{% blocktrans %}People' list{% endblocktrans %}</li> |
|
33 |
<li> / </li> |
|
34 |
<li><a href="{% url user-add %}">{% blocktrans %}Add a new user{% endblocktrans %}</a></li> |
|
35 |
<li> / </li> |
|
36 |
<li><a href="{% url user-mass-add %}">{% blocktrans %}Add users in bulk{% endblocktrans %}</a></li> |
|
37 |
</ul> |
|
38 |
||
| 38 | 39 |
<form id="filter_form" action="." method="get"> |
40 |
<table summary="{% blocktrans %}People' list{% endblocktrans %}" class="large_table"> |
|
41 |
<tr> |
|
42 |
<td> |
|
43 |
{% 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 %} |
|
44 |
· |
|
45 |
{% blocktrans %}Filter by tag:{% endblocktrans %} |
|
46 |
<select id="tag_selected" name="tag_selected"> |
|
47 |
<option {% if not tag_selected %}selected="selected"{% endif %} value="0">- {% blocktrans %}All{% endblocktrans %} -</option> |
|
48 |
||
49 |
{% for tag in tag_list %} |
|
50 |
<option {% ifequal tag_selected tag.name %}selected="selected"{% endifequal %} value="{{ tag.name }}">{{ tag.name }}</option> |
|
51 |
{% endfor %} |
|
52 |
</select> |
|
53 |
</td> |
|
54 |
||
55 |
</tr> |
|
56 |
</table> |
|
57 |
</form> |
|
58 |
||
59 |
<script type="text/javascript"> |
|
60 |
<!-- |
|
61 |
$(function() { |
|
62 |
$("#tag_selected").change(function () { |
|
63 |
$("#filter_form").submit(); |
|
64 |
}); |
|
65 |
}) ; |
|
66 |
--> |
|
67 |
</script> |
|
68 |
||
|
439
8994d24e4b2f
Reverts to changeset 435, and just add {% csrf_token %} to template forgot_pw.html, since CSRF protection seems to be only here (surely because of django.contrib.auth.views).
gibus
parents:
438
diff
changeset
|
69 |
<form id="user_form" action="." method="post"> |
| 38 | 70 |
|
| 0 | 71 |
<select id="bulk_actions" name="action"> |
| 38 | 72 |
<option selected="selected" value="-1">- {% blocktrans %}Bulk Actions{% endblocktrans %} -</option> |
| 0 | 73 |
<option value="disable">{% blocktrans %}Suspend access{% endblocktrans %}</option> |
74 |
<option value="enable">{% blocktrans %}Enable access{% endblocktrans %}</option> |
|
75 |
{% for bulk_role in all_roles %} |
|
76 |
<option value="role_{{ bulk_role.id }}">{% blocktrans with bulk_role as role_name %}Change role to {{ role_name }}{% endblocktrans %}</option> |
|
77 |
{% endfor %} |
|
78 |
</select> |
|
79 |
||
80 |
<input name="apply" type="hidden" value="apply"/> |
|
81 |
<input name="apply_action" id="apply" type="button" value="{% blocktrans %}Apply{% endblocktrans %}" disabled="disabled"/> |
|
82 |
||
83 |
<script type="text/javascript"> |
|
84 |
<!-- |
|
85 |
function check_activate_apply() { |
|
86 |
if (($("input[name^=check-]:checked").length > 0) && ($("#bulk_actions").val() != -1)) { |
|
87 |
$('#apply').removeAttr('disabled'); |
|
88 |
} |
|
89 |
else { |
|
90 |
$('#apply').attr('disabled','disabled'); |
|
91 |
} |
|
92 |
}; |
|
93 |
||
94 |
$(function() { |
|
95 |
$("input[name^=check-]").click(function () { |
|
96 |
check_activate_apply() |
|
97 |
}); |
|
98 |
$("#bulk_actions").change(function () { |
|
99 |
check_activate_apply(); |
|
100 |
}); |
|
101 |
$("#apply").click(function () { |
|
102 |
question = "{% blocktrans %}Are you sure?{% endblocktrans %}"; |
|
103 |
if (confirm(question)) { |
|
104 |
$("#user_form").submit(); |
|
105 |
} |
|
106 |
}); |
|
107 |
|
|
108 |
}) ; |
|
109 |
--> |
|
110 |
</script> |
|
111 |
||
112 |
{% include "site/macros/paginator.html" %} |
|
113 |
||
114 |
<div style="clear:both;"></div> |
|
115 |
||
| 35 | 116 |
<table summary="{% blocktrans %}People' list{% endblocktrans %}" class="large_table"> |
| 0 | 117 |
<thead> |
118 |
<tr> |
|
119 |
<th class="check-column"><input type="checkbox" id="all_check" name="checkall"/> |
|
120 |
<script type="text/javascript"> |
|
121 |
<!-- |
|
122 |
$(function() { |
|
123 |
$("#all_check").click(function () { |
|
124 |
checked = $("#all_check").attr('checked'); |
|
125 |
$(".user_check").attr('checked', checked); |
|
126 |
check_activate_apply(); |
|
127 |
}); |
|
128 |
}) ; |
|
129 |
--> |
|
130 |
</script> |
|
131 |
</th> |
|
132 |
<th>{% up_down user__username %}{% blocktrans %}User{% endblocktrans %}{% endup_down %}</th> |
|
| 44 | 133 |
{% if SHOW_EMAILS_IN_ADMIN %}<th>{% up_down user__email %}{% blocktrans %}Email{% endblocktrans %}{% endup_down %}</th>{% endif %} |
|
121
fafac127deb4
change default sorting for dates columns in text/user lists
raph
parents:
44
diff
changeset
|
134 |
<th>{% up_down -user__date_joined %}{% blocktrans %}Date joined{% endblocktrans %}{% endup_down %}</th> |
| 0 | 135 |
<th>{% up_down role__name %}{% blocktrans %}Role{% endblocktrans %}{% endup_down %}</th> |
136 |
<th>{% blocktrans %}Last week activity{% endblocktrans %}</th> |
|
137 |
</tr> |
|
138 |
</thead> |
|
139 |
<tbody> |
|
140 |
{% for userrole in object_list %} |
|
141 |
{% with userrole.user as user %} |
|
142 |
||
143 |
<tr class="user-{{ user.get_profile.key }} {% cycle 'odd' 'even' %}"> |
|
144 |
<td><input type="checkbox" {% ifequal user request.user %}disabled="disabled"{% endifequal %} class="user_check" name="check-{{ user.get_profile.key }}"/></td> |
|
145 |
<td> |
|
146 |
{% include "site/macros/user_actions.html" %} |
|
147 |
</td> |
|
| 44 | 148 |
{% if SHOW_EMAILS_IN_ADMIN %}<td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td>{% endif %} |
| 0 | 149 |
<td>{{ user.date_joined|local_date }}</td> |
150 |
<td> |
|
151 |
<select name="user-role-{{ user.get_profile.key }}" {% ifequal user request.user %}disabled="disabled"{% endifequal %}> |
|
152 |
<option {% if userrole.role %}{% else %}selected="selected"{% endif %} value="">---------</option> |
|
153 |
{% for role in all_roles %} |
|
154 |
<option {% ifequal userrole.role role %}selected="selected"{% endifequal %} value="{{ role.id }}">{{ role.name_i18n }}</option> |
|
155 |
{% endfor %} |
|
156 |
</select> |
|
157 |
</td> |
|
158 |
<td><span id="ticker-{{ user.get_profile.key }}">{% blocktrans %}Loading...{% endblocktrans %}</span> |
|
159 |
<script type="text/javascript"> |
|
160 |
$(function() { |
|
161 |
$('#ticker-{{ user.get_profile.key }}').sparkline({% activity all user '1/4day' 28 'all' '' %}, {'width': '100px','height': '22px'}); |
|
162 |
}); |
|
163 |
</script> |
|
164 |
</td> |
|
165 |
||
166 |
||
167 |
</tr> |
|
168 |
||
169 |
{% endwith %} |
|
170 |
{% endfor %} |
|
171 |
<tr class="no-border"> |
|
172 |
<td></td><td></td><td></td><td></td> |
|
173 |
</tr> |
|
174 |
||
175 |
<tr class="full-border even"> |
|
176 |
<td></td> |
|
| 316 | 177 |
<td><a class="main_object_title" title="{% blocktrans %}Edit anonymous users{% endblocktrans %}" href="{% url user-anon-edit %}">{% blocktrans %}Anonymous users{% endblocktrans %}</a> <a class="tip" href="#" title="{% blocktrans %}Those are non-registered users. Assign them a role to open your texts to simple visitors.{% endblocktrans %}"> </a></td> |
| 44 | 178 |
{% if SHOW_EMAILS_IN_ADMIN %}<td>-</td>{% endif %} |
| 0 | 179 |
<td>-</td> |
180 |
<td> |
|
181 |
<select name="user-role-_"> |
|
182 |
<option selected="selected" value="">---------</option> |
|
183 |
{% for role in anon_roles %} |
|
184 |
<option {% ifequal anon_role role %}selected="selected"{% endifequal %} value="{{ role.id }}">{{ role.name_i18n }}</option> |
|
185 |
{% endfor %} |
|
186 |
</select> |
|
187 |
</td> |
|
188 |
<td><span id="ticker-_">{% blocktrans %}Loading...{% endblocktrans %}</span> |
|
189 |
<script type="text/javascript"> |
|
190 |
$(function() { |
|
191 |
$('#ticker-_').sparkline({% activity all None '1/4day' 28 'all' '' %}, {'width': '100px','height': '22px'}); |
|
192 |
}); |
|
193 |
</script> |
|
194 |
</td> |
|
195 |
</tr> |
|
196 |
||
197 |
</tbody> |
|
198 |
||
199 |
</table> |
|
200 |
||
201 |
<script type="text/javascript"> |
|
202 |
<!-- |
|
203 |
$(function() { |
|
204 |
$('select[name^=user-role-]').change(function(){ |
|
205 |
$('#save').removeAttr('disabled'); |
|
206 |
}); |
|
207 |
}) ; |
|
208 |
--> |
|
209 |
</script> |
|
210 |
<input style="margin-left:20px;" name="save" id="save" type="submit" value="{% blocktrans %}Save{% endblocktrans %}" disabled="disabled"/> |
|
211 |
||
212 |
</form> |
|
213 |
||
214 |
</div> |
|
|
438
fcc5e2f0befd
Fix side effects with csrf token, add csrf_token to every post form + add ajax (see http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request), remove django.middleware.csrf.CsrfViewMiddleware ?!
Production Moz <dev@sopinspace.com>
parents:
316
diff
changeset
|
215 |
{% endblock %} |