Commit 2c671377aa628d3e075607fa24701a88fe2970cb

Authored by Erik Zambom
Committed by GitHub
2 parents 9dd584c4 72479841

Merge pull request #542 from amadeusproject/refactoring

Daily Update - 22_08_2017
Showing 41 changed files with 521 additions and 262 deletions   Show diff stats
amadeus/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid ""
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
amadeus/static/css/.sass-cache/a7f87b90919294b62ab4f8079e31dcda8f485534/green.sassc
No preview for this file type
amadeus/static/css/themes/green.css
... ... @@ -383,7 +383,7 @@ a.add-row {
383 383 color: #FF0000; }
384 384  
385 385 .alert-low {
386   - background-color: #FFD800; }
  386 + background-color: #dfbd31; }
387 387  
388 388 .alert-medium {
389 389 background-color: #FF9000; }
... ...
amadeus/static/css/themes/green.sass
... ... @@ -526,7 +526,7 @@ a.add-row
526 526 color: #FF0000
527 527  
528 528 .alert-low
529   - background-color: #FFD800
  529 + background-color: #dfbd31
530 530  
531 531 .alert-medium
532 532 background-color: #FF9000
... ...
amadeus/templates/base.html
... ... @@ -332,6 +332,9 @@
332 332  
333 333 });
334 334 </script>
  335 +
  336 + {% block addtional_scripts %}
  337 + {% endblock %}
335 338 <div id="remove_acc"></div>
336 339 </body>
337 340  
... ...
analytics/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
api/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -18,23 +18,23 @@ msgstr &quot;&quot;
18 18 "Content-Transfer-Encoding: 8bit\n"
19 19 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
20 20  
21   -#: api/views.py:299
  21 +#: api/views.py:332
22 22 #, python-format
23 23 msgid "Last message in %s"
24 24 msgstr ""
25 25  
26   -#: api/views.py:316
  26 +#: api/views.py:349
27 27 msgid "Message sent successfully!"
28 28 msgstr ""
29 29  
30   -#: api/views.py:320
  30 +#: api/views.py:353
31 31 msgid "Error while sending message!"
32 32 msgstr ""
33 33  
34   -#: api/views.py:327
  34 +#: api/views.py:360
35 35 msgid "No information received!"
36 36 msgstr ""
37 37  
38   -#: api/views.py:333
  38 +#: api/views.py:366
39 39 msgid "Amadeus"
40 40 msgstr ""
... ...
bulletin/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -70,7 +70,7 @@ msgstr &quot;Metas&quot;
70 70 msgid "Relevant Indicators"
71 71 msgstr "Indicadores Relevantes"
72 72  
73   -#: bulletin/models.py:25 bulletin/views.py:847
  73 +#: bulletin/models.py:25 bulletin/views.py:845
74 74 msgid "Bulletin"
75 75 msgstr "Boletim"
76 76  
... ... @@ -189,14 +189,14 @@ msgid &quot;The picture could not exceed 5MB.&quot;
189 189 msgstr "A imagem não pode exceder 5MB."
190 190  
191 191 #: bulletin/templates/bulletin/send_message.html:62
192   -#: bulletin/templates/bulletin/view.html:145
193   -#: bulletin/templates/bulletin/window_view.html:127
  192 +#: bulletin/templates/bulletin/view.html:209
  193 +#: bulletin/templates/bulletin/window_view.html:219
194 194 msgid "Close"
195 195 msgstr "Fechar"
196 196  
197 197 #: bulletin/templates/bulletin/send_message.html:63
198   -#: bulletin/templates/bulletin/view.html:146
199   -#: bulletin/templates/bulletin/window_view.html:128
  198 +#: bulletin/templates/bulletin/view.html:210
  199 +#: bulletin/templates/bulletin/window_view.html:220
200 200 msgid "Send"
201 201 msgstr "Enviar"
202 202  
... ... @@ -204,37 +204,27 @@ msgstr &quot;Enviar&quot;
204 204 msgid "Edit: "
205 205 msgstr "Editar: "
206 206  
207   -#: bulletin/templates/bulletin/view.html:61
208   -#: bulletin/templates/bulletin/window_view.html:70
209   -msgid "Check your goals"
210   -msgstr "Veja suas metas"
211   -
212   -#: bulletin/templates/bulletin/view.html:122
213   -#: bulletin/templates/bulletin/window_view.html:106
  207 +#: bulletin/templates/bulletin/view.html:189
  208 +#: bulletin/templates/bulletin/window_view.html:199
214 209 msgid "There are obstructions to your activities?"
215 210 msgstr "Existem impedimentos para as suas atividades?"
216 211  
217   -#: bulletin/templates/bulletin/view.html:123
218   -#: bulletin/templates/bulletin/window_view.html:107
  212 +#: bulletin/templates/bulletin/view.html:190
  213 +#: bulletin/templates/bulletin/window_view.html:200
219 214 msgid "Click here"
220 215 msgstr "Clique aqui"
221 216  
222   -#: bulletin/templates/bulletin/view.html:123
223   -#: bulletin/templates/bulletin/window_view.html:107
  217 +#: bulletin/templates/bulletin/view.html:190
  218 +#: bulletin/templates/bulletin/window_view.html:200
224 219 msgid "to communicate the difficulties that may decrease your performance."
225 220 msgstr "para informar as dificuldades que podem prejudicar seu desempenho."
226 221  
227   -#: bulletin/templates/bulletin/view.html:135
228   -#: bulletin/templates/bulletin/window_view.html:117
229   -msgid "Inform difficulties"
230   -msgstr "Informe as dificuldades"
231   -
232   -#: bulletin/templates/bulletin/view.html:141
233   -#: bulletin/templates/bulletin/window_view.html:123
  222 +#: bulletin/templates/bulletin/view.html:205
  223 +#: bulletin/templates/bulletin/window_view.html:215
234 224 msgid "Type here the dificulties that may harm your performance"
235 225 msgstr "Escreva aqui as dificuldades que podem diminuir sua performance"
236 226  
237   -#: bulletin/utils.py:50 bulletin/views.py:914
  227 +#: bulletin/utils.py:50 bulletin/views.py:912
238 228 #, python-format
239 229 msgid "Last message in %s"
240 230 msgstr "Última mensagem em %s"
... ... @@ -262,15 +252,17 @@ msgstr &quot;O tópico %s não possui metas, então você não pode criar um Boletim.
262 252 msgid ""
263 253 "The deadline to submit the goals of the topic %s has not yet closed, so you "
264 254 "can't create a Bulletin."
265   -msgstr "O prazo para submeter as metas do tópico %s ainda não foi fechado, então você não pode criar um Boletim."
  255 +msgstr ""
  256 +"O prazo para submeter as metas do tópico %s ainda não foi fechado, então "
  257 +"você não pode criar um Boletim."
266 258  
267 259 #: bulletin/views.py:325
268 260 #, python-format
269 261 msgid "The topic %s already has a Bulletin, so you can't create another."
270 262 msgstr "O tópico %s já possui um Boletim, então você não pode criar outro."
271 263  
272   -#: bulletin/views.py:343 bulletin/views.py:356 bulletin/views.py:627
273   -#: bulletin/views.py:629 bulletin/views.py:645 bulletin/views.py:647
  264 +#: bulletin/views.py:343 bulletin/views.py:356 bulletin/views.py:625
  265 +#: bulletin/views.py:627 bulletin/views.py:643 bulletin/views.py:645
274 266 msgid "Visualize"
275 267 msgstr "Visualizar"
276 268  
... ... @@ -283,60 +275,66 @@ msgstr &quot;&quot;
283 275 "O Boletim \"%s\" foi adicionado ao Tópio \"%s\" do ambiente virtual \"%s\" "
284 276 "com sucesso!"
285 277  
286   -#: bulletin/views.py:691
  278 +#: bulletin/views.py:689
287 279 msgid "Update Bulletin"
288 280 msgstr "Atualizar boletim"
289 281  
290   -#: bulletin/views.py:709
  282 +#: bulletin/views.py:707
291 283 #, python-format
292 284 msgid "The Bulletin \"%s\" was updated successfully!"
293 285 msgstr "O Boletim \"%s\" foi atualizado com sucesso!"
294 286  
295   -#: bulletin/views.py:745
  287 +#: bulletin/views.py:743
296 288 #, python-format
297 289 msgid ""
298 290 "The bulletin \"%s\" was removed successfully from virtual environment \"%s\"!"
299 291 msgstr "O boletim \"%s\" foi removido com sucesso do ambiente virtual \"%s\"! "
300 292  
301   -#: bulletin/views.py:804
  293 +#: bulletin/views.py:802
302 294 msgid "Bulletin Reports"
303 295 msgstr "Relatórios do Boletim"
304 296  
305   -#: bulletin/views.py:823
  297 +#: bulletin/views.py:821
306 298 msgid "Realized"
307 299 msgstr "Realizada"
308 300  
309   -#: bulletin/views.py:823
  301 +#: bulletin/views.py:821
310 302 msgid "Unrealized"
311 303 msgstr "Não realizada"
312 304  
313   -#: bulletin/views.py:823
  305 +#: bulletin/views.py:821
314 306 msgid "Historic"
315 307 msgstr "Histórico"
316 308  
317   -#: bulletin/views.py:838 bulletin/views.py:846
  309 +#: bulletin/views.py:836 bulletin/views.py:844
318 310 msgid "View"
319 311 msgstr "Visualizar"
320 312  
321   -#: bulletin/views.py:852
  313 +#: bulletin/views.py:850
322 314 msgid "Actions about resource"
323 315 msgstr "Ações sobre o recurso"
324 316  
325   -#: bulletin/views.py:853
  317 +#: bulletin/views.py:851
326 318 msgid "Quantity"
327 319 msgstr "Quantidade"
328 320  
329   -#: bulletin/views.py:902
  321 +#: bulletin/views.py:900
330 322 msgid "[Photo]"
331 323 msgstr "[Foto]"
332 324  
333   -#: bulletin/views.py:923
  325 +#: bulletin/views.py:921
334 326 msgid "The message was successfull sent!"
335 327 msgstr "A mensagem foi enviada com sucesso!"
336 328  
337   -#: bulletin/views.py:925
  329 +#: bulletin/views.py:923
338 330 msgid "No user selected!"
339 331 msgstr "Nenhum usuário selecionado!"
340 332  
  333 +#~ msgid "Check your goals"
  334 +#~ msgstr "Veja suas metas"
  335 +
  336 +#~ msgid "Inform difficulties"
  337 +#~ msgstr "Informe as dificuldades"
  338 +
341 339 #~ msgid "Bulletin Data (Goals)"
342 340 #~ msgstr "Dados do boletim (Metas)"
... ...
categories/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
chat/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -143,7 +143,7 @@ msgstr &quot;Ver Perfil&quot;
143 143 #: chat/templates/chat/subject_view.html:9
144 144 #: chat/templates/chat/subject_view.html:27
145 145 #: chat/templates/chat/subject_view_participants.html:9
146   -#: chat/templates/chat/subject_view_participants.html:31 chat/views.py:65
  146 +#: chat/templates/chat/subject_view_participants.html:31 chat/views.py:67
147 147 msgid "Messages"
148 148 msgstr "Mensagens"
149 149  
... ... @@ -250,33 +250,33 @@ msgstr &quot;Inativo&quot;
250 250 msgid "Offline"
251 251 msgstr "Offline"
252 252  
253   -#: chat/templatetags/chat_tags.py:63 chat/views.py:422
  253 +#: chat/templatetags/chat_tags.py:63 chat/views.py:429
254 254 msgid "Unfavorite"
255 255 msgstr "Desfavoritar"
256 256  
257   -#: chat/templatetags/chat_tags.py:65 chat/views.py:426
  257 +#: chat/templatetags/chat_tags.py:65 chat/views.py:433
258 258 msgid "Favorite"
259 259 msgstr "Favoritar"
260 260  
261   -#: chat/views.py:104
  261 +#: chat/views.py:106
262 262 msgid "Messages - Participants"
263 263 msgstr "Mensagems - Participantes"
264 264  
265   -#: chat/views.py:159
  265 +#: chat/views.py:161
266 266 #, python-format
267 267 msgid "%s - Participants"
268 268 msgstr "%s - Participantes"
269 269  
270   -#: chat/views.py:214
  270 +#: chat/views.py:216
271 271 #, python-format
272 272 msgid "%s - Messages"
273 273 msgstr "%s - Mensagens"
274 274  
275   -#: chat/views.py:353
  275 +#: chat/views.py:355
276 276 msgid "[Photo]"
277 277 msgstr "[Foto]"
278 278  
279   -#: chat/views.py:365
  279 +#: chat/views.py:367
280 280 #, python-format
281 281 msgid "Last message in %s"
282 282 msgstr "Última mensagem em %s"
... ...
dashboards/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
file_link/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
goals/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -76,12 +76,12 @@ msgstr &quot;Data limite para submissão&quot;
76 76  
77 77 #: goals/models.py:14 goals/models.py:39 goals/models.py:47
78 78 #: goals/templates/goals/_form_submit.html:21
79   -#: goals/templates/goals/view.html:73
  79 +#: goals/templates/goals/view.html:86
80 80 msgid "Goal"
81 81 msgstr "Meta"
82 82  
83 83 #: goals/models.py:15 goals/templates/goals/_answered.html:20
84   -#: goals/views.py:1108
  84 +#: goals/views.py:1153
85 85 msgid "Goals"
86 86 msgstr "Metas"
87 87  
... ... @@ -148,7 +148,7 @@ msgstr &quot;Especificação de Metas&quot;
148 148  
149 149 #: goals/templates/goals/_form.html:109
150 150 #: goals/templates/goals/_form_submit.html:22
151   -#: goals/templates/goals/view.html:74
  151 +#: goals/templates/goals/view.html:87
152 152 msgid "Minimum percentage desired"
153 153 msgstr "Porcentagem mínima desejada"
154 154  
... ... @@ -169,7 +169,7 @@ msgid &quot;Wished period&quot;
169 169 msgstr "Período desejado"
170 170  
171 171 #: goals/templates/goals/_form.html:402
172   -#: goals/templates/goals/_form_submit.html:63
  172 +#: goals/templates/goals/_form_submit.html:69
173 173 msgid "Save"
174 174 msgstr "Salvar"
175 175  
... ... @@ -189,11 +189,11 @@ msgstr &quot;Adicionar nova notificação&quot;
189 189 msgid "Remove this"
190 190 msgstr "Remover essa notificação"
191 191  
192   -#: goals/templates/goals/_form_submit.html:54
  192 +#: goals/templates/goals/_form_submit.html:58
193 193 msgid "There are obstacles to your activities?"
194 194 msgstr "Existem impedimentos para as suas atividades?"
195 195  
196   -#: goals/templates/goals/_form_submit.html:55
  196 +#: goals/templates/goals/_form_submit.html:59
197 197 msgid "Type here the dificulties that may harm your performance"
198 198 msgstr "Digite aqui os obstáculos que podem prejudicar o seu desempenho."
199 199  
... ... @@ -356,7 +356,7 @@ msgstr &quot;Enviar&quot;
356 356  
357 357 #: goals/templates/goals/submit.html:66
358 358 #: goals/templates/goals/update_submit.html:69
359   -#: goals/templates/goals/view.html:66
  359 +#: goals/templates/goals/view.html:79
360 360 #: goals/templates/goals/window_submit.html:40
361 361 msgid "Limit submission date"
362 362 msgstr "Data limite de submissão"
... ... @@ -369,129 +369,138 @@ msgstr &quot;Editar: Metas de Tópico&quot;
369 369 msgid "Update My Goals"
370 370 msgstr "Atualizar Minhas Metas"
371 371  
372   -#: goals/templates/goals/view.html:19 goals/templatetags/goals_filters.py:72
373   -#: goals/views.py:235
  372 +#: goals/templates/goals/view.html:19 goals/templatetags/goals_filters.py:73
  373 +#: goals/views.py:260
374 374 msgid "My Goals"
375 375 msgstr "Minhas Metas"
376 376  
377   -#: goals/templates/goals/view.html:75
  377 +#: goals/templates/goals/view.html:88
378 378 msgid "Goal stabilished"
379 379 msgstr "Meta estabelecida"
380 380  
381   -#: goals/templates/goals/view.html:83
  381 +#: goals/templates/goals/view.html:98
382 382 msgid "Update Goals"
383 383 msgstr "Atualizar Metas"
384 384  
385   -#: goals/templatetags/goals_filters.py:59
  385 +#: goals/templatetags/goals_filters.py:60
386 386 msgid "Visualized"
387 387 msgstr "Visualizou"
388 388  
389   -#: goals/templatetags/goals_filters.py:61
  389 +#: goals/templatetags/goals_filters.py:62
390 390 msgid "Added"
391 391 msgstr "Adicionou"
392 392  
393   -#: goals/templatetags/goals_filters.py:63
  393 +#: goals/templatetags/goals_filters.py:64
394 394 msgid "Updated"
395 395 msgstr "Atualizou"
396 396  
397   -#: goals/templatetags/goals_filters.py:65 goals/views.py:1088
  397 +#: goals/templatetags/goals_filters.py:66 goals/views.py:1133
398 398 msgid "Submitted"
399 399 msgstr "Submeteu"
400 400  
401   -#: goals/templatetags/goals_filters.py:76
  401 +#: goals/templatetags/goals_filters.py:77
402 402 #, python-format
403 403 msgid "%s Instance"
404 404 msgstr "Instância de %s"
405 405  
406   -#: goals/utils.py:59 goals/views.py:1179
  406 +#: goals/utils.py:59 goals/views.py:1224
407 407 #, python-format
408 408 msgid "Last message in %s"
409 409 msgstr "Última mensagem em %s"
410 410  
411   -#: goals/views.py:354 goals/views.py:490 goals/views.py:608
  411 +#: goals/views.py:386 goals/views.py:525 goals/views.py:647
412 412 #, python-format
413 413 msgid "#Dificulty(ies) found in %s"
414 414 msgstr "#Dificuldade(s) comunicada(s) em %s"
415 415  
416   -#: goals/views.py:376 goals/views.py:514
  416 +#: goals/views.py:408 goals/views.py:549
417 417 #, python-format
418 418 msgid "Your goals for %s was save successfully!"
419 419 msgstr "Suas metas para %s foram salvas com sucesso!"
420 420  
421   -#: goals/views.py:632
  421 +#: goals/views.py:596
  422 +#, python-format
  423 +msgid ""
  424 +"The date limit to submit your Goals specification for the topic %s has "
  425 +"passed, so you can't edit your values!"
  426 +msgstr ""
  427 +"A data limite para submeter suas Metas para o tópico %s passou, então você "
  428 +"não pode editar seus valores!"
  429 +
  430 +#: goals/views.py:671
422 431 #, python-format
423 432 msgid "Your goals for %s was update successfully!"
424 433 msgstr "Suas metas para %s foram atualizadas com sucesso!"
425 434  
426   -#: goals/views.py:683 goals/views.py:697 goals/views.py:722 goals/views.py:841
427   -#: goals/views.py:855 goals/views.py:865
  435 +#: goals/views.py:722 goals/views.py:736 goals/views.py:761 goals/views.py:883
  436 +#: goals/views.py:897 goals/views.py:907
428 437 msgid "Visualize"
429 438 msgstr "Visualizar"
430 439  
431   -#: goals/views.py:683 goals/views.py:697 goals/views.py:722 goals/views.py:841
432   -#: goals/views.py:855 goals/views.py:865
  440 +#: goals/views.py:722 goals/views.py:736 goals/views.py:761 goals/views.py:883
  441 +#: goals/views.py:897 goals/views.py:907
433 442 msgid "Submit"
434 443 msgstr "Submeter"
435 444  
436   -#: goals/views.py:785
  445 +#: goals/views.py:824
437 446 msgid "Create Topic Goals"
438 447 msgstr "Adicionar Metas do Tópico"
439 448  
440   -#: goals/views.py:796
  449 +#: goals/views.py:835
441 450 #, python-format
442 451 msgid "The Goals specification for the topic %s was realized successfully!"
443 452 msgstr "A Especificação de Metas para o tópico %s foi realizada com sucesso!"
444 453  
445   -#: goals/views.py:920
  454 +#: goals/views.py:962
446 455 msgid "Update Topic Goals"
447 456 msgstr "Atualizar Metas do Tópico"
448 457  
449   -#: goals/views.py:931
  458 +#: goals/views.py:973
450 459 #, python-format
451 460 msgid "The Goals specification for the topic %s was updated successfully!"
452 461 msgstr "A Especificação de Metas para o tópico %s foi atualizada com sucesso!"
453 462  
454   -#: goals/views.py:967
  463 +#: goals/views.py:1012
455 464 #, python-format
456 465 msgid "The Goals specification of the topic %s was removed successfully!"
457 466 msgstr "A Especificação de Metas para o tópico %s foi removida com sucesso!"
458 467  
459   -#: goals/views.py:1057
  468 +#: goals/views.py:1102
460 469 msgid "Goals Reports"
461 470 msgstr "Relatórios de metas"
462 471  
463   -#: goals/views.py:1076
  472 +#: goals/views.py:1121
464 473 msgid "Realized"
465 474 msgstr "Realizada"
466 475  
467   -#: goals/views.py:1076
  476 +#: goals/views.py:1121
468 477 msgid "Unrealized"
469 478 msgstr "Não Realizada"
470 479  
471   -#: goals/views.py:1076
  480 +#: goals/views.py:1121
472 481 msgid "Historic"
473 482 msgstr "Histórico"
474 483  
475   -#: goals/views.py:1088
  484 +#: goals/views.py:1133
476 485 msgid "View"
477 486 msgstr "Visualizar"
478 487  
479   -#: goals/views.py:1119
  488 +#: goals/views.py:1164
480 489 msgid "Actions about resource"
481 490 msgstr "Ações sobre o recurso"
482 491  
483   -#: goals/views.py:1120
  492 +#: goals/views.py:1165
484 493 msgid "Quantity"
485 494 msgstr "Quantidade"
486 495  
487   -#: goals/views.py:1167
  496 +#: goals/views.py:1212
488 497 msgid "[Photo]"
489 498 msgstr "[Imagem]"
490 499  
491   -#: goals/views.py:1187
  500 +#: goals/views.py:1232
492 501 msgid "The message was successfull sent!"
493 502 msgstr "A mensagem foi enviada com sucesso!"
494 503  
495   -#: goals/views.py:1189
  504 +#: goals/views.py:1234
496 505 msgid "No user selected!"
497 506 msgstr "Nenhum usuário selecionado!"
... ...
goals/templates/goals/view.html
1 1 {% extends 'subjects/view.html' %}
2 2  
3   -{% load static i18n pagination permissions_tags subject_counter %}
  3 +{% load static i18n pagination permissions_tags subject_counter goals_filters %}
4 4 {% load django_bootstrap_breadcrumbs %}
5 5  
6 6 {% block style %}
... ... @@ -33,6 +33,7 @@
33 33 {% endif %}
34 34  
35 35 {% resource_permissions request.user goal as has_resource_permissions %}
  36 + {% subject_permissions request.user goal.topic.subject as has_subject_permissions %}
36 37  
37 38 {% if goal.visible %}
38 39 <div class="panel panel-info topic-panel">
... ... @@ -57,6 +58,18 @@
57 58 </div>
58 59 </div>
59 60 <div id="{{subject.slug}}" class="panel-collapse in collapse category-panel-content">
  61 + {% if has_subject_permissions %}
  62 + <form id="student_goals" action="" method="POST">
  63 + {% csrf_token %}
  64 + <select name="selected_student" onchange="$('#student_goals').submit();">
  65 + {% for stu in sub_students %}
  66 + <option value="{{ stu.email }}" {% if stu.email == student %}selected{% endif %}>{{ stu }}</option>
  67 + {% endfor %}
  68 + </select>
  69 + </form>
  70 + <br clear="all" />
  71 + {% endif %}
  72 +
60 73 {% autoescape off %}
61 74 {{ goal.presentation }}
62 75 {% endautoescape %}
... ... @@ -77,11 +90,22 @@
77 90 </div>
78 91 {% endfor %}
79 92  
80   - <hr />
  93 + {% if not has_subject_permissions %}
  94 + {% if not goal|is_close %}
  95 + <hr />
81 96  
82   - <div class="text-center">
83   - <a href="{% url 'goals:update_submit' goal.slug %}" class="btn btn-success btn-raised">{% trans 'Update Goals' %}</a>
84   - </div>
  97 + <div class="text-center">
  98 + <a href="{% url 'goals:update_submit' goal.slug %}" class="btn btn-success btn-raised">{% trans 'Update Goals' %}</a>
  99 + </div>
  100 + {% endif %}
  101 + {% endif %}
85 102 </div>
86 103 </div>
87 104 {% endblock %}
  105 +
  106 +
  107 +{% block addtional_scripts %}
  108 + <script type="text/javascript">
  109 + sessionSecurity.confirmFormDiscard = undefined;
  110 + </script>
  111 +{% endblock %}
88 112 \ No newline at end of file
... ...
goals/templatetags/goals_filters.py
1 1 from django import template
  2 +from django.utils import timezone
2 3 from django.utils.translation import ugettext_lazy as _
3 4  
4 5 from goals.models import MyGoals
... ... @@ -73,4 +74,11 @@ def log_object(log):
73 74  
74 75 name = log.context['goals_name']
75 76  
76   - return _("%s Instance")%(name)
77 77 \ No newline at end of file
  78 + return _("%s Instance")%(name)
  79 +
  80 +@register.filter(name = 'is_close')
  81 +def is_close(goal):
  82 + if goal.limit_submission_date < timezone.now():
  83 + return True
  84 +
  85 + return False
78 86 \ No newline at end of file
... ...
goals/views.py
... ... @@ -31,7 +31,7 @@ from webpage.forms import FormModalMessage
31 31  
32 32 from django.db.models import Q
33 33 from django.template.loader import render_to_string
34   -from django.utils import formats
  34 +from django.utils import formats, timezone
35 35 import textwrap
36 36 from django.utils.html import strip_tags
37 37 import json
... ... @@ -207,16 +207,41 @@ class InsideView(LoginRequiredMixin, LogMixin, generic.ListView):
207 207  
208 208 template_name = 'goals/view.html'
209 209 model = Goals
210   - context_object_name = 'itens'
  210 + context_object_name = 'itens'
  211 +
  212 + students = None
211 213  
212 214 def get_queryset(self):
213 215 slug = self.kwargs.get('slug', '')
214 216 goal = get_object_or_404(Goals, slug = slug)
215 217  
216   - goals = MyGoals.objects.filter(user = self.request.user, item__goal = goal)
  218 + if has_subject_permissions(self.request.user, goal.topic.subject):
  219 + self.students = User.objects.filter(subject_student = goal.topic.subject).order_by('social_name', 'username')
  220 +
  221 + goals = MyGoals.objects.filter(user = self.students.first(), item__goal = goal)
  222 + else:
  223 + goals = MyGoals.objects.filter(user = self.request.user, item__goal = goal)
217 224  
218 225 return goals
219 226  
  227 + def post(self, request, *args, **kwargs):
  228 + slug = self.kwargs.get('slug', '')
  229 + goal = get_object_or_404(Goals, slug = slug)
  230 +
  231 + user = request.POST.get('selected_student', None)
  232 +
  233 + if has_subject_permissions(request.user, goal.topic.subject):
  234 + self.students = User.objects.filter(subject_student = goal.topic.subject).order_by('social_name', 'username')
  235 +
  236 + if not user is None:
  237 + self.object_list = MyGoals.objects.filter(user__email = user, item__goal = goal)
  238 + else:
  239 + self.object_list = MyGoals.objects.filter(user = self.request.user, item__goal = goal)
  240 + else:
  241 + self.object_list = MyGoals.objects.filter(user = self.request.user, item__goal = goal)
  242 +
  243 + return self.render_to_response(self.get_context_data())
  244 +
220 245 def dispatch(self, request, *args, **kwargs):
221 246 slug = self.kwargs.get('slug', '')
222 247 goals = get_object_or_404(Goals, slug = slug)
... ... @@ -238,6 +263,10 @@ class InsideView(LoginRequiredMixin, LogMixin, generic.ListView):
238 263 context['topic'] = goals.topic
239 264 context['subject'] = goals.topic.subject
240 265  
  266 + if not self.students is None:
  267 + context['sub_students'] = self.students
  268 + context['student'] = self.request.POST.get('selected_student', self.students.first().email)
  269 +
241 270 self.log_context['category_id'] = goals.topic.subject.category.id
242 271 self.log_context['category_name'] = goals.topic.subject.category.name
243 272 self.log_context['category_slug'] = goals.topic.subject.category.slug
... ... @@ -277,6 +306,9 @@ class NewWindowSubmit(LoginRequiredMixin, LogMixin, generic.edit.CreateView):
277 306 if not has_resource_permissions(request.user, goals):
278 307 return redirect(reverse_lazy('subjects:home'))
279 308  
  309 + if has_subject_permissions(request.user, goals.topic.subject):
  310 + return redirect(reverse_lazy('goals:view', kwargs = {'slug': goals.slug}))
  311 +
280 312 if MyGoals.objects.filter(item__goal = goals, user = request.user).exists():
281 313 return redirect(reverse_lazy('goals:view', args = (), kwargs = {'slug': slug}))
282 314  
... ... @@ -413,6 +445,9 @@ class SubmitView(LoginRequiredMixin, LogMixin, generic.edit.CreateView):
413 445 if not has_resource_permissions(request.user, goals):
414 446 return redirect(reverse_lazy('subjects:home'))
415 447  
  448 + if has_subject_permissions(request.user, goals.topic.subject):
  449 + return redirect(reverse_lazy('goals:view', kwargs = {'slug': goals.slug}))
  450 +
416 451 if MyGoals.objects.filter(item__goal = goals, user = request.user).exists():
417 452 return redirect(reverse_lazy('goals:view', args = (), kwargs = {'slug': slug}))
418 453  
... ... @@ -557,6 +592,10 @@ class UpdateSubmit(LoginRequiredMixin, LogMixin, generic.UpdateView):
557 592 if not has_resource_permissions(request.user, goals):
558 593 return redirect(reverse_lazy('subjects:home'))
559 594  
  595 + if goals.limit_submission_date < timezone.now():
  596 + messages.error(self.request, _('The date limit to submit your Goals specification for the topic %s has passed, so you can\'t edit your values!')%(goals.topic.name))
  597 + return redirect(reverse_lazy('goals:view', kwargs = {'slug': slug}))
  598 +
560 599 return super(UpdateSubmit, self).dispatch(request, *args, **kwargs)
561 600  
562 601 def get(self, request, *args, **kwargs):
... ... @@ -795,14 +834,17 @@ class CreateView(LoginRequiredMixin, LogMixin, generic.edit.CreateView):
795 834 def get_success_url(self):
796 835 messages.success(self.request, _('The Goals specification for the topic %s was realized successfully!')%(self.object.topic.name))
797 836  
798   - success_url = reverse_lazy('goals:submit', kwargs = {'slug': self.object.slug})
  837 + if has_subject_permissions(self.request.user, self.object.topic.subject):
  838 + success_url = reverse_lazy('goals:view', kwargs = {'slug': self.object.slug})
  839 + else:
  840 + success_url = reverse_lazy('goals:submit', kwargs = {'slug': self.object.slug})
799 841  
800   - if self.object.show_window:
801   - self.request.session['resources'] = {}
802   - self.request.session['resources']['new_page'] = True
803   - self.request.session['resources']['new_page_url'] = reverse('goals:window_submit', kwargs = {'slug': self.object.slug})
  842 + if self.object.show_window:
  843 + self.request.session['resources'] = {}
  844 + self.request.session['resources']['new_page'] = True
  845 + self.request.session['resources']['new_page_url'] = reverse('goals:window_submit', kwargs = {'slug': self.object.slug})
804 846  
805   - success_url = reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug})
  847 + success_url = reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug})
806 848  
807 849 return success_url
808 850  
... ... @@ -930,14 +972,17 @@ class UpdateView(LoginRequiredMixin, LogMixin, generic.UpdateView):
930 972 def get_success_url(self):
931 973 messages.success(self.request, _('The Goals specification for the topic %s was updated successfully!')%(self.object.topic.name))
932 974  
933   - success_url = reverse_lazy('goals:submit', kwargs = {'slug': self.object.slug})
  975 + if has_subject_permissions(self.request.user, self.object.topic.subject):
  976 + success_url = reverse_lazy('goals:view', kwargs = {'slug': self.object.slug})
  977 + else:
  978 + success_url = reverse_lazy('goals:submit', kwargs = {'slug': self.object.slug})
934 979  
935   - if self.object.show_window:
936   - self.request.session['resources'] = {}
937   - self.request.session['resources']['new_page'] = True
938   - self.request.session['resources']['new_page_url'] = reverse('goals:window_submit', kwargs = {'slug': self.object.slug})
  980 + if self.object.show_window:
  981 + self.request.session['resources'] = {}
  982 + self.request.session['resources']['new_page'] = True
  983 + self.request.session['resources']['new_page_url'] = reverse('goals:window_submit', kwargs = {'slug': self.object.slug})
939 984  
940   - success_url = reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug})
  985 + success_url = reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug})
941 986  
942 987 return success_url
943 988  
... ...
links/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
log/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
mailsender/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
mural/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
news/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
notifications/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -24,7 +24,7 @@ msgstr &quot;Meta&quot;
24 24  
25 25 #: notifications/models.py:9
26 26 #: notifications/templates/notifications/_ajax_history.html:33
27   -#: notifications/templates/notifications/_history.html:32
  27 +#: notifications/templates/notifications/_history.html:35
28 28 msgid "Task"
29 29 msgstr "Tarefa"
30 30  
... ... @@ -61,118 +61,118 @@ msgid &quot;Creation Date&quot;
61 61 msgstr "Data de Criação"
62 62  
63 63 #: notifications/templates/notifications/_ajax_history.html:6
64   -#: notifications/templates/notifications/_history.html:6
  64 +#: notifications/templates/notifications/_history.html:8
65 65 msgid "rows"
66 66 msgstr "registros"
67 67  
68 68 #: notifications/templates/notifications/_ajax_history.html:11
69   -#: notifications/templates/notifications/_history.html:11
  69 +#: notifications/templates/notifications/_history.html:14
70 70 msgid "Search"
71 71 msgstr "Buscar"
72 72  
73 73 #: notifications/templates/notifications/_ajax_history.html:13
74   -#: notifications/templates/notifications/_history.html:13
  74 +#: notifications/templates/notifications/_history.html:16
75 75 msgid "Insert date or resource"
76 76 msgstr "Digite uma data ou recurso"
77 77  
78 78 #: notifications/templates/notifications/_ajax_history.html:23
79   -#: notifications/templates/notifications/_history.html:22
  79 +#: notifications/templates/notifications/_history.html:25
80 80 msgid "Date"
81 81 msgstr "Data"
82 82  
83 83 #: notifications/templates/notifications/_ajax_history.html:28
84   -#: notifications/templates/notifications/_history.html:27
  84 +#: notifications/templates/notifications/_history.html:30
85 85 msgid "Resource"
86 86 msgstr "Recurso"
87 87  
88 88 #: notifications/templates/notifications/_ajax_history.html:38
89   -#: notifications/templates/notifications/_history.html:37
  89 +#: notifications/templates/notifications/_history.html:40
90 90 msgid "Final Date"
91 91 msgstr "Data Final"
92 92  
93 93 #: notifications/templates/notifications/_ajax_history.html:43
94   -#: notifications/templates/notifications/_history.html:42
  94 +#: notifications/templates/notifications/_history.html:45
95 95 msgid "Notification"
96 96 msgstr "Notificação"
97 97  
98 98 #: notifications/templates/notifications/_ajax_history.html:48
99   -#: notifications/templates/notifications/_history.html:47
  99 +#: notifications/templates/notifications/_history.html:50
100 100 msgid "Aware"
101 101 msgstr "Ciente"
102 102  
103 103 #: notifications/templates/notifications/_ajax_history.html:53
104   -#: notifications/templates/notifications/_history.html:52
  104 +#: notifications/templates/notifications/_history.html:55
105 105 msgid "Observation"
106 106 msgstr "Observação"
107 107  
108 108 #: notifications/templates/notifications/_ajax_history.html:64
109   -#: notifications/templates/notifications/_history.html:63
110   -#: notifications/templates/notifications/_view.html:28
  109 +#: notifications/templates/notifications/_history.html:66
  110 +#: notifications/templates/notifications/_view.html:30
111 111 msgid "Not Informed"
112 112 msgstr "Não Informado"
113 113  
114 114 #: notifications/templates/notifications/_ajax_history.html:72
115   -#: notifications/templates/notifications/_history.html:71
  115 +#: notifications/templates/notifications/_history.html:74
116 116 msgid "No results found"
117 117 msgstr "Nenhum resultado encontrado"
118 118  
119   -#: notifications/templates/notifications/_view.html:10
  119 +#: notifications/templates/notifications/_view.html:12
120 120 msgid "Home"
121 121 msgstr "Início"
122 122  
123   -#: notifications/templates/notifications/_view.html:28
  123 +#: notifications/templates/notifications/_view.html:30
124 124 msgid "Final Date/Time"
125 125 msgstr "Data/Hora Final"
126 126  
127   -#: notifications/templates/notifications/_view.html:31
  127 +#: notifications/templates/notifications/_view.html:33
128 128 msgid "Your goal was to realize this in"
129 129 msgstr "Sua meta é realizar essa tarefa em"
130 130  
131   -#: notifications/templates/notifications/_view.html:33
  131 +#: notifications/templates/notifications/_view.html:35
132 132 msgid "Task finished in"
133 133 msgstr "Tarefa finalizada em"
134 134  
135   -#: notifications/templates/notifications/_view.html:37
  135 +#: notifications/templates/notifications/_view.html:39
136 136 msgid "of the participants already realized this task."
137 137 msgstr "dos participantes já realizaram essa tarefa."
138 138  
139   -#: notifications/templates/notifications/_view.html:50
  139 +#: notifications/templates/notifications/_view.html:53
140 140 msgid "Access the task"
141 141 msgstr "Acessar a Tarefa"
142 142  
143   -#: notifications/templates/notifications/_view.html:52
  143 +#: notifications/templates/notifications/_view.html:55
144 144 msgid "Realize the task"
145 145 msgstr "Realizar a Tarefa"
146 146  
147   -#: notifications/templates/notifications/_view.html:57
  147 +#: notifications/templates/notifications/_view.html:60
148 148 msgid "or"
149 149 msgstr "ou"
150 150  
151   -#: notifications/templates/notifications/_view.html:60
  151 +#: notifications/templates/notifications/_view.html:63
152 152 msgid "Define goal to realization"
153 153 msgstr "Definir meta para realização"
154 154  
155   -#: notifications/templates/notifications/_view.html:62
  155 +#: notifications/templates/notifications/_view.html:65
156 156 msgid "Define new goal"
157 157 msgstr "Definir nova meta"
158 158  
159   -#: notifications/templates/notifications/_view.html:84
  159 +#: notifications/templates/notifications/_view.html:87
160 160 msgid "Save Goal"
161 161 msgstr "Salvar Meta"
162 162  
163   -#: notifications/templates/notifications/_view.html:87
  163 +#: notifications/templates/notifications/_view.html:90
164 164 msgid "Cancel"
165 165 msgstr "Cancelar"
166 166  
167 167 #: notifications/templates/notifications/index.html:19
168   -#: notifications/templates/notifications/subject.html:29
  168 +#: notifications/templates/notifications/subject.html:43
169 169 msgid "This pendencies list is updated every 24 hours. Last update was in:"
170 170 msgstr ""
171 171 "Esta lista de pendências é atualizada a cada 24 horas. A última atualização "
172 172 "ocorreu em:"
173 173  
174 174 #: notifications/templates/notifications/index.html:19
175   -#: notifications/templates/notifications/subject.html:29
  175 +#: notifications/templates/notifications/subject.html:43
176 176 msgid "Not determined"
177 177 msgstr "Não Determinado"
178 178  
... ... @@ -181,12 +181,14 @@ msgid &quot;You got pendencies in the following subjects&quot;
181 181 msgstr "Você possui pendências nos seguintes assuntos"
182 182  
183 183 #: notifications/templates/notifications/index.html:39
184   -#: notifications/templates/notifications/subject.html:32
  184 +#: notifications/templates/notifications/subject.html:50
  185 +#: notifications/templates/notifications/subject.html:58
185 186 msgid "Actual Pendencies"
186 187 msgstr "Pendências Atuais"
187 188  
188 189 #: notifications/templates/notifications/index.html:40
189   -#: notifications/templates/notifications/subject.html:33
  190 +#: notifications/templates/notifications/subject.html:55
  191 +#: notifications/templates/notifications/subject.html:59
190 192 msgid "Notifications History"
191 193 msgstr "Histórico de Notificações"
192 194  
... ... @@ -194,78 +196,91 @@ msgstr &quot;Histórico de Notificações&quot;
194 196 msgid "You do not posses any pendency."
195 197 msgstr "Você não possui nenhuma pendência."
196 198  
197   -#: notifications/templates/notifications/subject.html:23
198   -#: notifications/views.py:204
  199 +#: notifications/templates/notifications/subject.html:25
  200 +#: notifications/views.py:279
199 201 msgid "Pendencies"
200 202 msgstr "Pendências"
201 203  
202   -#: notifications/templates/notifications/subject.html:46
  204 +#: notifications/templates/notifications/subject.html:74
  205 +msgid "The student do not posses any pendency."
  206 +msgstr "O estudante não possui nenhuma pendência."
  207 +
  208 +#: notifications/templates/notifications/subject.html:76
203 209 msgid "You do not posses any pendency in this subject"
204 210 msgstr "Você não possui nenhuma pendência nesse assunto"
205 211  
206   -#: notifications/templatetags/notification_filters.py:27
207   -#: notifications/templatetags/notification_filters.py:29
  212 +#: notifications/templatetags/notification_filters.py:28
  213 +#: notifications/templatetags/notification_filters.py:33
  214 +msgid "The student still did not realize this task"
  215 +msgstr "O estudante ainda não realizou essa tarefa"
  216 +
  217 +#: notifications/templatetags/notification_filters.py:30
  218 +#: notifications/templatetags/notification_filters.py:35
208 219 msgid "You still did not realize this task"
209 220 msgstr "Você ainda não realizou essa tarefa"
210 221  
211   -#: notifications/templatetags/notification_filters.py:31
  222 +#: notifications/templatetags/notification_filters.py:37
212 223 msgid "This task is late"
213 224 msgstr "Essa tarefa está atrasada"
214 225  
215   -#: notifications/templatetags/notification_filters.py:33
  226 +#: notifications/templatetags/notification_filters.py:40
  227 +msgid "The student miss this task"
  228 +msgstr "O estudante perdeu essa tarefa"
  229 +
  230 +#: notifications/templatetags/notification_filters.py:42
216 231 msgid "You miss this task"
217 232 msgstr "Você perdeu essa tarefa"
218 233  
219   -#: notifications/templatetags/notification_filters.py:40
  234 +#: notifications/templatetags/notification_filters.py:49
220 235 msgid "Yes"
221 236 msgstr "Sim"
222 237  
223   -#: notifications/templatetags/notification_filters.py:42
  238 +#: notifications/templatetags/notification_filters.py:51
224 239 msgid "No"
225 240 msgstr "Não"
226 241  
227   -#: notifications/templatetags/notification_filters.py:129
228   -#: notifications/templatetags/notification_filters.py:133
  242 +#: notifications/templatetags/notification_filters.py:154
  243 +#: notifications/templatetags/notification_filters.py:158
229 244 #, python-format
230 245 msgid "Goal defined to task realization: %s"
231 246 msgstr "Meta definida para realização da tarefa: %s"
232 247  
233   -#: notifications/templatetags/notification_filters.py:135
  248 +#: notifications/templatetags/notification_filters.py:160
234 249 #, python-format
235 250 msgid "New goal defined to task realization: %s"
236 251 msgstr "Nova meta definida para realização da tarefa: %s"
237 252  
238   -#: notifications/views.py:69 notifications/views.py:154
  253 +#: notifications/views.py:96 notifications/views.py:223
239 254 #, python-format
240 255 msgid "%s - Pendencies"
241 256 msgstr "%s - Pendências"
242 257  
243   -#: notifications/views.py:294
  258 +#: notifications/views.py:382
244 259 msgid "No goal date received"
245 260 msgstr "Nenhuma data para meta recebida"
246 261  
247   -#: notifications/views.py:301
  262 +#: notifications/views.py:389
248 263 msgid "Could not identify the notification"
249 264 msgstr "Não foi possível identificar a notificação"
250 265  
251   -#: notifications/views.py:308
  266 +#: notifications/views.py:396
252 267 msgid "The goal date should be equal or after today's date"
253 268 msgstr ""
254 269 "A meta de realização da tarefa deve ser uma data igual ou posterior à data "
255 270 "atual"
256 271  
257   -#: notifications/views.py:311
  272 +#: notifications/views.py:399
258 273 msgid "The goal date should be equal or before subject's date"
259 274 msgstr ""
260 275 "A meta de realização da tarefa deve ser uma data igual ou anterior à data "
261 276 "final do assunto"
262 277  
263   -#: notifications/views.py:323
  278 +#: notifications/views.py:411
264 279 #, python-format
265 280 msgid "Your new goal to realize the task %s is %s"
266 281 msgstr "Sua nova meta para realizar a tarefa %s é %s"
267 282  
268   -#: notifications/views.py:325
  283 +#: notifications/views.py:413
269 284 #, python-format
270 285 msgid "Your goal to realize the task %s is %s"
271 286 msgstr "Sua meta para realizar a tarefa %s é %s"
... ...
notifications/templates/notifications/_ajax_history.html
... ... @@ -62,7 +62,7 @@
62 62 <td>{{ notification.task.resource }}</td>
63 63 <td>{{ notification.task.get_action_display }}</td>
64 64 <td>{{ notification.task.end_date|date:"SHORT_DATE_FORMAT"|default:_('Not Informed') }}</td>
65   - <td>{{ notification.level|warning_msg }}</td>
  65 + <td>{{ notification.level|warning_msg:False }}</td>
66 66 <td>{{ notification.viewed|viewed_msg }}</td>
67 67 <td>{{ notification|observation }}</td>
68 68 </tr>
... ...
notifications/templates/notifications/_history.html
1   -{% load i18n notification_filters pagination %}
  1 +{% load i18n notification_filters pagination permissions_tags %}
  2 +
  3 +{% subject_permissions request.user subject as has_subject_permissions %}
2 4  
3 5 <div class="row">
4 6 <div class="col-md-12">
... ... @@ -7,6 +9,7 @@
7 9 </div>
8 10 <div class="col-md-4">
9 11 <form action="" method="GET" class="form-horizontal">
  12 + <input type="hidden" value="{{ student }}" name="selected_student" />
10 13 <div class="form-group">
11 14 <label class="col-md-4 history-control-label control-label">{% trans 'Search' %}:</label>
12 15 <div class="col-md-8">
... ... @@ -18,37 +21,37 @@
18 21 <table class="table table-striped table-bordered">
19 22 <thead>
20 23 <th>
21   - <a href="{{ request|order_href:'creation_date' }}">
  24 + <a href="{{ request|add_student:student|order_href:'creation_date' }}">
22 25 {% trans 'Date' %} <i class="fa fa-fw {{ request|order_icon_class:'creation_date' }} pull-right"></i>
23 26 </a>
24 27 </th>
25 28 <th>
26   - <a href="{{ request|order_href:'resource' }}">
  29 + <a href="{{ request|add_student:student|order_href:'resource' }}">
27 30 {% trans 'Resource' %} <i class="fa fa-fw {{ request|order_icon_class:'resource' }} pull-right"></i>
28 31 </a>
29 32 </th>
30 33 <th>
31   - <a href="{{ request|order_href:'task' }}">
  34 + <a href="{{ request|add_student:student|order_href:'task' }}">
32 35 {% trans 'Task' %} <i class="fa fa-fw {{ request|order_icon_class:'task' }} pull-right"></i>
33 36 </a>
34 37 </th>
35 38 <th>
36   - <a href="{{ request|order_href:'final_date' }}">
  39 + <a href="{{ request|add_student:student|order_href:'final_date' }}">
37 40 {% trans 'Final Date' %} <i class="fa fa-fw {{ request|order_icon_class:'final_date' }} pull-right"></i>
38 41 </a>
39 42 </th>
40 43 <th>
41   - <a href="{{ request|order_href:'notification' }}">
  44 + <a href="{{ request|add_student:student|order_href:'notification' }}">
42 45 {% trans 'Notification' %} <i class="fa fa-fw {{ request|order_icon_class:'notification' }} pull-right"></i>
43 46 </a>
44 47 </th>
45 48 <th>
46   - <a href="{{ request|order_href:'aware' }}">
  49 + <a href="{{ request|add_student:student|order_href:'aware' }}">
47 50 {% trans 'Aware' %} <i class="fa fa-fw {{ request|order_icon_class:'aware' }} pull-right"></i>
48 51 </a>
49 52 </th>
50 53 <th>
51   - <a href="{{ request|order_href:'obs' }}">
  54 + <a href="{{ request|add_student:student|order_href:'obs' }}">
52 55 {% trans 'Observation' %} <i class="fa fa-fw {{ request|order_icon_class:'obs' }} pull-right"></i>
53 56 </a>
54 57 </th>
... ... @@ -61,7 +64,7 @@
61 64 <td>{{ notification.task.resource }}</td>
62 65 <td>{{ notification.task.get_action_display }}</td>
63 66 <td>{{ notification.task.end_date|date:"SHORT_DATE_FORMAT"|default:_('Not Informed') }}</td>
64   - <td>{{ notification.level|warning_msg }}</td>
  67 + <td>{{ notification.level|warning_msg:has_subject_permissions }}</td>
65 68 <td>{{ notification.viewed|viewed_msg }}</td>
66 69 <td>{{ notification|observation }}</td>
67 70 </tr>
... ...
notifications/templates/notifications/_view.html
1   -{% load i18n notification_filters %}
  1 +{% load i18n notification_filters permissions_tags %}
  2 +
  3 +{% subject_permissions request.user subject as has_subject_permissions %}
2 4  
3 5 {% for notification in notifications %}
4 6 <div class="row">
... ... @@ -40,56 +42,58 @@
40 42 <div class="col-md-6">
41 43 <div class="alert {{ notification.level|warning_class }}">
42 44 <i class="fa fa-exclamation-triangle"></i>
43   - <span>{{ notification.level|warning_msg }}</span>
  45 + <span>{{ notification.level|warning_msg:has_subject_permissions }}</span>
44 46 </div>
45 47 </div>
46 48 </div>
47   - <div class="row text-center">
48   - <a href="{{ notification.task.resource.access_link }}" class="btn btn-success btn-raised" {% if notification.task.resource.show_window %}target="_blank"{% endif %}>
49   - {% if notification.level == 4 %}
50   - {% trans 'Access the task' %}
51   - {% else %}
52   - {% trans 'Realize the task' %}
53   - {% endif %}
54   - </a>
55   -
56   - {% if notification.level < 3 %}
57   - <button class="btn btn-default no_button">{% trans 'or' %}</button>
58   - <button class="btn btn-default btn-raised" data-toggle="popover" data-placement="right">
59   - {% if notification.level == 1 %}
60   - {% trans 'Define goal to realization' %}
  49 + {% if not has_subject_permissions %}
  50 + <div class="row text-center">
  51 + <a href="{{ notification.task.resource.access_link }}" class="btn btn-success btn-raised" {% if notification.task.resource.show_window %}target="_blank"{% endif %}>
  52 + {% if notification.level == 4 %}
  53 + {% trans 'Access the task' %}
61 54 {% else %}
62   - {% trans 'Define new goal' %}
  55 + {% trans 'Realize the task' %}
63 56 {% endif %}
64   - </button>
  57 + </a>
65 58  
66   - <div class="popover">
67   - <div class="popover-content">
68   - <form action="{% url 'notifications:set_goal' %}" role="form" method="post">
69   - {% csrf_token %}
70   - <div style="overflow:hidden;">
71   - <div class="form-group">
72   - <div class="row">
73   - <div class="col-md-12">
74   - <div class="datetimepicker"></div>
75   - <input type="hidden" name="id" value="{{ notification.id }}">
76   - </div>
77   - </div>
78   - </div>
79   - </div>
80   - </form>
81   - </div>
82   - <div class="popover-footer">
83   - <button type="button" class="btn btn-raised btn-sm btn-success save pull-left">
84   - {% trans 'Save Goal' %}
85   - </button>
86   - <button type="button" class="btn btn-default btn-sm btn-raised cancel pull-right">
87   - {% trans 'Cancel' %}
88   - </button>
89   - </div>
90   - </div>
91   - {% endif %}
92   - </div>
  59 + {% if notification.level < 3 %}
  60 + <button class="btn btn-default no_button">{% trans 'or' %}</button>
  61 + <button class="btn btn-default btn-raised" data-toggle="popover" data-placement="right">
  62 + {% if notification.level == 1 %}
  63 + {% trans 'Define goal to realization' %}
  64 + {% else %}
  65 + {% trans 'Define new goal' %}
  66 + {% endif %}
  67 + </button>
  68 +
  69 + <div class="popover">
  70 + <div class="popover-content">
  71 + <form action="{% url 'notifications:set_goal' %}" role="form" method="post">
  72 + {% csrf_token %}
  73 + <div style="overflow:hidden;">
  74 + <div class="form-group">
  75 + <div class="row">
  76 + <div class="col-md-12">
  77 + <div class="datetimepicker"></div>
  78 + <input type="hidden" name="id" value="{{ notification.id }}">
  79 + </div>
  80 + </div>
  81 + </div>
  82 + </div>
  83 + </form>
  84 + </div>
  85 + <div class="popover-footer">
  86 + <button type="button" class="btn btn-raised btn-sm btn-success save pull-left">
  87 + {% trans 'Save Goal' %}
  88 + </button>
  89 + <button type="button" class="btn btn-default btn-sm btn-raised cancel pull-right">
  90 + {% trans 'Cancel' %}
  91 + </button>
  92 + </div>
  93 + </div>
  94 + {% endif %}
  95 + </div>
  96 + {% endif %}
93 97 </div>
94 98 </div>
95 99 </div>
... ...
notifications/templates/notifications/index.html
... ... @@ -67,7 +67,7 @@
67 67 {% else %}
68 68 <div class="text-center no-subjects">
69 69 <i class="fa fa-exclamation-triangle"></i>
70   - <h4>{% trans 'You do not posses any pendency.' %}</h4>
  70 + <h4>{% trans 'You do not posses any pendency.' %}</h4>
71 71 </div>
72 72 {% endif %}
73 73  
... ...
notifications/templates/notifications/subject.html
... ... @@ -10,6 +10,8 @@
10 10 {% endblock %}
11 11  
12 12 {% block content %}
  13 + {% subject_permissions request.user subject as has_subject_permissions %}
  14 +
13 15 {% if subject.visible %}
14 16 <div class="panel panel-info subject-panel">
15 17 <div class="panel-heading">
... ... @@ -26,11 +28,36 @@
26 28 </div>
27 29 </div>
28 30 <div id="{{subject.slug}}" class="panel-collapse in collapse pendencies-content subject-related-panel">
  31 + {% if has_subject_permissions %}
  32 + <form id="student_goals" action="" method="POST">
  33 + {% csrf_token %}
  34 + <select name="selected_student" onchange="$('#student_goals').submit();">
  35 + {% for stu in sub_students %}
  36 + <option value="{{ stu.email }}" {% if stu.email == student %}selected{% endif %}>{{ stu }}</option>
  37 + {% endfor %}
  38 + </select>
  39 + </form>
  40 + <br clear="all" />
  41 + {% endif %}
  42 +
29 43 <h5>{% trans 'This pendencies list is updated every 24 hours. Last update was in:' %} {{ last_update|default:_('Not determined') }}</h5>
30 44 <div id="core-subjects-options-div">
31 45 <ul class="core-subjects-options">
32   - <a href="{% url 'notifications:view' subject.slug %}"><li {% if not history %} class="active" {% endif %}>{% trans "Actual Pendencies" %} ({{ total }})</li></a>
33   - <a href="{% url 'notifications:history' subject.slug %}"><li {% if history %} class="active" {% endif %}>{% trans "Notifications History" %}</li></a>
  46 + {% if has_subject_permissions %}
  47 + <form id="student_pend" action="{% url 'notifications:view' subject.slug %}" method="POST">
  48 + {% csrf_token %}
  49 + <input type="hidden" value="{{ student }}" name="selected_student" />
  50 + <a onclick="$('#student_pend').submit();" style="cursor:pointer"><li {% if not history %} class="active" {% endif %}>{% trans "Actual Pendencies" %} ({{ total }})</li></a>
  51 + </form>
  52 + <form id="student_history" action="{% url 'notifications:history' subject.slug %}" method="POST">
  53 + {% csrf_token %}
  54 + <input type="hidden" value="{{ student }}" name="selected_student" />
  55 + <a onclick="$('#student_history').submit();" style="cursor:pointer"><li {% if history %} class="active" {% endif %}>{% trans "Notifications History" %}</li></a>
  56 + </form>
  57 + {% else %}
  58 + <a href="{% url 'notifications:view' subject.slug %}"><li {% if not history %} class="active" {% endif %}>{% trans "Actual Pendencies" %} ({{ total }})</li></a>
  59 + <a href="{% url 'notifications:history' subject.slug %}"><li {% if history %} class="active" {% endif %}>{% trans "Notifications History" %}</li></a>
  60 + {% endif %}
34 61 </ul>
35 62 </div>
36 63  
... ... @@ -43,7 +70,11 @@
43 70 {% else %}
44 71 <div class="text-center no-subjects">
45 72 <i class="fa fa-exclamation-triangle"></i>
46   - <h4>{% trans 'You do not posses any pendency in this subject' %}</h4>
  73 + {% if has_subject_permissions %}
  74 + <h4>{% trans 'The student do not posses any pendency.' %}</h4>
  75 + {% else %}
  76 + <h4>{% trans 'You do not posses any pendency in this subject' %}</h4>
  77 + {% endif %}
47 78 </div>
48 79 {% endif %}
49 80 {% else %}
... ... @@ -58,4 +89,10 @@
58 89 metaFunctions();
59 90 });
60 91 </script>
  92 +{% endblock %}
  93 +
  94 +{% block addtional_scripts %}
  95 + <script type="text/javascript">
  96 + sessionSecurity.confirmFormDiscard = undefined;
  97 + </script>
61 98 {% endblock %}
62 99 \ No newline at end of file
... ...
notifications/templatetags/notification_filters.py
... ... @@ -22,15 +22,24 @@ def warning_class(level):
22 22 return class_name
23 23  
24 24 @register.filter(name = 'warning_msg')
25   -def warning_msg(level):
  25 +def warning_msg(level, isnt_student):
26 26 if level == 1:
27   - msg = _('You still did not realize this task')
  27 + if isnt_student:
  28 + msg = _('The student still did not realize this task')
  29 + else:
  30 + msg = _('You still did not realize this task')
28 31 elif level == 2:
29   - msg = _('You still did not realize this task')
  32 + if isnt_student:
  33 + msg = _('The student still did not realize this task')
  34 + else:
  35 + msg = _('You still did not realize this task')
30 36 elif level == 3:
31 37 msg = _('This task is late')
32 38 else:
33   - msg = _('You miss this task')
  39 + if isnt_student:
  40 + msg = _('The student miss this task')
  41 + else:
  42 + msg = _('You miss this task')
34 43  
35 44 return msg
36 45  
... ... @@ -85,7 +94,7 @@ def order_href(request, column):
85 94 if 'order_by' in getvars:
86 95 order = getvars['order_by']
87 96 del getvars['order_by']
88   -
  97 +
89 98 if not order:
90 99 if column == "creation_date":
91 100 order_href = "creation_date"
... ... @@ -93,12 +102,28 @@ def order_href(request, column):
93 102 if column in order:
94 103 if "-" in order:
95 104 order_href = column
96   -
  105 +
97 106 if len(getvars) > 0:
98 107 params = '&%s' % getvars.urlencode()
99 108  
100 109 return "?order_by=" + order_href + params
101 110  
  111 +@register.filter(name = 'add_student')
  112 +def add_student(request, student):
  113 + getvars = request.GET.copy()
  114 + params = ""
  115 +
  116 + if not student is None:
  117 + if not student == "":
  118 + if 'selected_student' in getvars:
  119 + del getvars['selected_student']
  120 +
  121 + getvars['selected_student'] = student
  122 +
  123 + request.GET = getvars
  124 +
  125 + return request
  126 +
102 127 @register.filter(name = 'order_ajax')
103 128 def order_ajax(request, column):
104 129 getvars = request.GET.copy()
... ... @@ -109,7 +134,7 @@ def order_ajax(request, column):
109 134 if 'order_by' in getvars:
110 135 order = getvars['order_by']
111 136 del getvars['order_by']
112   -
  137 +
113 138 if not order:
114 139 if column == "creation_date":
115 140 order_href = "creation_date"
... ... @@ -117,7 +142,7 @@ def order_ajax(request, column):
117 142 if column in order:
118 143 if "-" in order:
119 144 order_href = column
120   -
  145 +
121 146 return order_href
122 147  
123 148 @register.filter(name = 'observation')
... ...
notifications/views.py
... ... @@ -12,10 +12,11 @@ from dateutil import parser
12 12 from datetime import datetime
13 13 from django.utils import formats, timezone
14 14  
15   -from amadeus.permissions import has_subject_view_permissions, has_category_permission
  15 +from amadeus.permissions import has_subject_view_permissions, has_category_permission, has_subject_permissions
16 16  
17 17 from subjects.models import Subject
18 18 from categories.models import Category
  19 +from users.models import User
19 20  
20 21 from log.models import Log
21 22 from log.mixins import LogMixin
... ... @@ -39,6 +40,8 @@ class SubjectNotifications(LoginRequiredMixin, LogMixin, generic.ListView):
39 40 paginate_by = 10
40 41 total = 0
41 42  
  43 + students = None
  44 +
42 45 def dispatch(self, request, *args, **kwargs):
43 46 slug = self.kwargs.get('slug', '')
44 47 subject = get_object_or_404(Subject, slug = slug)
... ... @@ -52,14 +55,38 @@ class SubjectNotifications(LoginRequiredMixin, LogMixin, generic.ListView):
52 55 slug = self.kwargs.get('slug', '')
53 56 subject = get_object_or_404(Subject, slug = slug)
54 57  
55   - notifications = Notification.objects.filter(user = self.request.user, task__resource__topic__subject = subject, creation_date = datetime.now()).order_by("task__limit_date", "task__end_date")
56   -
57   - notifications.update(viewed = True)
  58 + if has_subject_permissions(self.request.user, subject):
  59 + self.students = User.objects.filter(subject_student = subject).order_by('social_name', 'username')
58 60  
  61 + notifications = Notification.objects.filter(user = self.students.first(), task__resource__topic__subject = subject, creation_date = datetime.now()).order_by("task__limit_date", "task__end_date")
  62 + else:
  63 + notifications = Notification.objects.filter(user = self.request.user, task__resource__topic__subject = subject, creation_date = datetime.now()).order_by("task__limit_date", "task__end_date")
  64 + notifications.update(viewed = True)
  65 +
59 66 self.total = notifications.count()
60 67  
61 68 return notifications
62 69  
  70 + def post(self, request, *args, **kwargs):
  71 + slug = self.kwargs.get('slug', '')
  72 + subject = get_object_or_404(Subject, slug = slug)
  73 +
  74 + user = request.POST.get('selected_student', None)
  75 +
  76 + if has_subject_permissions(request.user, subject):
  77 + self.students = User.objects.filter(subject_student = subject).order_by('social_name', 'username')
  78 +
  79 + if not user is None:
  80 + self.object_list = Notification.objects.filter(user__email = user, task__resource__topic__subject = subject, creation_date = datetime.now()).order_by("task__limit_date", "task__end_date")
  81 + else:
  82 + self.object_list = Notification.objects.filter(user = self.request.user, task__resource__topic__subject = subject, creation_date = datetime.now()).order_by("task__limit_date", "task__end_date")
  83 + else:
  84 + self.object_list = Notification.objects.filter(user = self.request.user, task__resource__topic__subject = subject, creation_date = datetime.now()).order_by("task__limit_date", "task__end_date")
  85 +
  86 + self.total = self.object_list.count()
  87 +
  88 + return self.render_to_response(self.get_context_data())
  89 +
63 90 def get_context_data(self, **kwargs):
64 91 context = super(SubjectNotifications, self).get_context_data(**kwargs)
65 92  
... ... @@ -70,6 +97,12 @@ class SubjectNotifications(LoginRequiredMixin, LogMixin, generic.ListView):
70 97 context['subject'] = subject
71 98 context['total'] = self.total
72 99  
  100 + if not self.students is None:
  101 + context['sub_students'] = self.students
  102 + context['student'] = self.request.POST.get('selected_student', self.students.first().email)
  103 + else:
  104 + context['student'] = None
  105 +
73 106 update_pendencies = Log.objects.filter(action = "cron", component = "notifications").order_by('-datetime')
74 107  
75 108 if update_pendencies.count() > 0:
... ... @@ -104,6 +137,8 @@ class SubjectHistory(LoginRequiredMixin, LogMixin, generic.ListView):
104 137 total = 0
105 138 num_rows = 0
106 139  
  140 + students = None
  141 +
107 142 def dispatch(self, request, *args, **kwargs):
108 143 slug = self.kwargs.get('slug', '')
109 144 subject = get_object_or_404(Subject, slug = slug)
... ... @@ -120,7 +155,17 @@ class SubjectHistory(LoginRequiredMixin, LogMixin, generic.ListView):
120 155 order = get_order_by(self.request.GET.get("order_by", None))
121 156 search = self.request.GET.get("search", None)
122 157  
123   - notifications = Notification.objects.filter(user = self.request.user, task__resource__topic__subject = subject).order_by(*order)
  158 + if has_subject_permissions(self.request.user, subject):
  159 + user = self.request.GET.get("selected_student", None)
  160 +
  161 + self.students = User.objects.filter(subject_student = subject).order_by('social_name', 'username')
  162 +
  163 + if not user is None:
  164 + notifications = Notification.objects.filter(user__email = user, task__resource__topic__subject = subject).order_by(*order)
  165 + else:
  166 + notifications = Notification.objects.filter(user = self.students.first(), task__resource__topic__subject = subject).order_by(*order)
  167 + else:
  168 + notifications = Notification.objects.filter(user = self.request.user, task__resource__topic__subject = subject).order_by(*order)
124 169  
125 170 self.total = notifications.filter(creation_date = datetime.now()).count()
126 171  
... ... @@ -145,6 +190,30 @@ class SubjectHistory(LoginRequiredMixin, LogMixin, generic.ListView):
145 190  
146 191 return notifications
147 192  
  193 + def post(self, request, *args, **kwargs):
  194 + slug = self.kwargs.get('slug', '')
  195 + subject = get_object_or_404(Subject, slug = slug)
  196 +
  197 + order = get_order_by(self.request.POST.get("order_by", None))
  198 +
  199 + user = request.POST.get('selected_student', None)
  200 +
  201 + if has_subject_permissions(request.user, subject):
  202 + self.students = User.objects.filter(subject_student = subject).order_by('social_name', 'username')
  203 +
  204 + if not user is None:
  205 + self.object_list = Notification.objects.filter(user__email = user, task__resource__topic__subject = subject).order_by(*order)
  206 + else:
  207 + self.object_list = Notification.objects.filter(user = self.request.user, task__resource__topic__subject = subject).order_by(*order)
  208 + else:
  209 + self.object_list = Notification.objects.filter(user = self.request.user, task__resource__topic__subject = subject).order_by(*order)
  210 +
  211 + self.total = self.object_list.filter(creation_date = datetime.now()).count()
  212 +
  213 + self.num_rows = self.object_list.count()
  214 +
  215 + return self.render_to_response(self.get_context_data())
  216 +
148 217 def get_context_data(self, **kwargs):
149 218 context = super(SubjectHistory, self).get_context_data(**kwargs)
150 219  
... ... @@ -158,6 +227,12 @@ class SubjectHistory(LoginRequiredMixin, LogMixin, generic.ListView):
158 227 context['rows'] = self.num_rows
159 228 context['searched'] = self.request.GET.get("search", "")
160 229  
  230 + if not self.students is None:
  231 + context['sub_students'] = self.students
  232 + context['student'] = self.request.POST.get('selected_student', self.request.GET.get('selected_student', self.students.first().email))
  233 + else:
  234 + context['student'] = None
  235 +
161 236 self.log_context['subject_id'] = subject.id
162 237 self.log_context['subject_name'] = subject.name
163 238 self.log_context['subject_slug'] = subject.slug
... ... @@ -236,6 +311,17 @@ class AjaxNotifications(LoginRequiredMixin, generic.ListView):
236 311  
237 312 return notifications
238 313  
  314 + def get_context_data(self, **kwargs):
  315 + context = super(AjaxNotifications, self).get_context_data(**kwargs)
  316 +
  317 + subject_id = self.kwargs.get('id', '')
  318 + subject = Subject.objects.get(id = subject_id)
  319 +
  320 + context['subject_id'] = subject_id
  321 + context['subject'] = subject
  322 +
  323 + return context
  324 +
239 325 class AjaxHistory(LoginRequiredMixin, generic.ListView):
240 326 login_url = reverse_lazy("users:login")
241 327 redirect_field_name = 'next'
... ... @@ -276,8 +362,10 @@ class AjaxHistory(LoginRequiredMixin, generic.ListView):
276 362 context = super(AjaxHistory, self).get_context_data(**kwargs)
277 363  
278 364 subject_id = self.kwargs.get('id', '')
  365 + subject = Subject.objects.get(id = subject_id)
279 366  
280 367 context['subject_id'] = subject_id
  368 + context['subject'] = subject
281 369 context['rows'] = self.num_rows
282 370 context['searched'] = self.request.GET.get("search", "")
283 371 context['order_by'] = self.request.GET.get("order_by", "")
... ...
pdf_file/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
pendencies/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
reports/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
security/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
students_group/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
subjects/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
themes/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
topics/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
users/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
webconference/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
webpage/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
youtube_video/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-16 19:24-0300\n"
  11 +"POT-Creation-Date: 2017-08-22 06:51-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...