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 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 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 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -27,20 +27,16 @@ msgid &quot;Tag&quot;
27 27 msgstr "Tag"
28 28  
29 29 #: forms.py:36
30   -#, fuzzy
31   -#| msgid "Topic"
32 30 msgid "Topics"
33   -msgstr "Tópico"
  31 +msgstr "Tópicos"
34 32  
35 33 #: forms.py:37 templates/reports/view.html:58
36 34 msgid "Initial Date"
37 35 msgstr "Data inicial"
38 36  
39 37 #: forms.py:38
40   -#, fuzzy
41   -#| msgid "Initial Date"
42 38 msgid "Final Date"
43   -msgstr "Data inicial"
  39 +msgstr "Data Final"
44 40  
45 41 #: forms.py:40
46 42 msgid "From Mural"
... ... @@ -50,7 +46,7 @@ msgstr &quot;Mural da disciplina&quot;
50 46 msgid "Messages"
51 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 50 msgid "All"
55 51 msgstr "Todos"
56 52  
... ... @@ -134,128 +130,139 @@ msgstr &quot;Dados de interação (.csv)&quot;
134 130 msgid "Interactions Data (.xls)"
135 131 msgstr "Dados de interação (.xls)"
136 132  
137   -#: views.py:70
  133 +#: views.py:71
138 134 msgid "Report created successfully"
139 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 142 msgid "Number of help posts created by the user."
143 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 146 msgid "Amount of comments on help posts created by the student."
147 147 msgstr ""
148 148 "Número de comentários criados para as próprias postagens de dúvidas no mural "
149 149 "da disciplina."
150 150  
151   -#: views.py:235
  151 +#: views.py:240
152 152 msgid "Amount of comments made by the student on teachers help posts."
153 153 msgstr ""
154 154 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
155 155 "pelo professor."
156 156  
157   -#: views.py:239
  157 +#: views.py:244
158 158 msgid "Amount of comments made by the student on other students help posts."
159 159 msgstr ""
160 160 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
161 161 "por outros estudantes."
162 162  
163   -#: views.py:250
  163 +#: views.py:255
164 164 msgid "Number of help posts created by the user that the teacher commented on."
165 165 msgstr ""
166 166 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
167 167 "por outros estudantes"
168 168  
169   -#: views.py:258
  169 +#: views.py:263
170 170 msgid "Number of help posts created by the user others students commented on."
171 171 msgstr ""
172 172 " Número de postagens de dúvidas criadas no mural da disciplina que foram "
173 173 "comentadas por outros estudantes."
174 174  
175   -#: views.py:261
  175 +#: views.py:266
176 176 msgid "Number of student visualizations on the mural of the subject."
177 177 msgstr "Número de visualizações do mural da disciplina."
178 178  
179   -#: views.py:273
  179 +#: views.py:278
180 180 msgid "Number of access to mural between 6 a.m to 12a.m. ."
181 181 msgstr ""
182 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 185 msgid "Number of access to mural between 0 p.m to 6p.m. ."
186 186 msgstr ""
187 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 190 msgid "Number of access to mural between 6 p.m to 12p.m. ."
191 191 msgstr ""
192 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 195 msgid "Number of access to mural between 0 a.m to 6a.m. ."
196 196 msgstr ""
197 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 200 msgid "sunday"
201 201 msgstr "domingo"
202 202  
203   -#: views.py:289
  203 +#: views.py:294
204 204 msgid "monday"
205 205 msgstr "segunda"
206 206  
207   -#: views.py:289
  207 +#: views.py:294
208 208 msgid "tuesday"
209 209 msgstr "terça-feira"
210 210  
211   -#: views.py:289
  211 +#: views.py:294
212 212 msgid "wednesday"
213 213 msgstr "quarta"
214 214  
215   -#: views.py:289
  215 +#: views.py:294
216 216 msgid "thursday"
217 217 msgstr "quinta-feira"
218 218  
219   -#: views.py:290
  219 +#: views.py:295
220 220 msgid "friday"
221 221 msgstr "sexta"
222 222  
223   -#: views.py:290
  223 +#: views.py:295
224 224 msgid "saturday"
225 225 msgstr "sábado"
226 226  
227   -#: views.py:294 views.py:297
  227 +#: views.py:299 views.py:302
228 228 msgid "Number of access to the subject on "
229 229 msgstr "Número de acessos ao assunto na(o) "
230 230  
231   -#: views.py:300
  231 +#: views.py:305
232 232 msgid "Number of distinct days the user access the subject. "
233 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 236 msgid "Class"
237 237 msgstr "Classe"
238 238  
239   -#: views.py:302
  239 +#: views.py:307
240 240 msgid "Performance"
241 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 248 msgid " with tag "
245 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 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 260 msgid "hours viewed of "
257 261 msgstr "quantidade de horas vistas "
258 262  
  263 +#~ msgid "distintic "
  264 +#~ msgstr "distintos "
  265 +
259 266 #~ msgid "Topics to select data from"
260 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 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 432 if resources_types[i].lower() in ["ytvideo", "webconference"]:
424 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 445  
437 446 #get all possible resources
438 447 classes = Resource.__subclasses__()
439   -
440 448 data = {}
441 449 subject = Subject.objects.get(id=request.GET['subject_id'])
442 450  
... ... @@ -454,8 +462,16 @@ def get_resources(request):
454 462  
455 463 #remove duplicates
456 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 475 return JsonResponse(data)
460 476  
461 477  
... ...