|
0
|
1 |
{% extends "site/layout/base_workspace.html" %} |
|
|
2 |
{% load com %} |
|
|
3 |
{% load i18n %} |
|
|
4 |
{% load local_perms %} |
|
|
5 |
{% load activity %} |
|
|
6 |
|
|
|
7 |
{% block head_base %} |
|
|
8 |
<link href="{% url public-feed %}" title="Workspace feed" type="application/rss+xml" rel="alternate" /> |
|
|
9 |
{% endblock %} |
|
|
10 |
|
|
|
11 |
{% block title %} |
|
|
12 |
{% blocktrans %}Dashboard{% endblocktrans %} |
|
|
13 |
{% endblock %} |
|
|
14 |
|
|
|
15 |
{% block head %} |
|
|
16 |
{% endblock %} |
|
|
17 |
|
|
|
18 |
{% block main %} |
|
|
19 |
|
|
|
20 |
{% get_local_perm request can_create_text as can_create_text %} |
|
|
21 |
{% get_local_perm request can_manage_workspace as can_manage_workspace %} |
|
|
22 |
|
|
|
23 |
<script type="text/javascript"> |
|
|
24 |
<!-- |
|
|
25 |
tb_conf['current_tab'] = 'dashboard'; |
|
|
26 |
--> |
|
|
27 |
</script> |
|
|
28 |
|
|
|
29 |
<script type="text/javascript"> |
|
|
30 |
<!-- |
|
|
31 |
$(function() { |
|
|
32 |
$(".hidden-text-actions").css('visibility','hidden'); |
|
|
33 |
}) ; |
|
|
34 |
--> |
|
|
35 |
</script> |
|
|
36 |
|
|
|
37 |
<div id="dashboard" class="tab-meta"> |
|
|
38 |
|
|
|
39 |
<div style="float:left;width:32%;"> |
|
|
40 |
<table class="dash_table"> |
|
|
41 |
<thead> |
|
|
42 |
<tr> |
|
|
43 |
<th><span class="em">{% blocktrans %}Actions{% endblocktrans %}</span></th> |
|
|
44 |
</tr> |
|
|
45 |
</thead> |
|
|
46 |
<tbody> |
|
|
47 |
<tr><td> |
|
|
48 |
{% if can_create_text %}<div class="dash_action"><a class="" href="{% url text-create-content %}"><img align="middle" src="{{ MEDIA_URL }}img/sop_write.png"/> {% blocktrans %}Write a text{% endblocktrans %}</a></div>{% endif %} |
|
|
49 |
{% if can_create_text %}<div class="dash_action"><a class="" href="{% url text-create-upload %}"><img align="middle" src="{{ MEDIA_URL }}img/sop_upload.png"/> {% blocktrans %}Upload a text{% endblocktrans %}</a></div>{% endif %} |
|
|
50 |
{% if can_manage_workspace %}<div class="dash_action"><a class="" href="{% url user-add %}"><img align="middle" src="{{ MEDIA_URL }}img/group_add.png"/> {% blocktrans %}Invite user{% endblocktrans %}</a></div>{% endif %} |
|
|
51 |
<div class="dash_action"><a class="" href="{% url profile %}"><img align="middle" src="{{ MEDIA_URL }}img/user_edit.png"/> {% blocktrans %}Edit your profile{% endblocktrans %}</a></div> |
|
|
52 |
<div class="dash_action"><a class="" href="{% url text %}"><img align="middle" src="{{ MEDIA_URL }}img/page_white_stack.png"/> {% blocktrans %}View text list{% endblocktrans %}</a></div> |
|
|
53 |
{% if can_manage_workspace %}<div class="dash_action"><a class="" href="{% url settings %}"><img align="middle" src="{{ MEDIA_URL }}img/cog_edit.png"/> {% blocktrans %}Configure workspace{% endblocktrans %}</a></div>{% endif %} |
|
|
54 |
</td> |
|
|
55 |
</tr> |
|
|
56 |
|
|
|
57 |
</tbody> |
|
|
58 |
</table> |
|
|
59 |
|
|
|
60 |
{% if to_mod_profiles or to_mod_comments %} |
|
|
61 |
<table class="dash_table"> |
|
|
62 |
<thead> |
|
|
63 |
<tr> |
|
|
64 |
<th><span class="em">{% blocktrans %}Moderation queue{% endblocktrans %}</span></th> |
|
|
65 |
</tr> |
|
|
66 |
</thead> |
|
|
67 |
<tbody> |
|
|
68 |
<tr><td> |
|
|
69 |
<ul class="dashlog_list"> |
|
|
70 |
{% for profile in to_mod_profiles %} |
|
|
71 |
{% with profile.user as user %} |
|
|
72 |
<li class="dashlog_item"> |
|
|
73 |
<div class="dashlog"> |
|
|
74 |
<img class="dashlog_img" src="{{ MEDIA_URL }}img/user_error_small.png"/> |
|
|
75 |
<span class="dashlog_data"> |
|
|
76 |
{% blocktrans %}user {{ user }} awaits approval{% endblocktrans %} |
|
|
77 |
</span> |
|
|
78 |
<div class="mod_actions"> |
|
|
79 |
<img src="{{ MEDIA_URL }}img/bullet_go_small.png"/> |
|
|
80 |
<a id="user-approve-{{ user.get_profile.key }}" href="#">{% blocktrans %}approve{% endblocktrans %}</a>/<a id="user-refuse-{{ user.get_profile.key }}" href="#">{% blocktrans %}refuse{% endblocktrans %}</a> {% blocktrans %}membership{% endblocktrans %} |
|
|
81 |
<script type="text/javascript"> |
|
|
82 |
<!-- |
|
|
83 |
$("#user-approve-{{ user.get_profile.key }}").click(function(){ |
|
|
84 |
url = '{% url user-enable user.get_profile.key %}'; |
|
|
85 |
question = "{% blocktrans %}Are you sure you want to approve this user's membership to the workspace?{% endblocktrans %}"; |
|
|
86 |
if (confirm(question)) { |
|
|
87 |
$.post(url, function(data){ |
|
|
88 |
window.location = '{% url index %}'; |
|
|
89 |
}); |
|
|
90 |
} |
|
|
91 |
}); |
|
|
92 |
$("#user-refuse-{{ user.get_profile.key }}").click(function(){ |
|
|
93 |
url = '{% url user-suspend user.get_profile.key %}'; |
|
|
94 |
question = "{% blocktrans %}Are you sure you want to refuse this user's membership to the workspace?{% endblocktrans %}"; |
|
|
95 |
if (confirm(question)) { |
|
|
96 |
$.post(url, function(data){ |
|
|
97 |
window.location = '{% url index %}'; |
|
|
98 |
}); |
|
|
99 |
} |
|
|
100 |
}); |
|
|
101 |
--> |
|
|
102 |
</script> |
|
|
103 |
</div> |
|
|
104 |
|
|
|
105 |
<div style="padding-left:22px;" class="dashlog_metadata"> |
|
|
106 |
{% blocktrans with profile.modified|timesince as duration %}registered {{ duration }} ago{% endblocktrans %} |
|
|
107 |
</div> |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
</div> |
|
|
111 |
</li> |
|
|
112 |
{% endwith %} |
|
|
113 |
{% endfor %} |
|
|
114 |
{% for comment in to_mod_comments %} |
|
|
115 |
<li class="dashlog_item"> |
|
|
116 |
<div class="dashlog"> |
|
|
117 |
<img class="dashlog_img" src="{{ MEDIA_URL }}img/note_error_small.png"/> |
|
|
118 |
<span class="dashlog_data"> |
|
|
119 |
|
|
|
120 |
{% blocktrans %}comment{% endblocktrans %} <a href="{% url text-view-show-comment comment.text_version.text.key comment.key %}">{{ comment.title }}</a> |
|
|
121 |
{% blocktrans with comment.user as cuser %}by {{ cuser }} on text{% endblocktrans %} <a href="{% url text-view comment.text_version.text.key %}">{{ comment.text_version.text.title }}</a> {% blocktrans %}awaits approval{% endblocktrans %}<br /> |
|
|
122 |
</span> |
|
|
123 |
<div style="padding-left:22px;" class="mod_actions"> |
|
|
124 |
<img src="{{ MEDIA_URL }}img/bullet_go_small.png"/> |
|
|
125 |
|
|
|
126 |
<a id="comment-approve-{{ comment.key }}" href="#">{% blocktrans %}approve{% endblocktrans %}</a>/<a id="comment-refuse-{{ comment.key }}" href="#">{% blocktrans %}refuse{% endblocktrans %}</a> {% blocktrans %}comment{% endblocktrans %}, |
|
|
127 |
<a href="{% url text-view-show-comment comment.text_version.text.key comment.key %}">{% blocktrans %}view in context{% endblocktrans %}</a> |
|
|
128 |
<script type="text/javascript"> |
|
|
129 |
<!-- |
|
|
130 |
$("#comment-approve-{{ comment.key }}").click(function(){ |
|
|
131 |
url = '{% url text-client-exchange %}'; |
|
|
132 |
question = "{% blocktrans %}Are you sure you want to approve this comment?{% endblocktrans %}"; |
|
|
133 |
if (confirm(question)) { |
|
|
134 |
$.post(url, |
|
|
135 |
{ |
|
|
136 |
'comment_key':'{{ comment.key }}', |
|
|
137 |
'fun':'editComment', |
|
|
138 |
'key':'{{ comment.text_version.text.key }}', |
|
116
|
139 |
'version_key':'{{ comment.text_version.key }}', |
|
0
|
140 |
'state':'approved' |
|
|
141 |
}, |
|
|
142 |
function(data){ |
|
|
143 |
window.location = '{% url index %}'; |
|
|
144 |
}); |
|
|
145 |
} |
|
|
146 |
}); |
|
|
147 |
$("#comment-refuse-{{ comment.key }}").click(function(){ |
|
|
148 |
url = '{% url text-client-exchange %}'; |
|
|
149 |
question = "{% blocktrans %}Are you sure you want to refuse this comment?{% endblocktrans %}"; |
|
|
150 |
if (confirm(question)) { |
|
|
151 |
$.post(url, |
|
|
152 |
{ |
|
|
153 |
'comment_key':'{{ comment.key }}', |
|
|
154 |
'fun':'editComment', |
|
|
155 |
'key':'{{ comment.text_version.text.key }}', |
|
116
|
156 |
'version_key':'{{ comment.text_version.key }}', |
|
0
|
157 |
'state':'unapproved' |
|
|
158 |
}, |
|
|
159 |
function(data){ |
|
|
160 |
window.location = '{% url index %}'; |
|
|
161 |
}); |
|
|
162 |
} |
|
|
163 |
}); |
|
|
164 |
--> |
|
|
165 |
</script> |
|
|
166 |
</div> |
|
|
167 |
<div style="padding-left:22px;" class="dashlog_metadata"> |
|
|
168 |
{% blocktrans with comment.modified|timesince as duration %}modified {{ duration }} ago{% endblocktrans %} |
|
|
169 |
</div> |
|
|
170 |
</div> |
|
|
171 |
</li> |
|
|
172 |
{% endfor %} |
|
|
173 |
</ul> |
|
|
174 |
</td></tr> |
|
|
175 |
</tbody> |
|
|
176 |
</table> |
|
|
177 |
{% endif %} |
|
|
178 |
|
|
|
179 |
</div> |
|
|
180 |
|
|
|
181 |
<div style="float:left;width:32%;padding-left:15px;"> |
|
|
182 |
|
|
|
183 |
<table class="dash_table"> |
|
|
184 |
<thead> |
|
|
185 |
<tr> |
|
|
186 |
<th><span class="em">{% blocktrans %}Recent texts{% endblocktrans %}</span> (<a href="{% url text %}">{% blocktrans %}all{% endblocktrans %}</a>)</th> |
|
|
187 |
</tr> |
|
|
188 |
</thead> |
|
|
189 |
<tbody> |
|
|
190 |
<tr><td> |
|
|
191 |
<ul class="dashlog_list"> |
|
|
192 |
{% for text in last_texts %} |
|
|
193 |
<li class="dashlog_item"> |
|
|
194 |
<div class="dashlog"> |
|
|
195 |
<img class="dashlog_img" src="{{ MEDIA_URL }}img/page_white.png"/> |
|
|
196 |
<span class="dashlog_data"> |
|
|
197 |
<a href="{% url text-view text.key %}">{{ text.title }}</a> |
|
|
198 |
</span> |
|
|
199 |
<div style="padding-left:22px;" class="dashlog_metadata"> |
|
|
200 |
{% nb_comments text as nb_comments %} |
|
|
201 |
{% blocktrans count nb_comments as nb_comments %}{{ nb_comments }} comment{% plural %}{{ nb_comments }} comments{% endblocktrans %}, {% blocktrans with text.modified|timesince as duration %}modified {{ duration }} ago{% endblocktrans %} |
|
|
202 |
</div> |
|
|
203 |
</div> |
|
|
204 |
</li> |
|
|
205 |
{% empty %} |
|
|
206 |
{% blocktrans %}No texts yet{% endblocktrans %} |
|
|
207 |
{% endfor %} |
|
|
208 |
|
|
|
209 |
</ul> |
|
|
210 |
</td></tr> |
|
|
211 |
</tbody> |
|
|
212 |
</table> |
|
|
213 |
|
|
|
214 |
{% if can_manage_workspace %} |
|
|
215 |
{% include "site/dashboard_bloc_recent_comments.html" %} |
|
|
216 |
{% endif %} |
|
|
217 |
</div> |
|
|
218 |
|
|
|
219 |
|
|
|
220 |
<div style="float:left;width:32%;padding-left:15px;"> |
|
|
221 |
{% if can_manage_workspace %} |
|
|
222 |
<table class="dash_table"> |
|
|
223 |
<thead> |
|
|
224 |
<tr> |
|
|
225 |
<th><span class="em">{% blocktrans %}Workspace activity{% endblocktrans %}</span> |
|
|
226 |
({% ifnotequal span 'month' %}<a href="?{% newparams 'span' 'month' %}">{% blocktrans %}month{% endblocktrans %}</a>{% else %}{% blocktrans %}month{% endblocktrans %}{% endifnotequal %}/{% ifnotequal span 'week' %}<a href="?{% newparams 'span' 'week' %}">{% blocktrans %}week{% endblocktrans %}</a>{% else %}{% blocktrans %}week{% endblocktrans %}{% endifnotequal %}/{% ifnotequal span 'day' %}<a href="?{% newparams 'span' 'day' %}">{% blocktrans %}24 hours{% endblocktrans %}</a>{% else %}{% blocktrans %}24 hours{% endblocktrans %}{% endifnotequal %})</th> |
|
|
227 |
</tr> |
|
|
228 |
</thead> |
|
|
229 |
<tbody> |
|
|
230 |
<tr> |
|
|
231 |
<td> |
|
|
232 |
<div>{% blocktrans %}Access{% endblocktrans %}</div> |
|
|
233 |
<div class="spark" id="access">{% blocktrans %}Loading...{% endblocktrans %}</div> |
|
|
234 |
<script type="text/javascript"> |
|
|
235 |
$(function() { |
|
|
236 |
$('#access').sparkline({% activity all all span auto 'text_view' 'raw' %}, {'width': '250px','height': '40px'}); |
|
|
237 |
}); |
|
|
238 |
</script> |
|
|
239 |
</td> |
|
|
240 |
</tr> |
|
|
241 |
<tr> |
|
|
242 |
<td> |
|
|
243 |
<div>{% blocktrans %}Commenting{% endblocktrans %}</div> |
|
|
244 |
<div class="spark" id="commenting">{% blocktrans %}Loading...{% endblocktrans %}</div> |
|
|
245 |
<script type="text/javascript"> |
|
|
246 |
$(function() { |
|
|
247 |
$('#commenting').sparkline({% activity all all span auto 'comment_created' 'raw' %}, {'width': '250px','height': '40px'}); |
|
|
248 |
}); |
|
|
249 |
</script> |
|
|
250 |
</td> |
|
|
251 |
</tr> |
|
|
252 |
</tbody> |
|
|
253 |
</table> |
|
|
254 |
|
|
|
255 |
<table class="dash_table"> |
|
|
256 |
<thead> |
|
|
257 |
<tr> |
|
|
258 |
<th> |
|
|
259 |
{% include "site/macros/paginator.html" %} |
|
|
260 |
<span class="em">{% blocktrans %}Activities{% endblocktrans %}</span> |
|
|
261 |
<br /> |
|
|
262 |
<span class="view_options"> |
|
|
263 |
<input type="checkbox" name="view_texts" {% ifequal view_texts 1 %}checked="checked"{% endifequal %} id="view_texts"/>{% blocktrans %}texts{% endblocktrans %} |
|
|
264 |
<input type="checkbox" name="view_comments" {% ifequal view_comments 1 %}checked="checked"{% endifequal %} id="view_comments"/>{% blocktrans %}comments{% endblocktrans %} |
|
|
265 |
{% if can_manage_workspace %} |
|
|
266 |
<input type="checkbox" name="view_users" {% ifequal view_users 1 %}checked="checked"{% endifequal %} id="view_users"/>{% blocktrans %}users{% endblocktrans %} |
|
|
267 |
{% endif %} |
|
|
268 |
</span> |
|
|
269 |
|
|
|
270 |
<script type="text/javascript"> |
|
|
271 |
<!-- |
|
|
272 |
$(function() { |
|
|
273 |
$("#view_texts").click(function(){ |
|
|
274 |
window.location = ($(this).attr('checked'))? '?{% newparams 'view_texts' '1' %}' : '?{% newparams 'view_texts' '0' %}' ; |
|
|
275 |
}); |
|
|
276 |
$("#view_comments").click(function(){ |
|
|
277 |
window.location = ($(this).attr('checked'))? '?{% newparams 'view_comments' '1' %}' : '?{% newparams 'view_comments' '0' %}' ; |
|
|
278 |
}); |
|
|
279 |
$("#view_users").click(function(){ |
|
|
280 |
window.location = ($(this).attr('checked'))? '?{% newparams 'view_users' '1' %}' : '?{% newparams 'view_users' '0' %}' ; |
|
|
281 |
}); |
|
|
282 |
}) ; |
|
|
283 |
--> |
|
|
284 |
</script> |
|
|
285 |
</th> |
|
|
286 |
</tr> |
|
|
287 |
</thead> |
|
|
288 |
<tbody> |
|
|
289 |
<tr><td> |
|
|
290 |
|
|
|
291 |
<ul class="dashlog_list"> |
|
|
292 |
<!-- {{ activity.type }} {{ activity.text }} {{ activity.comment }} {{ activity.user }} --> |
|
|
293 |
{% for activity in object_list %} |
|
|
294 |
<li class="dashlog_item"> |
|
|
295 |
<div class="dashlog"> |
|
|
296 |
<img class="dashlog_img" src={{ MEDIA_URL }}img/{{ activity.img_name }} /> |
|
|
297 |
<span class="dashlog_data"> |
|
|
298 |
{{ activity.printable_data }} |
|
|
299 |
</span> |
|
|
300 |
<div style="padding-left:22px;" class="dashlog_metadata"> |
|
|
301 |
{{ activity.printable_metadata }} |
|
|
302 |
</div> |
|
|
303 |
</div> |
|
|
304 |
</li> |
|
|
305 |
{% empty %} |
|
|
306 |
{% blocktrans %}No activities{% endblocktrans %} |
|
|
307 |
{% endfor %} |
|
|
308 |
</ul> |
|
|
309 |
</td></tr> |
|
|
310 |
</tbody> |
|
|
311 |
</table> |
|
|
312 |
{% else %} |
|
|
313 |
{% include "site/dashboard_bloc_recent_comments.html" %} |
|
|
314 |
{% endif %} |
|
|
315 |
|
|
|
316 |
</div> |
|
|
317 |
|
|
|
318 |
<div style="clear:both;"></div> |
|
|
319 |
|
|
|
320 |
</div> |
|
|
321 |
{% endblock %} |