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