Commit dd32871323ac4fcfdf6585ef60db29573d784862
Committed by
GitHub
Exists in
master
and in
2 other branches
Merge pull request #467 from amadeusproject/refactoring
Possible Socket Fix
Showing
21 changed files
with
274 additions
and
142 deletions
Show diff stats
amadeus/static/css/base/amadeus.css
... | ... | @@ -1113,7 +1113,7 @@ li.item .notify_badge { |
1113 | 1113 | } |
1114 | 1114 | |
1115 | 1115 | .comment-section { |
1116 | - max-height: 700px; | |
1116 | + max-height: 500px; | |
1117 | 1117 | overflow-y: scroll; |
1118 | 1118 | border-top-width: 1px; |
1119 | 1119 | border-top-style: solid; |
... | ... | @@ -1568,6 +1568,7 @@ div.dataTables_wrapper div.dataTables_paginate { |
1568 | 1568 | overflow-y: auto; |
1569 | 1569 | opacity: 0; |
1570 | 1570 | visibility: hidden; |
1571 | + display: none; | |
1571 | 1572 | } |
1572 | 1573 | |
1573 | 1574 | #participants { | ... | ... |
amadeus/static/js/main.js
amadeus/static/js/socket.js
... | ... | @@ -4,7 +4,7 @@ if (("Notification" in window)) { |
4 | 4 | } |
5 | 5 | } |
6 | 6 | |
7 | -socket = new WebSocket("ws://" + window.location.host + "/"); | |
7 | +socket = new WebSocket("ws://" + window.location.host + ":8888/"); | |
8 | 8 | |
9 | 9 | socket.onmessage = function(e) { |
10 | 10 | content = JSON.parse(e.data); | ... | ... |
amadeus/static/summernote/summernote.js
... | ... | @@ -4631,7 +4631,7 @@ |
4631 | 4631 | documentEventHandlers.onDrop = function (e) { |
4632 | 4632 | e.preventDefault(); |
4633 | 4633 | }; |
4634 | - $document.on('drop', documentEventHandlers.onDrop); | |
4634 | + $dropzone.on('drop', documentEventHandlers.onDrop); | |
4635 | 4635 | } else { |
4636 | 4636 | this.attachDragAndDropEvent(); |
4637 | 4637 | } | ... | ... |
chat/templates/chat/_form.html
mural/templates/mural/_form.html
mural/templates/mural/_form_comment.html
... | ... | @@ -0,0 +1,12 @@ |
1 | +from django import forms | |
2 | +from django.utils.translation import ugettext_lazy as _ | |
3 | + | |
4 | +from .models import News | |
5 | + | |
6 | +class NewsForm(forms.ModelForm): | |
7 | + class Meta: | |
8 | + model = News | |
9 | + fields = ['title','image','content'] | |
10 | + widgets = { | |
11 | + 'content': forms.Textarea, | |
12 | + } | ... | ... |
... | ... | @@ -0,0 +1,21 @@ |
1 | +from django.db import models | |
2 | + | |
3 | +# Create your models here. | |
4 | +from autoslug.fields import AutoSlugField | |
5 | + | |
6 | +from django.utils.translation import ugettext_lazy as _ | |
7 | +from django.core.exceptions import ValidationError | |
8 | + | |
9 | + | |
10 | +def validate_img_extension(value): | |
11 | + valid_formats = ['image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png'] | |
12 | + | |
13 | + if hasattr(value.file, 'content_type'): | |
14 | + if not value.file.content_type in valid_formats: | |
15 | + raise ValidationError(_('File not supported.')) | |
16 | + | |
17 | +class News(models.Model): | |
18 | + title = models.CharField( _("Name"), unique = True,max_length= 200) | |
19 | + slug = AutoSlugField(_("Slug"),populate_from='title',unique=True) | |
20 | + image = models.ImageField(verbose_name = _('News Image'), upload_to = 'news/', validators = [validate_img_extension]) | |
21 | + content = models.TextField(_('Description')) | ... | ... |
reports/forms.py
... | ... | @@ -29,7 +29,6 @@ class ResourceAndTagForm(forms.Form): |
29 | 29 | initial = kwargs['initial'] |
30 | 30 | self.fields['resource'].choices = [(classes.__name__.lower(), classes.__name__.lower()) for classes in initial['class_name']] |
31 | 31 | self.fields['tag'].choices = [(tag.id, tag.name) for tag in initial['tag']] |
32 | - | |
33 | 32 | |
34 | 33 | |
35 | 34 | class CreateInteractionReportForm(forms.Form): | ... | ... |
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-04-02 23:42-0300\n" | |
11 | +"POT-Creation-Date: 2017-04-06 16:30-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" |
... | ... | @@ -26,39 +26,39 @@ msgstr "Tipo de recurso" |
26 | 26 | msgid "Tag" |
27 | 27 | msgstr "Tag" |
28 | 28 | |
29 | -#: forms.py:36 | |
29 | +#: forms.py:35 | |
30 | 30 | msgid "Topics" |
31 | 31 | msgstr "Tópicos" |
32 | 32 | |
33 | -#: forms.py:37 templates/reports/view.html:58 | |
33 | +#: forms.py:36 templates/reports/view.html:58 | |
34 | 34 | msgid "Initial Date" |
35 | 35 | msgstr "Data inicial" |
36 | 36 | |
37 | -#: forms.py:38 | |
37 | +#: forms.py:37 | |
38 | 38 | msgid "Final Date" |
39 | 39 | msgstr "Data Final" |
40 | 40 | |
41 | -#: forms.py:40 | |
41 | +#: forms.py:39 | |
42 | 42 | msgid "From Mural" |
43 | 43 | msgstr "Mural da disciplina" |
44 | 44 | |
45 | -#: forms.py:41 | |
45 | +#: forms.py:40 | |
46 | 46 | msgid "Messages" |
47 | 47 | msgstr "Mensagens" |
48 | 48 | |
49 | -#: forms.py:52 views.py:134 views.py:205 | |
49 | +#: forms.py:51 views.py:127 views.py:198 | |
50 | 50 | msgid "All" |
51 | 51 | msgstr "Todos" |
52 | 52 | |
53 | -#: forms.py:61 | |
53 | +#: forms.py:60 | |
54 | 54 | msgid "The initial date can't be after the end one." |
55 | 55 | msgstr "A data inicial não pode ser depois da final" |
56 | 56 | |
57 | -#: forms.py:66 | |
57 | +#: forms.py:65 | |
58 | 58 | msgid "This date should be right or after " |
59 | 59 | msgstr "Esta data deve ser igual ou após" |
60 | 60 | |
61 | -#: forms.py:72 | |
61 | +#: forms.py:71 | |
62 | 62 | msgid "This date should be right or before " |
63 | 63 | msgstr "Esta data deve ser igual ou anterior à" |
64 | 64 | |
... | ... | @@ -130,133 +130,167 @@ msgstr "Dados de interação (.csv)" |
130 | 130 | msgid "Interactions Data (.xls)" |
131 | 131 | msgstr "Dados de interação (.xls)" |
132 | 132 | |
133 | -#: views.py:71 | |
133 | +#: views.py:60 | |
134 | 134 | msgid "Report created successfully" |
135 | 135 | msgstr "Relatório criado com sucesso!" |
136 | 136 | |
137 | -#: views.py:209 | |
137 | +#: views.py:202 | |
138 | 138 | msgid "User" |
139 | 139 | msgstr "" |
140 | 140 | |
141 | -#: views.py:229 | |
141 | +#: views.py:222 | |
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:235 | |
145 | +#: views.py:228 | |
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:240 | |
151 | +#: views.py:233 | |
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:244 | |
157 | +#: views.py:237 | |
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:255 | |
163 | +#: views.py:248 | |
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:263 | |
169 | +#: views.py:256 | |
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:266 | |
175 | +#: views.py:259 | |
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:278 | |
179 | +#: views.py:271 | |
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:282 | |
184 | +#: views.py:275 | |
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:285 | |
189 | +#: views.py:278 | |
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:289 | |
194 | +#: views.py:282 | |
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:294 | |
199 | +#: views.py:287 | |
200 | 200 | msgid "sunday" |
201 | 201 | msgstr "domingo" |
202 | 202 | |
203 | -#: views.py:294 | |
203 | +#: views.py:287 | |
204 | 204 | msgid "monday" |
205 | 205 | msgstr "segunda" |
206 | 206 | |
207 | -#: views.py:294 | |
207 | +#: views.py:287 | |
208 | 208 | msgid "tuesday" |
209 | 209 | msgstr "terça-feira" |
210 | 210 | |
211 | -#: views.py:294 | |
211 | +#: views.py:287 | |
212 | 212 | msgid "wednesday" |
213 | 213 | msgstr "quarta" |
214 | 214 | |
215 | -#: views.py:294 | |
215 | +#: views.py:287 | |
216 | 216 | msgid "thursday" |
217 | 217 | msgstr "quinta-feira" |
218 | 218 | |
219 | -#: views.py:295 | |
219 | +#: views.py:288 | |
220 | 220 | msgid "friday" |
221 | 221 | msgstr "sexta" |
222 | 222 | |
223 | -#: views.py:295 | |
223 | +#: views.py:288 | |
224 | 224 | msgid "saturday" |
225 | 225 | msgstr "sábado" |
226 | 226 | |
227 | -#: views.py:299 views.py:302 | |
227 | +#: views.py:292 views.py:295 | |
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:305 | |
231 | +#: views.py:298 | |
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:306 | |
235 | +#: views.py:299 | |
236 | 236 | msgid "Class" |
237 | 237 | msgstr "Classe" |
238 | 238 | |
239 | -#: views.py:307 | |
239 | +#: views.py:299 views.py:300 | |
240 | +msgid "Undefined" | |
241 | +msgstr "Indefinido" | |
242 | + | |
243 | +#: views.py:300 | |
240 | 244 | msgid "Performance" |
241 | 245 | msgstr "Desempenho" |
242 | 246 | |
243 | -#: views.py:419 | |
247 | +#: views.py:448 views.py:498 | |
248 | +msgid "PDF File" | |
249 | +msgstr "" | |
250 | + | |
251 | +#: views.py:449 views.py:499 | |
252 | +#, fuzzy | |
253 | +#| msgid "Topics" | |
254 | +msgid "Topic Goals" | |
255 | +msgstr "Tópicos" | |
256 | + | |
257 | +#: views.py:450 views.py:500 | |
258 | +msgid "Link to Website" | |
259 | +msgstr "" | |
260 | + | |
261 | +#: views.py:451 views.py:501 | |
262 | +msgid "File Link" | |
263 | +msgstr "" | |
264 | + | |
265 | +#: views.py:452 views.py:502 | |
266 | +msgid "Web Conference" | |
267 | +msgstr "" | |
268 | + | |
269 | +#: views.py:453 views.py:503 | |
270 | +msgid "YouTube Video" | |
271 | +msgstr "" | |
272 | + | |
273 | +#: views.py:454 views.py:504 | |
274 | +msgid "WebPage" | |
275 | +msgstr "" | |
276 | + | |
277 | +#: views.py:456 views.py:463 | |
244 | 278 | msgid "number of visualizations of " |
245 | 279 | msgstr "Número de visualizações do(e) " |
246 | 280 | |
247 | -#: views.py:419 views.py:420 views.py:421 views.py:424 | |
281 | +#: views.py:456 views.py:457 views.py:458 views.py:461 | |
248 | 282 | msgid " with tag " |
249 | 283 | msgstr " com a tag " |
250 | 284 | |
251 | -#: views.py:420 | |
285 | +#: views.py:457 views.py:464 | |
252 | 286 | msgid "number of visualizations of distintic " |
253 | 287 | msgstr "Número de visualizações dos distintos " |
254 | 288 | |
255 | -#: views.py:421 | |
289 | +#: views.py:458 views.py:465 | |
256 | 290 | msgid "distintic days " |
257 | 291 | msgstr "número de dias distintos " |
258 | 292 | |
259 | -#: views.py:424 | |
293 | +#: views.py:461 views.py:468 | |
260 | 294 | msgid "hours viewed of " |
261 | 295 | msgstr "quantidade de horas vistas " |
262 | 296 | ... | ... |
reports/views.py
... | ... | @@ -23,6 +23,7 @@ import pandas as pd |
23 | 23 | import math |
24 | 24 | from io import BytesIO |
25 | 25 | import os |
26 | +import copy | |
26 | 27 | |
27 | 28 | class ReportView(LoginRequiredMixin, generic.FormView): |
28 | 29 | template_name = "reports/create.html" |
... | ... | @@ -46,19 +47,7 @@ class ReportView(LoginRequiredMixin, generic.FormView): |
46 | 47 | context = super(ReportView, self).get_context_data(**kwargs) |
47 | 48 | subject = Subject.objects.get(id=self.request.GET['subject_id']) |
48 | 49 | |
49 | - context['subject'] = subject | |
50 | - | |
51 | - topics = subject.topic_subject.all() | |
52 | - #get all resources associated with topics | |
53 | - tags = [] | |
54 | - for topic in topics: | |
55 | - resources_set = topic.resource_topic.all() | |
56 | - for resource in resources_set: | |
57 | - for tag in resource.tags.all(): | |
58 | - tags.append(tag) | |
59 | - | |
60 | - | |
61 | - classes = Resource.__subclasses__() | |
50 | + context['subject'] = subject | |
62 | 51 | |
63 | 52 | #set formset |
64 | 53 | resourceTagFormSet = formset_factory(ResourceAndTagForm, formset=BaseResourceAndTagFormset) |
... | ... | @@ -104,6 +93,10 @@ class ReportView(LoginRequiredMixin, generic.FormView): |
104 | 93 | for tag in resource.tags.all(): |
105 | 94 | tags.append(tag) |
106 | 95 | |
96 | + | |
97 | + t = Tag(name=" ") | |
98 | + t.id = -1 #so I know he choose empyt one | |
99 | + tags.append(t) | |
107 | 100 | classes = Resource.__subclasses__() |
108 | 101 | amount_of_forms = self.request.POST['form-TOTAL_FORMS'] |
109 | 102 | initial_datum = {'class_name': classes , 'tag': tags} |
... | ... | @@ -211,7 +204,7 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): |
211 | 204 | #I use this so the system can gather data up to end_date 11h59 p.m. |
212 | 205 | end_date = end_date + timedelta(days=1) |
213 | 206 | |
214 | - | |
207 | + self.used_tags = copy.deepcopy(tags_id) #so I can check whether we are dealing with multiple or single tags (empty option) | |
215 | 208 | #For each student in the subject |
216 | 209 | for student in students: |
217 | 210 | data[student.id] = [] |
... | ... | @@ -303,8 +296,8 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): |
303 | 296 | distinct_days += 1 |
304 | 297 | |
305 | 298 | interactions[_('Number of distinct days the user access the subject. ')] = distinct_days |
306 | - interactions[_("Class")] = "" | |
307 | - interactions[_("Performance")] = "" | |
299 | + interactions[_("Class")] = _("Undefined") | |
300 | + interactions[_("Performance")] = _("Undefined") | |
308 | 301 | for value in interactions.values(): |
309 | 302 | data[student.id].append(value) |
310 | 303 | |
... | ... | @@ -316,13 +309,47 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): |
316 | 309 | def get_resources_and_tags_data(self, resources_types, tags, student, subject, topics, init_date, end_date): |
317 | 310 | data = OrderedDict() |
318 | 311 | |
312 | + new_tags = [] #tags will be replaced by this variable | |
319 | 313 | for i in range(len(resources_types)): |
320 | - | |
314 | + | |
315 | + if tags[i] == "-1": #it means I should select all of tags available for this kind of resource | |
316 | + new_tags = set() | |
317 | + if not isinstance(topics,Topic): | |
318 | + topics = subject.topic_subject.all() | |
319 | + for topic in topics: | |
320 | + resource_set = Resource.objects.select_related(resources_types[i].lower()).filter(topic = topic) | |
321 | + | |
322 | + for resource in resource_set: | |
323 | + if resource._my_subclass == resources_types[i].lower(): | |
324 | + for tag in resource.tags.all(): | |
325 | + if tag.name != "": | |
326 | + new_tags.add(tag) | |
327 | + else: | |
328 | + topics = topics | |
329 | + resource_set = Resource.objects.select_related(resources_types[i].lower()).filter(topic = topics) | |
330 | + | |
331 | + for resource in resource_set: | |
332 | + if resource._my_subclass == resources_types[i].lower(): | |
333 | + for tag in resource.tags.all(): | |
334 | + if tag.name != "": | |
335 | + new_tags.add(tag) | |
336 | + data = {} | |
337 | + | |
338 | + | |
339 | + new_tags = [tag.id for tag in new_tags] | |
340 | + tags[i] = new_tags | |
341 | + for i in range(len(resources_types)): | |
342 | + original_tags = copy.deepcopy(self.used_tags) #effectiving copy | |
321 | 343 | if isinstance(topics,Topic): |
322 | - resources = Resource.objects.select_related(resources_types[i].lower()).filter(tags__in = tags, topic=topics) | |
344 | + if type(tags[i]) == type(list()): | |
345 | + resources = Resource.objects.select_related(resources_types[i].lower()).filter(tags__in = tags[i], topic=topics) | |
346 | + else: | |
347 | + resources = Resource.objects.select_related(resources_types[i].lower()).filter(tags__in = [tags[i]], topic=topics) | |
323 | 348 | else: |
324 | - resources = Resource.objects.select_related(resources_types[i].lower()).filter(tags__in = tags, topic__in=topics) | |
325 | - | |
349 | + if type(tags[i]) == type(list()): | |
350 | + resources = Resource.objects.select_related(resources_types[i].lower()).filter(tags__in = tags[i], topic__in=topics) | |
351 | + else: | |
352 | + resources = Resource.objects.select_related(resources_types[i].lower()).filter(tags__in = [tags[i]], topic__in=topics) | |
326 | 353 | distinct_resources = 0 |
327 | 354 | total_count = 0 |
328 | 355 | |
... | ... | @@ -425,15 +452,20 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): |
425 | 452 | mapping['webconference'] = str(_('Web Conference')) |
426 | 453 | mapping['ytvideo'] = str(_('YouTube Video')) |
427 | 454 | 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 | |
431 | - | |
432 | - if resources_types[i].lower() in ["ytvideo", "webconference"]: | |
433 | - data[str(_("hours viewed of ")) + str(resources_types[i]) + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = hours_viewed | |
455 | + if original_tags[i] != "-1": | |
456 | + data[str(_("number of visualizations of ")) + mapping[str(resources_types[i])] + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = total_count | |
457 | + 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 | |
458 | + data[str(_("distintic days ")) + mapping[str(resources_types[i])] + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = distinct_days | |
459 | + | |
460 | + if resources_types[i].lower() in ["ytvideo", "webconference"]: | |
461 | + data[str(_("hours viewed of ")) + str(resources_types[i]) + str(_(" with tag ")) + Tag.objects.get(id=int(tags[i])).name] = hours_viewed | |
462 | + else: | |
463 | + data[str(_("number of visualizations of ")) + mapping[str(resources_types[i])] ] = total_count | |
464 | + data[str(_("number of visualizations of distintic ")) + mapping[str(resources_types[i])] ] = distinct_resources | |
465 | + data[str(_("distintic days ")) + mapping[str(resources_types[i])]] = distinct_days | |
434 | 466 | |
435 | - """data["distinct" + str(resources[i]) + " with tag " + Tag.objects.get(id=int(tags[i])).name] = Log.objects.filter(action="view", resource=resources[i].lower(), | |
436 | - user_id = student.id, context__contains = {'subject_id': subject.id}).distinct().count()""" | |
467 | + if resources_types[i].lower() in ["ytvideo", "webconference"]: | |
468 | + data[str(_("hours viewed of ")) + str(resources_types[i]) ] = hours_viewed | |
437 | 469 | |
438 | 470 | return data |
439 | 471 | |
... | ... | @@ -504,7 +536,10 @@ def get_tags(request): |
504 | 536 | |
505 | 537 | #adding empty tag for the purpose of giving the user this option for adicional behavior |
506 | 538 | tags = list(tags) |
507 | - tags.append(Tag(name=" ")) | |
539 | + #creating empty tag | |
540 | + t = Tag(name=" ") | |
541 | + t.id = -1 #so I know he choose empyt one | |
542 | + tags.append(t) | |
508 | 543 | data['tags'] = [ {'id':tag.id, 'name':tag.name} for tag in tags] |
509 | 544 | return JsonResponse(data) |
510 | 545 | ... | ... |
subjects/templates/subjects/view.html
... | ... | @@ -196,7 +196,7 @@ |
196 | 196 | list.animate({ |
197 | 197 | right : '-180px', |
198 | 198 | opacity: 0 |
199 | - }, 500).css({visibility: 'hidden'}); | |
199 | + }, 500).css({display: "none", visibility: 'hidden'}); | |
200 | 200 | |
201 | 201 | $this.removeClass('open'); |
202 | 202 | } else { |
... | ... | @@ -206,8 +206,12 @@ |
206 | 206 | |
207 | 207 | list.animate({ |
208 | 208 | right : 0, |
209 | - opacity: 1 | |
209 | + opacity: 1, | |
210 | 210 | }, 500).css({visibility: 'visible'}); |
211 | + | |
212 | + setTimeout(function () { | |
213 | + list.fadeIn(); | |
214 | + }, 500); | |
211 | 215 | } |
212 | 216 | }); |
213 | 217 | }); | ... | ... |
users/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-21 22:47-0300\n" | |
11 | +"POT-Creation-Date: 2017-04-04 23:45-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" |
... | ... | @@ -18,57 +18,57 @@ msgstr "" |
18 | 18 | "Content-Transfer-Encoding: 8bit\n" |
19 | 19 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" |
20 | 20 | |
21 | -#: .\forms.py:25 .\forms.py:30 .\forms.py:189 | |
21 | +#: .\forms.py:28 .\forms.py:33 .\forms.py:276 | |
22 | 22 | msgid "You must insert an email address" |
23 | 23 | msgstr "Você deve inserir um endereço de email" |
24 | 24 | |
25 | -#: .\forms.py:40 | |
25 | +#: .\forms.py:43 | |
26 | 26 | msgid "The image is too large. It should have less than 2MB." |
27 | 27 | msgstr "A imagem é muito grande. Ela deve conter menos de 2MB." |
28 | 28 | |
29 | -#: .\forms.py:51 | |
29 | +#: .\forms.py:54 | |
30 | 30 | msgid "The confirmation password is incorrect." |
31 | 31 | msgstr "A confirmação de senha está incorreta." |
32 | 32 | |
33 | -#: .\forms.py:58 .\forms.py:114 .\templates\users\login.html:52 | |
33 | +#: .\forms.py:61 .\forms.py:173 .\templates\users\login.html:52 | |
34 | 34 | msgid "Password" |
35 | 35 | msgstr "Senha" |
36 | 36 | |
37 | -#: .\forms.py:59 .\forms.py:115 .\forms.py:146 .\forms.py:202 | |
37 | +#: .\forms.py:62 .\forms.py:174 .\forms.py:233 .\forms.py:289 | |
38 | 38 | msgid "Confirm Password" |
39 | 39 | msgstr "Confirmação de Senha" |
40 | 40 | |
41 | -#: .\forms.py:76 .\forms.py:180 .\templates\users\list.html:56 | |
41 | +#: .\forms.py:108 .\forms.py:267 .\templates\users\list.html:56 | |
42 | 42 | #: .\templates\users\login.html:47 .\templates\users\search.html:47 |
43 | 43 | msgid "Email" |
44 | 44 | msgstr "Email" |
45 | 45 | |
46 | -#: .\forms.py:77 .\models.py:27 .\templates\users\list.html:55 | |
46 | +#: .\forms.py:109 .\models.py:27 .\templates\users\list.html:55 | |
47 | 47 | #: .\templates\users\search.html:46 |
48 | 48 | msgid "Name" |
49 | 49 | msgstr "Nome" |
50 | 50 | |
51 | -#: .\forms.py:78 .\models.py:28 | |
51 | +#: .\forms.py:110 .\models.py:28 | |
52 | 52 | msgid "Last Name" |
53 | 53 | msgstr "Sobrenome" |
54 | 54 | |
55 | -#: .\forms.py:79 .\models.py:29 | |
55 | +#: .\forms.py:111 .\models.py:29 | |
56 | 56 | msgid "Social Name" |
57 | 57 | msgstr "Nome Social" |
58 | 58 | |
59 | -#: .\forms.py:145 .\forms.py:201 | |
59 | +#: .\forms.py:232 .\forms.py:288 | |
60 | 60 | msgid "New Password" |
61 | 61 | msgstr "Nova Senha" |
62 | 62 | |
63 | -#: .\forms.py:152 | |
63 | +#: .\forms.py:239 | |
64 | 64 | msgid "The value inputed does not match with your actual password." |
65 | 65 | msgstr "O valor inserido não corresponde à sua senha atual." |
66 | 66 | |
67 | -#: .\forms.py:173 | |
67 | +#: .\forms.py:260 | |
68 | 68 | msgid "Actual Password" |
69 | 69 | msgstr "Senha Atual" |
70 | 70 | |
71 | -#: .\forms.py:194 | |
71 | +#: .\forms.py:281 | |
72 | 72 | msgid "You must insert a valid email address" |
73 | 73 | msgstr "Você deve inserir um endereço de email válido" |
74 | 74 | |
... | ... | @@ -149,44 +149,36 @@ msgstr "Sim" |
149 | 149 | msgid "Is not an admin" |
150 | 150 | msgstr "Não é administrador" |
151 | 151 | |
152 | -#: .\templates\users\_form.html:16 .\templates\users\register.html:52 | |
152 | +#: .\templates\users\_form.html:16 .\templates\users\register.html:53 | |
153 | 153 | msgid "Choose your photo..." |
154 | 154 | msgstr "Escolha sua foto..." |
155 | 155 | |
156 | -#: .\templates\users\_form.html:62 | |
156 | +#: .\templates\users\_form.html:70 | |
157 | 157 | msgid "Save" |
158 | 158 | msgstr "Salvar" |
159 | 159 | |
160 | -#: .\templates\users\_form.html:65 .\templates\users\delete.html:27 | |
161 | -#: .\templates\users\delete_account.html:27 | |
160 | +#: .\templates\users\_form.html:73 .\templates\users\modal_crop.html:24 | |
162 | 161 | msgid "Cancel" |
163 | 162 | msgstr "Cancelar" |
164 | 163 | |
165 | -#: .\templates\users\delete.html:9 | |
166 | -msgid "Delete User" | |
167 | -msgstr "Deletar Usuário" | |
168 | - | |
169 | -#: .\templates\users\delete.html:19 | |
164 | +#: .\templates\users\delete.html:12 | |
170 | 165 | msgid "Are you sure you want delete the user" |
171 | 166 | msgstr "Tem certeza que deseja deletar o usuário" |
172 | 167 | |
173 | -#: .\templates\users\delete.html:20 .\templates\users\delete_account.html:20 | |
174 | -msgid "All data will be lost and havent how recover it." | |
175 | -msgstr "Toda informação será perdida e não poderá ser recuperada" | |
168 | +#: .\templates\users\delete.html:18 .\templates\users\delete_account.html:18 | |
169 | +msgid "Close" | |
170 | +msgstr "" | |
176 | 171 | |
177 | -#: .\templates\users\delete.html:24 .\templates\users\delete_account.html:24 | |
178 | -msgid "Remove" | |
172 | +#: .\templates\users\delete.html:19 .\templates\users\delete_account.html:19 | |
173 | +#: .\templates\users\list.html:66 .\templates\users\search.html:57 | |
174 | +msgid "Delete" | |
179 | 175 | msgstr "Deletar" |
180 | 176 | |
181 | -#: .\templates\users\delete_account.html:9 | |
182 | -msgid "Remove Account" | |
183 | -msgstr "Remover Conta" | |
184 | - | |
185 | -#: .\templates\users\delete_account.html:19 | |
177 | +#: .\templates\users\delete_account.html:12 | |
186 | 178 | msgid "Are you sure you want delete your account?" |
187 | 179 | msgstr "Tem certeza que deseja deletar sua conta?" |
188 | 180 | |
189 | -#: .\templates\users\forgot_password.html:39 .\views.py:380 | |
181 | +#: .\templates\users\forgot_password.html:39 .\views.py:389 | |
190 | 182 | msgid "Forgot Password" |
191 | 183 | msgstr "Esqueceu Senha" |
192 | 184 | |
... | ... | @@ -203,7 +195,7 @@ msgid "Recover" |
203 | 195 | msgstr "Recuperar" |
204 | 196 | |
205 | 197 | #: .\templates\users\forgot_password.html:75 |
206 | -#: .\templates\users\new_password.html:80 .\templates\users\register.html:91 | |
198 | +#: .\templates\users\new_password.html:80 .\templates\users\register.html:92 | |
207 | 199 | msgid "Back" |
208 | 200 | msgstr "Voltar" |
209 | 201 | |
... | ... | @@ -224,10 +216,6 @@ msgstr "Não Informado" |
224 | 216 | msgid "Edit" |
225 | 217 | msgstr "Editar" |
226 | 218 | |
227 | -#: .\templates\users\list.html:66 .\templates\users\search.html:57 | |
228 | -msgid "Delete" | |
229 | -msgstr "Deletar" | |
230 | - | |
231 | 219 | #: .\templates\users\list.html:76 .\templates\users\search.html:67 |
232 | 220 | msgid "No users found" |
233 | 221 | msgstr "Nenhum usuário encontrado" |
... | ... | @@ -240,7 +228,7 @@ msgstr "Entre com a sua conta para continuar" |
240 | 228 | msgid "Log in" |
241 | 229 | msgstr "Entrar" |
242 | 230 | |
243 | -#: .\templates\users\login.html:66 .\views.py:354 | |
231 | +#: .\templates\users\login.html:66 .\views.py:363 | |
244 | 232 | msgid "Sign Up" |
245 | 233 | msgstr "Cadastrar" |
246 | 234 | |
... | ... | @@ -248,6 +236,14 @@ msgstr "Cadastrar" |
248 | 236 | msgid "Forgot your password?" |
249 | 237 | msgstr "Esqueceu sua senha?" |
250 | 238 | |
239 | +#: .\templates\users\modal_crop.html:10 | |
240 | +msgid "Image selection" | |
241 | +msgstr "Seleção de Imagem" | |
242 | + | |
243 | +#: .\templates\users\modal_crop.html:25 | |
244 | +msgid "Save Image" | |
245 | +msgstr "Salvar Imagem" | |
246 | + | |
251 | 247 | #: .\templates\users\new_password.html:39 |
252 | 248 | msgid "Set new password" |
253 | 249 | msgstr "Digite a nova senha" |
... | ... | @@ -272,11 +268,11 @@ msgstr "Professor em" |
272 | 268 | msgid "Student in" |
273 | 269 | msgstr "Estudante em" |
274 | 270 | |
275 | -#: .\templates\users\register.html:39 | |
271 | +#: .\templates\users\register.html:40 | |
276 | 272 | msgid "User Register" |
277 | 273 | msgstr "Cadastro de Usuário" |
278 | 274 | |
279 | -#: .\templates\users\register.html:88 | |
275 | +#: .\templates\users\register.html:89 | |
280 | 276 | msgid "Register" |
281 | 277 | msgstr "Cadastrar" |
282 | 278 | |
... | ... | @@ -292,37 +288,37 @@ msgstr "Não é professor" |
292 | 288 | msgid "Is not a student" |
293 | 289 | msgstr "Não é estudante" |
294 | 290 | |
295 | -#: .\views.py:55 | |
291 | +#: .\views.py:60 | |
296 | 292 | msgid "Manage Users" |
297 | 293 | msgstr "Gerenciar Usuários" |
298 | 294 | |
299 | -#: .\views.py:85 | |
295 | +#: .\views.py:90 | |
300 | 296 | msgid "Search Users" |
301 | 297 | msgstr "Pesquisar Usuário" |
302 | 298 | |
303 | -#: .\views.py:108 | |
299 | +#: .\views.py:113 | |
304 | 300 | #, python-format |
305 | 301 | msgid "User \"%s\" created successfully" |
306 | 302 | msgstr "Usuário \"%s\" criado com sucesso" |
307 | 303 | |
308 | -#: .\views.py:122 | |
304 | +#: .\views.py:127 | |
309 | 305 | msgid "Add User" |
310 | 306 | msgstr "Cadastrar Usuário" |
311 | 307 | |
312 | -#: .\views.py:156 | |
308 | +#: .\views.py:161 | |
313 | 309 | #, python-format |
314 | 310 | msgid "User \"%s\" updated successfully" |
315 | 311 | msgstr "Usuário \"%s\" atualizado com sucesso" |
316 | 312 | |
317 | -#: .\views.py:170 | |
313 | +#: .\views.py:175 | |
318 | 314 | msgid "Update User" |
319 | 315 | msgstr "Atualizar Usuário" |
320 | 316 | |
321 | -#: .\views.py:225 | |
317 | +#: .\views.py:232 | |
322 | 318 | msgid "User removed successfully!" |
323 | 319 | msgstr "Usuário removido com sucesso!" |
324 | 320 | |
325 | -#: .\views.py:226 | |
321 | +#: .\views.py:233 | |
326 | 322 | msgid "" |
327 | 323 | "Could not remove the account. The user is attach to one or more functions " |
328 | 324 | "(administrator, coordinator, professor ou student) in the system." |
... | ... | @@ -330,39 +326,39 @@ msgstr "" |
330 | 326 | "Não é possível deletar a conta. O usuário está vinculado com uma ou mais " |
331 | 327 | "funções (administrador, coordenador, professor ou estudante) no sistema." |
332 | 328 | |
333 | -#: .\views.py:249 | |
329 | +#: .\views.py:257 | |
334 | 330 | msgid "Delete Account" |
335 | 331 | msgstr "Remover Conta" |
336 | 332 | |
337 | -#: .\views.py:292 | |
333 | +#: .\views.py:301 | |
338 | 334 | msgid "Password changed successfully!" |
339 | 335 | msgstr "Senha alterada com sucesso!" |
340 | 336 | |
341 | -#: .\views.py:298 | |
337 | +#: .\views.py:307 | |
342 | 338 | msgid "Change Password" |
343 | 339 | msgstr "Alterar Senha" |
344 | 340 | |
345 | -#: .\views.py:316 | |
341 | +#: .\views.py:325 | |
346 | 342 | msgid "Profile" |
347 | 343 | msgstr "Perfil" |
348 | 344 | |
349 | -#: .\views.py:335 | |
345 | +#: .\views.py:344 | |
350 | 346 | msgid "Update Profile" |
351 | 347 | msgstr "Atualizar Perfil" |
352 | 348 | |
353 | -#: .\views.py:341 | |
349 | +#: .\views.py:350 | |
354 | 350 | msgid "Profile edited successfully!" |
355 | 351 | msgstr "Perfil editado com sucesso!" |
356 | 352 | |
357 | -#: .\views.py:361 | |
353 | +#: .\views.py:370 | |
358 | 354 | msgid "User successfully registered!" |
359 | 355 | msgstr "Usuário cadastrado com sucesso!" |
360 | 356 | |
361 | -#: .\views.py:399 | |
357 | +#: .\views.py:408 | |
362 | 358 | msgid "Recover Password" |
363 | 359 | msgstr "Recuperar Senha" |
364 | 360 | |
365 | -#: .\views.py:435 | |
361 | +#: .\views.py:444 | |
366 | 362 | msgid "" |
367 | 363 | "Soon you'll receive an email with instructions to set your new password. If " |
368 | 364 | "you don't receive it in 24 hours, please check your spam box." |
... | ... | @@ -370,38 +366,50 @@ msgstr "" |
370 | 366 | "Em breve você receberá um email com instruções para cadastrar sua nova " |
371 | 367 | "senha. Se você não recebê-lo em 24 hhoras, por favor olhe sua caixa de spam." |
372 | 368 | |
373 | -#: .\views.py:438 | |
369 | +#: .\views.py:447 | |
374 | 370 | msgid "No user is associated with this email address" |
375 | 371 | msgstr "Nenhum usuário associado com esse endereço de email." |
376 | 372 | |
377 | -#: .\views.py:451 | |
373 | +#: .\views.py:460 | |
378 | 374 | msgid "Reset Password" |
379 | 375 | msgstr "Recuperar Senha" |
380 | 376 | |
381 | -#: .\views.py:473 | |
377 | +#: .\views.py:482 | |
382 | 378 | msgid "Password reset successfully." |
383 | 379 | msgstr "Senha alterada com sucesso!" |
384 | 380 | |
385 | -#: .\views.py:477 | |
381 | +#: .\views.py:486 | |
386 | 382 | msgid "We were not able to reset your password." |
387 | 383 | msgstr "Não foi possível restaurar sua senha" |
388 | 384 | |
389 | -#: .\views.py:480 | |
385 | +#: .\views.py:489 | |
390 | 386 | msgid "The reset password link is no longer valid." |
391 | 387 | msgstr "O link para restaurar senha não está mais válido." |
392 | 388 | |
393 | -#: .\views.py:486 | |
389 | +#: .\views.py:495 | |
394 | 390 | msgid "Log In" |
395 | 391 | msgstr "Entrar" |
396 | 392 | |
397 | -#: .\views.py:507 | |
393 | +#: .\views.py:531 | |
398 | 394 | msgid "System under maintenance. Try again later" |
399 | 395 | msgstr "Sistema em manutenção. Tente novamente mais tarde" |
400 | 396 | |
401 | -#: .\views.py:509 | |
397 | +#: .\views.py:533 | |
402 | 398 | msgid "E-mail or password are incorrect." |
403 | 399 | msgstr "Email ou senha incorretos." |
404 | 400 | |
401 | +#~ msgid "Delete User" | |
402 | +#~ msgstr "Deletar Usuário" | |
403 | + | |
404 | +#~ msgid "All data will be lost and havent how recover it." | |
405 | +#~ msgstr "Toda informação será perdida e não poderá ser recuperada" | |
406 | + | |
407 | +#~ msgid "Remove" | |
408 | +#~ msgstr "Deletar" | |
409 | + | |
410 | +#~ msgid "Remove Account" | |
411 | +#~ msgstr "Remover Conta" | |
412 | + | |
405 | 413 | #, fuzzy |
406 | 414 | #~ msgid "User {name} created successfully" |
407 | 415 | #~ msgstr "Usuário {name} criado com sucesso" | ... | ... |