| author | raph |
| Mon, 11 Oct 2010 14:46:20 +0200 | |
| changeset 320 | 1132f5f6eddf |
| parent 314 | d22bd8a85f10 |
| child 460 | 2fdb7d095d5c |
| permissions | -rw-r--r-- |
| 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> |
|
| 320 | 48 |
{% if can_create_text %}<div class="dash_action"><a class="" href="{% url text-create-content %}"><img align="middle" src="{{ CM_MEDIA_PREFIX }}img/sop_write.png"/> {% blocktrans %}Create a text{% endblocktrans %}</a> <a class="tip" href="#" title="{% blocktrans %}Write a text inside your browser or paste a content from your clipboard{% endblocktrans %}"> </a></div>{% endif %} |
|
314
d22bd8a85f10
add popup tip to create and upload dashboard action links
raph
parents:
238
diff
changeset
|
49 |
{% if can_create_text %}<div class="dash_action"><a class="" href="{% url text-create-upload %}"><img align="middle" src="{{ CM_MEDIA_PREFIX }}img/sop_upload.png"/> {% blocktrans %}Upload a text{% endblocktrans %}</a> <a class="tip" href="#" title="{% blocktrans %}Upload a document from your computer (Text document, Open Format document, Word document){% endblocktrans %}"> </a></div>{% endif %} |
| 160 | 50 |
{% if can_manage_workspace %}<div class="dash_action"><a class="" href="{% url user-add %}"><img align="middle" src="{{ CM_MEDIA_PREFIX }}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="{{ CM_MEDIA_PREFIX }}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="{{ CM_MEDIA_PREFIX }}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="{{ CM_MEDIA_PREFIX }}img/cog_edit.png"/> {% blocktrans %}Configure workspace{% endblocktrans %}</a></div>{% endif %} |
|
| 0 | 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"> |
|
| 160 | 74 |
<img class="dashlog_img" src="{{ CM_MEDIA_PREFIX }}img/user_error_small.png"/> |
| 0 | 75 |
<span class="dashlog_data"> |
76 |
{% blocktrans %}user {{ user }} awaits approval{% endblocktrans %} |
|
77 |
</span> |
|
78 |
<div class="mod_actions"> |
|
| 160 | 79 |
<img src="{{ CM_MEDIA_PREFIX }}img/bullet_go_small.png"/> |
| 0 | 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"> |
|
| 160 | 117 |
<img class="dashlog_img" src="{{ CM_MEDIA_PREFIX }}img/note_error_small.png"/> |
| 0 | 118 |
<span class="dashlog_data"> |
119 |
||
| 144 | 120 |
{% blocktrans %}comment{% endblocktrans %} <a href="{% url text-view-show-comment comment.text_version.text.key comment.id_key %}">{{ comment.title }}</a> |
| 0 | 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"> |
|
| 160 | 124 |
<img src="{{ CM_MEDIA_PREFIX }}img/bullet_go_small.png"/> |
| 0 | 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 %}, |
|
| 144 | 127 |
<a href="{% url text-view-show-comment comment.text_version.text.key comment.id_key %}">{% blocktrans %}view in context{% endblocktrans %}</a> |
| 0 | 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"> |
|
| 160 | 195 |
<img class="dashlog_img" src="{{ CM_MEDIA_PREFIX }}img/page_white.png"/> |
| 0 | 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 %} |
|
| 227 | 201 |
{% blocktrans count nb_comments as nb_comments %}{{ nb_comments }} comment{% plural %}{{ nb_comments }} comments{% endblocktrans %}, |
202 |
{% blocktrans count text.get_versions_number as versions_number %}1 version{% plural%}{{ versions_number }} versions{% endblocktrans %}, |
|
203 |
{% blocktrans with text.modified|timesince as duration %}modified {{ duration }} ago{% endblocktrans %} |
|
| 0 | 204 |
</div> |
205 |
</div> |
|
206 |
</li> |
|
207 |
{% empty %} |
|
208 |
{% blocktrans %}No texts yet{% endblocktrans %} |
|
209 |
{% endfor %} |
|
210 |
||
211 |
</ul> |
|
212 |
</td></tr> |
|
213 |
</tbody> |
|
214 |
</table> |
|
215 |
||
216 |
{% if can_manage_workspace %} |
|
217 |
{% include "site/dashboard_bloc_recent_comments.html" %} |
|
218 |
{% endif %} |
|
219 |
</div> |
|
220 |
||
221 |
||
222 |
<div style="float:left;width:32%;padding-left:15px;"> |
|
223 |
{% if can_manage_workspace %} |
|
224 |
<table class="dash_table"> |
|
225 |
<thead> |
|
226 |
<tr> |
|
227 |
<th><span class="em">{% blocktrans %}Workspace activity{% endblocktrans %}</span> |
|
228 |
({% 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> |
|
229 |
</tr> |
|
230 |
</thead> |
|
231 |
<tbody> |
|
232 |
<tr> |
|
233 |
<td> |
|
234 |
<div>{% blocktrans %}Access{% endblocktrans %}</div> |
|
235 |
<div class="spark" id="access">{% blocktrans %}Loading...{% endblocktrans %}</div> |
|
236 |
<script type="text/javascript"> |
|
237 |
$(function() { |
|
238 |
$('#access').sparkline({% activity all all span auto 'text_view' 'raw' %}, {'width': '250px','height': '40px'}); |
|
239 |
}); |
|
240 |
</script> |
|
241 |
</td> |
|
242 |
</tr> |
|
243 |
<tr> |
|
244 |
<td> |
|
245 |
<div>{% blocktrans %}Commenting{% endblocktrans %}</div> |
|
246 |
<div class="spark" id="commenting">{% blocktrans %}Loading...{% endblocktrans %}</div> |
|
247 |
<script type="text/javascript"> |
|
248 |
$(function() { |
|
249 |
$('#commenting').sparkline({% activity all all span auto 'comment_created' 'raw' %}, {'width': '250px','height': '40px'}); |
|
250 |
}); |
|
251 |
</script> |
|
252 |
</td> |
|
253 |
</tr> |
|
254 |
</tbody> |
|
255 |
</table> |
|
256 |
||
257 |
<table class="dash_table"> |
|
258 |
<thead> |
|
259 |
<tr> |
|
260 |
<th> |
|
| 159 | 261 |
{% with "yes" as not_show_all%} |
262 |
{% include "site/macros/paginator.html" %} |
|
263 |
{% endwith %} |
|
| 0 | 264 |
<span class="em">{% blocktrans %}Activities{% endblocktrans %}</span> |
265 |
<br /> |
|
266 |
<span class="view_options"> |
|
267 |
<input type="checkbox" name="view_texts" {% ifequal view_texts 1 %}checked="checked"{% endifequal %} id="view_texts"/>{% blocktrans %}texts{% endblocktrans %} |
|
268 |
<input type="checkbox" name="view_comments" {% ifequal view_comments 1 %}checked="checked"{% endifequal %} id="view_comments"/>{% blocktrans %}comments{% endblocktrans %} |
|
269 |
{% if can_manage_workspace %} |
|
270 |
<input type="checkbox" name="view_users" {% ifequal view_users 1 %}checked="checked"{% endifequal %} id="view_users"/>{% blocktrans %}users{% endblocktrans %} |
|
271 |
{% endif %} |
|
272 |
</span> |
|
273 |
||
274 |
<script type="text/javascript"> |
|
275 |
<!-- |
|
276 |
$(function() { |
|
277 |
$("#view_texts").click(function(){ |
|
278 |
window.location = ($(this).attr('checked'))? '?{% newparams 'view_texts' '1' %}' : '?{% newparams 'view_texts' '0' %}' ; |
|
279 |
}); |
|
280 |
$("#view_comments").click(function(){ |
|
281 |
window.location = ($(this).attr('checked'))? '?{% newparams 'view_comments' '1' %}' : '?{% newparams 'view_comments' '0' %}' ; |
|
282 |
}); |
|
283 |
$("#view_users").click(function(){ |
|
284 |
window.location = ($(this).attr('checked'))? '?{% newparams 'view_users' '1' %}' : '?{% newparams 'view_users' '0' %}' ; |
|
285 |
}); |
|
286 |
}) ; |
|
287 |
--> |
|
288 |
</script> |
|
289 |
</th> |
|
290 |
</tr> |
|
291 |
</thead> |
|
292 |
<tbody> |
|
293 |
<tr><td> |
|
294 |
||
295 |
<ul class="dashlog_list"> |
|
296 |
<!-- {{ activity.type }} {{ activity.text }} {{ activity.comment }} {{ activity.user }} --> |
|
297 |
{% for activity in object_list %} |
|
298 |
<li class="dashlog_item"> |
|
299 |
<div class="dashlog"> |
|
| 160 | 300 |
<img class="dashlog_img" src={{ CM_MEDIA_PREFIX }}img/{{ activity.img_name }} /> |
| 0 | 301 |
<span class="dashlog_data"> |
302 |
{{ activity.printable_data }} |
|
303 |
</span> |
|
304 |
<div style="padding-left:22px;" class="dashlog_metadata"> |
|
305 |
{{ activity.printable_metadata }} |
|
306 |
</div> |
|
307 |
</div> |
|
308 |
</li> |
|
309 |
{% empty %} |
|
310 |
{% blocktrans %}No activities{% endblocktrans %} |
|
311 |
{% endfor %} |
|
312 |
</ul> |
|
313 |
</td></tr> |
|
314 |
</tbody> |
|
315 |
</table> |
|
316 |
{% else %} |
|
317 |
{% include "site/dashboard_bloc_recent_comments.html" %} |
|
318 |
{% endif %} |
|
319 |
||
320 |
</div> |
|
321 |
||
322 |
<div style="clear:both;"></div> |
|
323 |
||
324 |
</div> |
|
325 |
{% endblock %} |