Commit 83d82188d1cff60e393443fbd9774c8dd8353dc3

Authored by fbormann
1 parent 65e07ef0

solved issues in two data queries and template issues as well as some translation

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-20 18:40-0300\n"
  11 +"POT-Creation-Date: 2017-03-24 18:33-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"
... ... @@ -50,7 +50,7 @@ msgstr &quot;Mural da disciplina&quot;
50 50 msgid "Messages"
51 51 msgstr "Mensagens"
52 52  
53   -#: forms.py:52
  53 +#: forms.py:52 views.py:133 views.py:200
54 54 msgid "All"
55 55 msgstr "Todos"
56 56  
... ... @@ -127,84 +127,88 @@ msgid &quot;register(s)&quot;
127 127 msgstr "registro(s)"
128 128  
129 129 #: templates/reports/view.html:68
130   -msgid "Interactions Data"
131   -msgstr "Dados de interação"
  130 +msgid "Interactions Data (.csv)"
  131 +msgstr "Dados de interação (.csv)"
132 132  
133   -#: views.py:67
  133 +#: templates/reports/view.html:72
  134 +msgid "Interactions Data (.xls)"
  135 +msgstr "Dados de interação (.xls)"
  136 +
  137 +#: views.py:70
134 138 msgid "Report created successfully"
135 139 msgstr "Relatório criado com sucesso!"
136 140  
137   -#: views.py:169
  141 +#: views.py:224
138 142 msgid "Number of help posts created by the user."
139 143 msgstr "Número de postagens de dúvidas criadas no mural da disciplina."
140 144  
141   -#: views.py:175
  145 +#: views.py:230
142 146 msgid "Amount of comments on help posts created by the student."
143 147 msgstr ""
144 148 "Número de comentários criados para as próprias postagens de dúvidas no mural "
145 149 "da disciplina."
146 150  
147   -#: views.py:180
  151 +#: views.py:235
148 152 msgid "Amount of comments made by the student on teachers help posts."
149 153 msgstr ""
150 154 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
151 155 "pelo professor."
152 156  
153   -#: views.py:184
  157 +#: views.py:239
154 158 msgid "Amount of comments made by the student on other students help posts."
155 159 msgstr ""
156 160 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
157 161 "por outros estudantes."
158 162  
159   -#: views.py:195
  163 +#: views.py:250
160 164 msgid "Number of help posts created by the user that the teacher commented on."
161 165 msgstr ""
162 166 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
163 167 "por outros estudantes"
164 168  
165   -#: views.py:203
  169 +#: views.py:258
166 170 msgid "Number of help posts created by the user others students commented on."
167 171 msgstr ""
168 172 " Número de postagens de dúvidas criadas no mural da disciplina que foram "
169 173 "comentadas por outros estudantes."
170 174  
171   -#: views.py:206
  175 +#: views.py:261
172 176 msgid "Number of student visualizations on the mural of the subject."
173 177 msgstr "Número de visualizações do mural da disciplina."
174 178  
175   -#: views.py:218
  179 +#: views.py:273
176 180 msgid "Number of access to mural between 6 a.m to 12a.m. ."
177 181 msgstr ""
178 182 "Número de acessos ao ambiente virtual da disciplina no horário de 06h às 12h."
179 183  
180   -#: views.py:222
  184 +#: views.py:277
181 185 msgid "Number of access to mural between 0 p.m to 6p.m. ."
182 186 msgstr ""
183 187 "Número de acessos ao ambiente virtual da disciplina no horário de 12h às 18h."
184 188  
185   -#: views.py:225
  189 +#: views.py:280
186 190 msgid "Number of access to mural between 6 p.m to 12p.m. ."
187 191 msgstr ""
188 192 "Número de acessos ao ambiente virtual da disciplina no horário de 18h às 24h."
189 193  
190   -#: views.py:229
  194 +#: views.py:284
191 195 msgid "Number of access to mural between 0 a.m to 6a.m. ."
192 196 msgstr ""
193 197 "Número de acessos ao ambiente virtual da disciplina no horário de 24h às 06h."
194 198  
195   -#: views.py:237 views.py:240
  199 +#: views.py:292 views.py:295
196 200 msgid "Number of access to the subject on "
197 201 msgstr "Número de acessos ao assunto na(o) "
198 202  
199   -#: views.py:243
  203 +#: views.py:298
200 204 msgid "Number of distinct days the user access the subject. "
201 205 msgstr "Número de dias distintos que acessou o ambiente virtual da disciplina."
202 206  
203   -#: views.py:244
  207 +#: views.py:299
204 208 msgid "Class"
205 209 msgstr "Classe"
206 210  
207   -#: views.py:245
  211 +#: views.py:300
208 212 msgid "Performance"
209 213 msgstr "Desempenho"
210 214  
... ...
reports/templates/reports/_form.html
... ... @@ -20,16 +20,16 @@
20 20 <div id="general-parameters-div">
21 21 <div class="general-parameters-field">
22 22 {{form.topic.errors}}
23   - <label> {{form.topic.label}} </label>
  23 + <label class="form-field-report"> {{form.topic.label}} </label>
24 24 {% render_field form.topic class="form-control" %}
25 25 </div>
26 26 <div class="general-parameters-field">
27   - <label> {{form.init_date.label}} </label>
  27 + <label class="form-field-report"> {{form.init_date.label}} </label>
28 28 {% render_field form.init_date class='form-control date-picker' %}
29 29 </div>
30 30  
31 31 <div class="general-parameters-field">
32   - <label> {{form.end_date.label}} </label>
  32 + <label class="form-field-report"> {{form.end_date.label}} </label>
33 33 {% render_field form.end_date class='form-control date-picker' %}
34 34 </div>
35 35 </div>
... ...
reports/views.py
... ... @@ -129,18 +129,22 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
129 129 params_data = self.request.GET
130 130 subject = Subject.objects.get(id=params_data['subject_id'])
131 131 context['subject_name'] = subject.name
132   - context['topic_name'] = params_data['topic']
  132 +
  133 + if params_data['topic'] == _("All"):
  134 + context['topic_name'] = params_data['topic']
  135 + else:
  136 + context['topic_name'] = Topic.objects.get(id=int(params_data['topic'])).name
133 137 context['init_date'] = params_data['init_date']
134 138 context['end_date'] = params_data['end_date']
135 139 context['subject'] = subject
136   -
  140 +
137 141 #I used getlist method so it can get more than one tag and one resource class_name
138 142 resources = params_data.getlist('resource')
139 143 tags = params_data.getlist('tag')
140 144  
141 145 self.from_mural = params_data['from_mural']
142 146  
143   - context['data'], context['header'] = self.get_mural_data(subject, context['topic_name'], params_data['init_date'], params_data['end_date'],
  147 + context['data'], context['header'] = self.get_mural_data(subject, params_data['topic'], params_data['init_date'], params_data['end_date'],
144 148 resources, tags )
145 149  
146 150  
... ... @@ -254,7 +258,7 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
254 258 interactions[_('Number of help posts created by the user others students commented on.')] = help_posts.filter(user=student, id__in = help_posts_ids).count()
255 259  
256 260 #Number of student visualizations on the mural of the subject
257   - interactions[_('Number of student visualizations on the mural of the subject.')] = MuralVisualizations.objects.filter(post__in = SubjectPost.objects.filter(space__id=subject.id),
  261 + interactions[_('Number of student visualizations on the mural of the subject.')] = MuralVisualizations.objects.filter(post__in = SubjectPost.objects.filter(space__id=subject.id, create_date__range=(init_date, end_date)),
258 262 user = student).count()
259 263  
260 264  
... ... @@ -285,8 +289,9 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
285 289 day_names = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]
286 290 distinct_days = 0
287 291 for day_num in day_numbers:
  292 + #day+1 is because the days are started on 1 instead of the lists, which index starts at 0
288 293 interactions[_('Number of access to the subject on ')+ day_names[day_num]] = Log.objects.filter(action="access", resource="subject",
289   - user_id= student.id, context__contains = {'subject_id' : subject.id}, datetime__week_day = day_num, datetime__range = (init_date, end_date)).count()
  294 + user_id= student.id, context__contains = {'subject_id' : subject.id}, datetime__week_day = day_num+1, datetime__range = (init_date, end_date)).count()
290 295 #to save the distinct days the user has accessed
291 296 if interactions[_('Number of access to the subject on ')+ day_names[day_num]] > 0:
292 297 distinct_days += 1
... ...