Commit c98c25542f2efdbd719aeb2af1b7cb11659ac360

Authored by fbormann
1 parent 4ca7e14d

added mapping for resource subclasses create reports and listing reports pages

reports/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-03-28 20:11-0300\n" 11 +"POT-Creation-Date: 2017-04-02 23:42-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"
@@ -27,20 +27,16 @@ msgid &quot;Tag&quot; @@ -27,20 +27,16 @@ msgid &quot;Tag&quot;
27 msgstr "Tag" 27 msgstr "Tag"
28 28
29 #: forms.py:36 29 #: forms.py:36
30 -#, fuzzy  
31 -#| msgid "Topic"  
32 msgid "Topics" 30 msgid "Topics"
33 -msgstr "Tópico" 31 +msgstr "Tópicos"
34 32
35 #: forms.py:37 templates/reports/view.html:58 33 #: forms.py:37 templates/reports/view.html:58
36 msgid "Initial Date" 34 msgid "Initial Date"
37 msgstr "Data inicial" 35 msgstr "Data inicial"
38 36
39 #: forms.py:38 37 #: forms.py:38
40 -#, fuzzy  
41 -#| msgid "Initial Date"  
42 msgid "Final Date" 38 msgid "Final Date"
43 -msgstr "Data inicial" 39 +msgstr "Data Final"
44 40
45 #: forms.py:40 41 #: forms.py:40
46 msgid "From Mural" 42 msgid "From Mural"
@@ -50,7 +46,7 @@ msgstr &quot;Mural da disciplina&quot; @@ -50,7 +46,7 @@ msgstr &quot;Mural da disciplina&quot;
50 msgid "Messages" 46 msgid "Messages"
51 msgstr "Mensagens" 47 msgstr "Mensagens"
52 48
53 -#: forms.py:52 views.py:133 views.py:200 49 +#: forms.py:52 views.py:134 views.py:205
54 msgid "All" 50 msgid "All"
55 msgstr "Todos" 51 msgstr "Todos"
56 52
@@ -134,128 +130,139 @@ msgstr &quot;Dados de interação (.csv)&quot; @@ -134,128 +130,139 @@ msgstr &quot;Dados de interação (.csv)&quot;
134 msgid "Interactions Data (.xls)" 130 msgid "Interactions Data (.xls)"
135 msgstr "Dados de interação (.xls)" 131 msgstr "Dados de interação (.xls)"
136 132
137 -#: views.py:70 133 +#: views.py:71
138 msgid "Report created successfully" 134 msgid "Report created successfully"
139 msgstr "Relatório criado com sucesso!" 135 msgstr "Relatório criado com sucesso!"
140 136
141 -#: views.py:224 137 +#: views.py:209
  138 +msgid "User"
  139 +msgstr ""
  140 +
  141 +#: views.py:229
142 msgid "Number of help posts created by the user." 142 msgid "Number of help posts created by the user."
143 msgstr "Número de postagens de dúvidas criadas no mural da disciplina." 143 msgstr "Número de postagens de dúvidas criadas no mural da disciplina."
144 144
145 -#: views.py:230 145 +#: views.py:235
146 msgid "Amount of comments on help posts created by the student." 146 msgid "Amount of comments on help posts created by the student."
147 msgstr "" 147 msgstr ""
148 "Número de comentários criados para as próprias postagens de dúvidas no mural " 148 "Número de comentários criados para as próprias postagens de dúvidas no mural "
149 "da disciplina." 149 "da disciplina."
150 150
151 -#: views.py:235 151 +#: views.py:240
152 msgid "Amount of comments made by the student on teachers help posts." 152 msgid "Amount of comments made by the student on teachers help posts."
153 msgstr "" 153 msgstr ""
154 "Número de comentários às postagens de dúvidas no mural da disciplina criadas " 154 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
155 "pelo professor." 155 "pelo professor."
156 156
157 -#: views.py:239 157 +#: views.py:244
158 msgid "Amount of comments made by the student on other students help posts." 158 msgid "Amount of comments made by the student on other students help posts."
159 msgstr "" 159 msgstr ""
160 "Número de comentários às postagens de dúvidas no mural da disciplina criadas " 160 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
161 "por outros estudantes." 161 "por outros estudantes."
162 162
163 -#: views.py:250 163 +#: views.py:255
164 msgid "Number of help posts created by the user that the teacher commented on." 164 msgid "Number of help posts created by the user that the teacher commented on."
165 msgstr "" 165 msgstr ""
166 "Número de comentários às postagens de dúvidas no mural da disciplina criadas " 166 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
167 "por outros estudantes" 167 "por outros estudantes"
168 168
169 -#: views.py:258 169 +#: views.py:263
170 msgid "Number of help posts created by the user others students commented on." 170 msgid "Number of help posts created by the user others students commented on."
171 msgstr "" 171 msgstr ""
172 " Número de postagens de dúvidas criadas no mural da disciplina que foram " 172 " Número de postagens de dúvidas criadas no mural da disciplina que foram "
173 "comentadas por outros estudantes." 173 "comentadas por outros estudantes."
174 174
175 -#: views.py:261 175 +#: views.py:266
176 msgid "Number of student visualizations on the mural of the subject." 176 msgid "Number of student visualizations on the mural of the subject."
177 msgstr "Número de visualizações do mural da disciplina." 177 msgstr "Número de visualizações do mural da disciplina."
178 178
179 -#: views.py:273 179 +#: views.py:278
180 msgid "Number of access to mural between 6 a.m to 12a.m. ." 180 msgid "Number of access to mural between 6 a.m to 12a.m. ."
181 msgstr "" 181 msgstr ""
182 "Número de acessos ao ambiente virtual da disciplina no horário de 06h às 12h." 182 "Número de acessos ao ambiente virtual da disciplina no horário de 06h às 12h."
183 183
184 -#: views.py:277 184 +#: views.py:282
185 msgid "Number of access to mural between 0 p.m to 6p.m. ." 185 msgid "Number of access to mural between 0 p.m to 6p.m. ."
186 msgstr "" 186 msgstr ""
187 "Número de acessos ao ambiente virtual da disciplina no horário de 12h às 18h." 187 "Número de acessos ao ambiente virtual da disciplina no horário de 12h às 18h."
188 188
189 -#: views.py:280 189 +#: views.py:285
190 msgid "Number of access to mural between 6 p.m to 12p.m. ." 190 msgid "Number of access to mural between 6 p.m to 12p.m. ."
191 msgstr "" 191 msgstr ""
192 "Número de acessos ao ambiente virtual da disciplina no horário de 18h às 24h." 192 "Número de acessos ao ambiente virtual da disciplina no horário de 18h às 24h."
193 193
194 -#: views.py:284 194 +#: views.py:289
195 msgid "Number of access to mural between 0 a.m to 6a.m. ." 195 msgid "Number of access to mural between 0 a.m to 6a.m. ."
196 msgstr "" 196 msgstr ""
197 "Número de acessos ao ambiente virtual da disciplina no horário de 24h às 06h." 197 "Número de acessos ao ambiente virtual da disciplina no horário de 24h às 06h."
198 198
199 -#: views.py:289 199 +#: views.py:294
200 msgid "sunday" 200 msgid "sunday"
201 msgstr "domingo" 201 msgstr "domingo"
202 202
203 -#: views.py:289 203 +#: views.py:294
204 msgid "monday" 204 msgid "monday"
205 msgstr "segunda" 205 msgstr "segunda"
206 206
207 -#: views.py:289 207 +#: views.py:294
208 msgid "tuesday" 208 msgid "tuesday"
209 msgstr "terça-feira" 209 msgstr "terça-feira"
210 210
211 -#: views.py:289 211 +#: views.py:294
212 msgid "wednesday" 212 msgid "wednesday"
213 msgstr "quarta" 213 msgstr "quarta"
214 214
215 -#: views.py:289 215 +#: views.py:294
216 msgid "thursday" 216 msgid "thursday"
217 msgstr "quinta-feira" 217 msgstr "quinta-feira"
218 218
219 -#: views.py:290 219 +#: views.py:295
220 msgid "friday" 220 msgid "friday"
221 msgstr "sexta" 221 msgstr "sexta"
222 222
223 -#: views.py:290 223 +#: views.py:295
224 msgid "saturday" 224 msgid "saturday"
225 msgstr "sábado" 225 msgstr "sábado"
226 226
227 -#: views.py:294 views.py:297 227 +#: views.py:299 views.py:302
228 msgid "Number of access to the subject on " 228 msgid "Number of access to the subject on "
229 msgstr "Número de acessos ao assunto na(o) " 229 msgstr "Número de acessos ao assunto na(o) "
230 230
231 -#: views.py:300 231 +#: views.py:305
232 msgid "Number of distinct days the user access the subject. " 232 msgid "Number of distinct days the user access the subject. "
233 msgstr "Número de dias distintos que acessou o ambiente virtual da disciplina." 233 msgstr "Número de dias distintos que acessou o ambiente virtual da disciplina."
234 234
235 -#: views.py:301 235 +#: views.py:306
236 msgid "Class" 236 msgid "Class"
237 msgstr "Classe" 237 msgstr "Classe"
238 238
239 -#: views.py:302 239 +#: views.py:307
240 msgid "Performance" 240 msgid "Performance"
241 msgstr "Desempenho" 241 msgstr "Desempenho"
242 242
243 -#: views.py:414 views.py:415 views.py:416 views.py:419 243 +#: views.py:419
  244 +msgid "number of visualizations of "
  245 +msgstr "Número de visualizações do(e) "
  246 +
  247 +#: views.py:419 views.py:420 views.py:421 views.py:424
244 msgid " with tag " 248 msgid " with tag "
245 msgstr " com a tag " 249 msgstr " com a tag "
246 250
247 -#: views.py:415  
248 -msgid "distintic "  
249 -msgstr "distintos " 251 +#: views.py:420
  252 +msgid "number of visualizations of distintic "
  253 +msgstr "Número de visualizações dos distintos "
250 254
251 -#: views.py:416 255 +#: views.py:421
252 msgid "distintic days " 256 msgid "distintic days "
253 -msgstr "dias distintos " 257 +msgstr "número de dias distintos "
254 258
255 -#: views.py:419 259 +#: views.py:424
256 msgid "hours viewed of " 260 msgid "hours viewed of "
257 msgstr "quantidade de horas vistas " 261 msgstr "quantidade de horas vistas "
258 262
  263 +#~ msgid "distintic "
  264 +#~ msgstr "distintos "
  265 +
259 #~ msgid "Topics to select data from" 266 #~ msgid "Topics to select data from"
260 #~ msgstr "Tópico do qual os dados serão retirados" 267 #~ msgstr "Tópico do qual os dados serão retirados"
261 268
reports/views.py
@@ -415,10 +415,19 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): @@ -415,10 +415,19 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
415 total_count += count 415 total_count += count
416 416
417 417
418 -  
419 - data[str(resources_types[i]) + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = total_count  
420 - data[str(_("distintic ")) + str(resources_types[i]) + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = distinct_resources  
421 - data[str(_("distintic days ")) + str(resources_types[i]) + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = distinct_days 418 +
  419 + #mapping to translate class names
  420 + mapping = {}
  421 + mapping['pdffile'] = str(_('PDF File'))
  422 + mapping['goals'] = str(_('Topic Goals'))
  423 + mapping['link'] = str(_('Link to Website'))
  424 + mapping['filelink'] = str(_('File Link'))
  425 + mapping['webconference'] = str(_('Web Conference'))
  426 + mapping['ytvideo'] = str(_('YouTube Video'))
  427 + mapping['webpage'] = str(_('WebPage'))
  428 + data[str(_("number of visualizations of ")) + mapping[str(resources_types[i])] + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = total_count
  429 + data[str(_("number of visualizations of distintic ")) + mapping[str(resources_types[i])] + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = distinct_resources
  430 + data[str(_("distintic days ")) + mapping[str(resources_types[i])] + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = distinct_days
422 431
423 if resources_types[i].lower() in ["ytvideo", "webconference"]: 432 if resources_types[i].lower() in ["ytvideo", "webconference"]:
424 data[str(_("hours viewed of ")) + str(resources_types[i]) + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = hours_viewed 433 data[str(_("hours viewed of ")) + str(resources_types[i]) + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = hours_viewed
@@ -436,7 +445,6 @@ def get_resources(request): @@ -436,7 +445,6 @@ def get_resources(request):
436 445
437 #get all possible resources 446 #get all possible resources
438 classes = Resource.__subclasses__() 447 classes = Resource.__subclasses__()
439 -  
440 data = {} 448 data = {}
441 subject = Subject.objects.get(id=request.GET['subject_id']) 449 subject = Subject.objects.get(id=request.GET['subject_id'])
442 450
@@ -454,8 +462,16 @@ def get_resources(request): @@ -454,8 +462,16 @@ def get_resources(request):
454 462
455 #remove duplicates 463 #remove duplicates
456 resources = set(resources_class_names) 464 resources = set(resources_class_names)
457 -  
458 - data['resources']= [ {'id':resource_type, 'name':resource_type} for resource_type in resources] 465 + mapping = {}
  466 + mapping['pdffile'] = str(_('PDF File'))
  467 + mapping['goals'] = str(_('Topic Goals'))
  468 + mapping['link'] = str(_('Link to Website'))
  469 + mapping['filelink'] = str(_('File Link'))
  470 + mapping['webconference'] = str(_('Web Conference'))
  471 + mapping['ytvideo'] = str(_('YouTube Video'))
  472 + mapping['webpage'] = str(_('WebPage'))
  473 +
  474 + data['resources']= [ {'id':resource_type, 'name':mapping[resource_type]} for resource_type in resources]
459 return JsonResponse(data) 475 return JsonResponse(data)
460 476
461 477