Commit 54304f2c28c35416cd30d37219c64d6aaf30096c

Authored by Jailson Dias
1 parent e1746435

resolvendo problemas com traduções nos relatorios de webpage

webpage/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-04-28 20:41-0300\n" 11 +"POT-Creation-Date: 2017-05-05 17:14-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,26 +18,30 @@ msgstr &quot;&quot; @@ -18,26 +18,30 @@ 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 -#: forms.py:25 21 +#: forms.py:27
22 msgid "Tags" 22 msgid "Tags"
23 msgstr "Tags" 23 msgstr "Tags"
24 24
25 -#: forms.py:31 25 +#: forms.py:33
26 msgid "Webpage name" 26 msgid "Webpage name"
27 msgstr "Nome da Página Web" 27 msgstr "Nome da Página Web"
28 28
29 -#: forms.py:32 29 +#: forms.py:34
30 msgid "Webpage content" 30 msgid "Webpage content"
31 msgstr "Conteúdo da Página Web" 31 msgstr "Conteúdo da Página Web"
32 32
33 -#: forms.py:53 33 +#: forms.py:55
34 msgid "This subject already has a webpage with this name" 34 msgid "This subject already has a webpage with this name"
35 msgstr "Esse assunto já possui uma Página Web com esse nome" 35 msgstr "Esse assunto já possui uma Página Web com esse nome"
36 36
37 -#: forms.py:64 37 +#: forms.py:66 forms.py:112
38 msgid "This field is required." 38 msgid "This field is required."
39 msgstr "Esse campo é obrigatório." 39 msgstr "Esse campo é obrigatório."
40 40
  41 +#: forms.py:124
  42 +msgid "The image is too large. It should have less than 5MB."
  43 +msgstr "A imagem é muito grande. Deve ser menor do que 5MB"
  44 +
41 #: models.py:8 45 #: models.py:8
42 msgid "Webpage Content" 46 msgid "Webpage Content"
43 msgstr "Conteúdo da Página Web" 47 msgstr "Conteúdo da Página Web"
@@ -82,59 +86,87 @@ msgstr &quot;Atribuir grupos de estudo à Página Web&quot; @@ -82,59 +86,87 @@ msgstr &quot;Atribuir grupos de estudo à Página Web&quot;
82 msgid "Save" 86 msgid "Save"
83 msgstr "Salvar" 87 msgstr "Salvar"
84 88
85 -#: templates/webpages/create.html:20 views.py:221 89 +#: templates/webpages/create.html:20 views.py:227
86 msgid "Create Webpage" 90 msgid "Create Webpage"
87 msgstr "Criar Página Web" 91 msgstr "Criar Página Web"
88 92
89 -#: templates/webpages/relatorios.html:16 templates/webpages/relatorios.html:30  
90 -#: templates/webpages/relatorios.html:37 93 +#: templates/webpages/relatorios.html:17 templates/webpages/relatorios.html:37
91 msgid "User" 94 msgid "User"
92 msgstr "Usuário" 95 msgstr "Usuário"
93 96
94 -#: templates/webpages/relatorios.html:16 templates/webpages/relatorios.html:30  
95 -#: templates/webpages/relatorios.html:37 97 +#: templates/webpages/relatorios.html:17 templates/webpages/relatorios.html:37
96 msgid "Group" 98 msgid "Group"
97 msgstr "Grupo" 99 msgstr "Grupo"
98 100
99 -#: templates/webpages/relatorios.html:16 templates/webpages/relatorios.html:30 101 +#: templates/webpages/relatorios.html:17
100 msgid "Action" 102 msgid "Action"
101 msgstr "Ação" 103 msgstr "Ação"
102 104
103 -#: templates/webpages/relatorios.html:16 templates/webpages/relatorios.html:30 105 +#: templates/webpages/relatorios.html:17
104 msgid "Date of Action" 106 msgid "Date of Action"
105 msgstr "Data da ação" 107 msgstr "Data da ação"
106 108
107 -#: templates/webpages/relatorios.html:135  
108 -#: templates/webpages/relatorios.html:155 109 +#: templates/webpages/relatorios.html:37
  110 +msgid "Send message"
  111 +msgstr "Enviar Mensagem"
  112 +
  113 +#: templates/webpages/relatorios.html:37
  114 +#| msgid "Action"
  115 +msgid "Action don't realized"
  116 +msgstr "Ação não realizada"
  117 +
  118 +#: templates/webpages/relatorios.html:151
  119 +#: templates/webpages/relatorios.html:171
109 msgid "Reports" 120 msgid "Reports"
110 msgstr "Relatórios" 121 msgstr "Relatórios"
111 122
112 -#: templates/webpages/relatorios.html:162 123 +#: templates/webpages/relatorios.html:178
113 msgid "Report of the resource " 124 msgid "Report of the resource "
114 msgstr "Relatórios do recurso " 125 msgstr "Relatórios do recurso "
115 126
116 -#: templates/webpages/relatorios.html:165 127 +#: templates/webpages/relatorios.html:187
117 msgid "Select the period: " 128 msgid "Select the period: "
118 msgstr "Selecione o período: " 129 msgstr "Selecione o período: "
119 130
120 -#: templates/webpages/relatorios.html:179 131 +#: templates/webpages/relatorios.html:196
121 msgid "Search" 132 msgid "Search"
122 msgstr "Pesquisar" 133 msgstr "Pesquisar"
123 134
124 -#: templates/webpages/relatorios.html:201 135 +#: templates/webpages/relatorios.html:220
125 msgid "Filter: " 136 msgid "Filter: "
126 msgstr "Filtro: " 137 msgstr "Filtro: "
127 138
  139 +#: templates/webpages/relatorios.html:244
  140 +#: templates/webpages/relatorios.html:329
  141 +msgid "record(s)"
  142 +msgstr "Relatório(s)"
  143 +
  144 +#: templates/webpages/send_message.html:38
  145 +msgid "Click or drop the picture here"
  146 +msgstr "Clique ou arraste a imagem aqui"
  147 +
  148 +#: templates/webpages/send_message.html:40
  149 +msgid "The picture could not exceed 5MB."
  150 +msgstr "A imagem não pode exceder 5MB."
  151 +
  152 +#: templates/webpages/send_message.html:62
  153 +msgid "Close"
  154 +msgstr "Fechar"
  155 +
  156 +#: templates/webpages/send_message.html:63
  157 +msgid "Send"
  158 +msgstr "Enviar"
  159 +
128 #: templates/webpages/update.html:20 160 #: templates/webpages/update.html:20
129 msgid "Edit: " 161 msgid "Edit: "
130 msgstr "Editar: " 162 msgstr "Editar: "
131 163
132 -#: views.py:148 views.py:161 views.py:279 views.py:281 views.py:297  
133 -#: views.py:299 164 +#: views.py:155 views.py:168 views.py:285 views.py:287 views.py:303
  165 +#: views.py:305
134 msgid "Visualize" 166 msgid "Visualize"
135 msgstr "Visualizar" 167 msgstr "Visualizar"
136 168
137 -#: views.py:232 169 +#: views.py:238
138 #, python-format 170 #, python-format
139 msgid "" 171 msgid ""
140 "The Webpage \"%s\" was added to the Topic \"%s\" of the virtual environment " 172 "The Webpage \"%s\" was added to the Topic \"%s\" of the virtual environment "
@@ -143,50 +175,59 @@ msgstr &quot;&quot; @@ -143,50 +175,59 @@ msgstr &quot;&quot;
143 "A Página Web \"%s\" foi adicionado ao tópico \"%s\" do ambiente virtual \"%s" 175 "A Página Web \"%s\" foi adicionado ao tópico \"%s\" do ambiente virtual \"%s"
144 "\" com sucesso!" 176 "\" com sucesso!"
145 177
146 -#: views.py:343 178 +#: views.py:349
147 msgid "Update Webpage" 179 msgid "Update Webpage"
148 msgstr "Atualizar Página Web" 180 msgstr "Atualizar Página Web"
149 181
150 -#: views.py:354 182 +#: views.py:360
151 #, python-format 183 #, python-format
152 msgid "The Webpage \"%s\" was updated successfully!" 184 msgid "The Webpage \"%s\" was updated successfully!"
153 msgstr "A Página Web \"%s\" foi atualizada com sucesso!" 185 msgstr "A Página Web \"%s\" foi atualizada com sucesso!"
154 186
155 -#: views.py:390 187 +#: views.py:396
156 #, python-format 188 #, python-format
157 msgid "" 189 msgid ""
158 "The webpage \"%s\" was removed successfully from virtual environment \"%s\"!" 190 "The webpage \"%s\" was removed successfully from virtual environment \"%s\"!"
159 msgstr "" 191 msgstr ""
160 "A Página Web \"%s\" foi removida do ambiente virtual \"%s\" com sucesso!" 192 "A Página Web \"%s\" foi removida do ambiente virtual \"%s\" com sucesso!"
161 193
162 -#: views.py:460 194 +#: views.py:455
163 msgid "Webpage Reports" 195 msgid "Webpage Reports"
164 msgstr "Nome da Página Web" 196 msgstr "Nome da Página Web"
165 197
166 -#: views.py:478  
167 -msgid "Users who viewed"  
168 -msgstr "Usuários que visualizaram" 198 +#: views.py:474
  199 +msgid "Realized"
  200 +msgstr "Realizado"
169 201
170 -#: views.py:478  
171 -msgid "Users who did not viewed"  
172 -msgstr "Usuários que não visualizaram" 202 +#: views.py:474
  203 +msgid "Unrealized"
  204 +msgstr "Não Realizado"
173 205
174 -#: views.py:478 206 +#: views.py:474
175 msgid "Historic" 207 msgid "Historic"
176 msgstr "Histórico" 208 msgstr "Histórico"
177 209
178 -#: views.py:515  
179 -msgid "Webpage"  
180 -msgstr "Nome da Página Web"  
181 -  
182 -#: views.py:516 210 +#: views.py:492 views.py:501
183 msgid "View" 211 msgid "View"
184 msgstr "Visualizar" 212 msgstr "Visualizar"
185 213
186 -#: views.py:520  
187 -msgid "Students viewing the webpage"  
188 -msgstr "Estudantes que visualizaram a webpage" 214 +#: views.py:500
  215 +msgid "Webpage"
  216 +msgstr "Nome da Página Web"
  217 +
  218 +#: views.py:505
  219 +msgid "Actions about resource"
  220 +msgstr "Ações sobre o recurso"
189 221
190 -#: views.py:521 222 +#: views.py:506
191 msgid "Quantity" 223 msgid "Quantity"
192 msgstr "Quantidade" 224 msgstr "Quantidade"
  225 +
  226 +#~ msgid "Users who viewed"
  227 +#~ msgstr "Usuários que visualizaram"
  228 +
  229 +#~ msgid "Users who did not viewed"
  230 +#~ msgstr "Usuários que não visualizaram"
  231 +
  232 +#~ msgid "Students viewing the webpage"
  233 +#~ msgstr "Estudantes que visualizaram a webpage"
webpage/templates/webpages/relatorios.html
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 array_n_did.push([input,"{{data_json.1}}","{{data_json.2}}","{{data_json.3}}"]); 34 array_n_did.push([input,"{{data_json.1}}","{{data_json.2}}","{{data_json.3}}"]);
35 {% endfor%} 35 {% endfor%}
36 var json_n_did = {"data":array_n_did}; 36 var json_n_did = {"data":array_n_did};
37 - var column_n_did = [{"string":'<a href="javascript:void(0);" onclick="return openmodal();"> {% trans "Send message" %}</a>'},{"string":'{% trans "User" %}'},{"string":'{% trans "Group" %}'},{"string":"Action don't realized"}]; 37 + var column_n_did = [{"string":'<a href="javascript:void(0);" onclick="return openmodal();"> {% trans "Send message" %}</a>'},{"string":'{% trans "User" %}'},{"string":'{% trans "Group" %}'},{"string":"{% trans "Action don't realized" %}"}];
38 </script> 38 </script>
39 39
40 40
@@ -74,6 +74,7 @@ @@ -74,6 +74,7 @@
74 json_n_did["data"][i][2],json_n_did["data"][i][3]]); 74 json_n_did["data"][i][2],json_n_did["data"][i][3]]);
75 } 75 }
76 searcher(col, tabela_atual,true); 76 searcher(col, tabela_atual,true);
  77 +
77 } else if (col == "{{did_table}}"){ 78 } else if (col == "{{did_table}}"){
78 tabela_atual = true; 79 tabela_atual = true;
79 search = []; 80 search = [];
@@ -92,6 +93,7 @@ @@ -92,6 +93,7 @@
92 chart.draw(data, options); 93 chart.draw(data, options);
93 94
94 } 95 }
  96 +
95 var sortAscending = {0:false,1:false,2:false,3:false}; 97 var sortAscending = {0:false,1:false,2:false,3:false};
96 function drawTable(columns = column_history,rows = pagination(json_history["data"],1),isdate = true,columndate = 3) { 98 function drawTable(columns = column_history,rows = pagination(json_history["data"],1),isdate = true,columndate = 3) {
97 var data_table = new google.visualization.DataTable(); 99 var data_table = new google.visualization.DataTable();
@@ -197,6 +199,7 @@ @@ -197,6 +199,7 @@
197 <ul> 199 <ul>
198 </div> 200 </div>
199 </div> 201 </div>
  202 +
200 <div class="row"> 203 <div class="row">
201 <div class="col-md-10 col-md-offset-1"> 204 <div class="col-md-10 col-md-offset-1">
202 <div id="chart_div" style="height: 500px; margin-top: -50px;"></div> 205 <div id="chart_div" style="height: 500px; margin-top: -50px;"></div>
@@ -376,8 +379,6 @@ @@ -376,8 +379,6 @@
376 .appendTo('#text_chat_form'); 379 .appendTo('#text_chat_form');
377 380
378 var formData = new FormData($('#text_chat_form').get(0)); 381 var formData = new FormData($('#text_chat_form').get(0));
379 - console.log("formData");  
380 - console.log(formData);  
381 $.ajax({ 382 $.ajax({
382 url: "{% url 'webpages:send_message' webpage.slug %}", 383 url: "{% url 'webpages:send_message' webpage.slug %}",
383 type: "POST", 384 type: "POST",
@@ -392,7 +393,6 @@ @@ -392,7 +393,6 @@
392 $( "#modal-message" ).empty(); 393 $( "#modal-message" ).empty();
393 $(".modal-backdrop.fade.in").remove(); 394 $(".modal-backdrop.fade.in").remove();
394 } else { 395 } else {
395 - console.log("teste");  
396 $( "#modal-message" ).empty(); 396 $( "#modal-message" ).empty();
397 $(".modal-backdrop.fade.in").remove(); 397 $(".modal-backdrop.fade.in").remove();
398 $( "#modal-message" ).append( data ); 398 $( "#modal-message" ).append( data );
@@ -401,7 +401,6 @@ @@ -401,7 +401,6 @@
401 }, 401 },
402 error: function(data){ 402 error: function(data){
403 console.log("erro"); 403 console.log("erro");
404 - console.log(data);  
405 } 404 }
406 }); 405 });
407 } 406 }
webpage/views.py
@@ -196,9 +196,6 @@ class CreateView(LoginRequiredMixin, LogMixin, generic.edit.CreateView): @@ -196,9 +196,6 @@ class CreateView(LoginRequiredMixin, LogMixin, generic.edit.CreateView):
196 if not self.object.topic.visible and not self.object.topic.repository: 196 if not self.object.topic.visible and not self.object.topic.repository:
197 self.object.visible = False 197 self.object.visible = False
198 198
199 -  
200 - # if form.cleaned_data["all_students"]:  
201 - # self.object.students.add(*self.object.topic.subject.students.all())  
202 self.object.save() 199 self.object.save()
203 200
204 pend_form = pendencies_form.save(commit = False) 201 pend_form = pendencies_form.save(commit = False)
@@ -416,17 +413,6 @@ class DeleteView(LoginRequiredMixin, LogMixin, generic.DeleteView): @@ -416,17 +413,6 @@ class DeleteView(LoginRequiredMixin, LogMixin, generic.DeleteView):
416 return reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug}) 413 return reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug})
417 414
418 415
419 -def get_chart(request,slug):  
420 - webpage = get_object_or_404(Webpage, slug=slug)  
421 - alunos = webpage.students.all()  
422 - visualizou = Log.objects.filter(context__contains={'webpage_id':webpage.id},resource="webpage",action="view",user_email__in=(aluno.email for aluno in alunos)).distinct("user_email")  
423 - re = []  
424 - c_visualizou = visualizou.count()  
425 - re.append(["Página Web","Fez","Não fez"])  
426 - re.append(["Visualizar",c_visualizou, alunos.count() - c_visualizou])  
427 - return JsonResponse({"dados":re})  
428 -  
429 -  
430 class StatisticsView(LoginRequiredMixin, LogMixin, generic.DetailView): 416 class StatisticsView(LoginRequiredMixin, LogMixin, generic.DetailView):
431 log_component = 'resources' 417 log_component = 'resources'
432 log_action = 'view_statistics' 418 log_action = 'view_statistics'
@@ -566,15 +552,3 @@ class SendMessage(LoginRequiredMixin, LogMixin, generic.edit.FormView): @@ -566,15 +552,3 @@ class SendMessage(LoginRequiredMixin, LogMixin, generic.edit.FormView):
566 return context 552 return context
567 553
568 554
569 -def sendMessage(request, slug):  
570 - message = request.GET.get('message','')  
571 - users = request.GET.getlist('users[]','')  
572 - user = request.user  
573 - subject = get_object_or_404(Subject,slug = slug)  
574 -  
575 - for u in users:  
576 - to_user = User.objects.get(email=u)  
577 - talk, create = Conversation.objects.get_or_create(user_one=user,user_two=to_user)  
578 - created = TalkMessages.objects.create(text=message,talk=talk,user=user,subject=subject)  
579 -  
580 - return JsonResponse({"message":"ok"})