Commit d38fb86513169a97898231faa2d3b28b60ee7d3d
Exists in
master
and in
2 other branches
Merge branch 'refactoring' of https://github.com/amadeusproject/amadeuslms into refactoring
Showing
6 changed files
with
23 additions
and
14 deletions
Show diff stats
amadeus/static/css/base/amadeus.css
reports/views.py
... | ... | @@ -364,7 +364,7 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): |
364 | 364 | time_delta = math.fabs(end_time - begin_time) |
365 | 365 | |
366 | 366 | hours_viewed += time_delta/3600 #so it's turned this seconds into hours |
367 | - for daynum in day_numbers: | |
367 | + for day_num in day_numbers: | |
368 | 368 | count_temp = Log.objects.filter(action="view", resource=resources_types[i].lower(), |
369 | 369 | user_id = student.id, context__contains = {'subject_id': subject.id, |
370 | 370 | resources_types[i].lower()+'_id': resource.id, 'topic_id': topics.id}, datetime__week_day = day_num+1, datetime__range=(init_date, end_date)).count() | ... | ... |
students_group/templates/groups/_form.html
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <div class="panel-heading"> |
10 | 10 | <div class="row"> |
11 | 11 | <div class="col-md-12"> |
12 | - <a data-parent="#professors_accordion" data-toggle="collapse" href="#participants"> | |
12 | + <a data-parent="#professors_accordion" data-toggle="collapse" href="#group_participants"> | |
13 | 13 | <h4 class="panel-title"> |
14 | 14 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button><label for="{{ field.auto_id }}">{{ field.label }}</label> |
15 | 15 | </h4> |
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | </div> |
18 | 18 | </div> |
19 | 19 | </div> |
20 | - <div id="participants" class="panel-collapse collapse"> | |
20 | + <div id="group_participants" class="panel-collapse collapse"> | |
21 | 21 | <p><em>{% trans 'Attribute students to group' %}:</em></p> |
22 | 22 | {% render_field field class='form-control' %} |
23 | 23 | </div> | ... | ... |
subjects/templates/subjects/view.html
... | ... | @@ -195,9 +195,8 @@ |
195 | 195 | |
196 | 196 | list.animate({ |
197 | 197 | right : '-315px', |
198 | - opacity: 0, | |
199 | - 'z-index': '-1' | |
200 | - }, 500); | |
198 | + opacity: 0 | |
199 | + }, 500).css({visibility: 'hidden'}); | |
201 | 200 | |
202 | 201 | $this.removeClass('open'); |
203 | 202 | } else { |
... | ... | @@ -207,9 +206,8 @@ |
207 | 206 | |
208 | 207 | list.animate({ |
209 | 208 | right : 0, |
210 | - opacity: 1, | |
211 | - 'z-index': '1' | |
212 | - }, 500); | |
209 | + opacity: 1 | |
210 | + }, 500).css({visibility: 'visible'}); | |
213 | 211 | } |
214 | 212 | }); |
215 | 213 | }); | ... | ... |
topics/templates/topics/list.html
... | ... | @@ -54,12 +54,12 @@ |
54 | 54 | <ul class="dropdown-menu"> |
55 | 55 | <li><a href="{% url 'pdf_files:create' topic.slug %}"><i class="fa fa-file-pdf-o"></i> {% trans "PDF File" %}</a></li> |
56 | 56 | <li><a href="{% url 'youtube:create' topic.slug %}"><i class="fa fa-video-camera"></i> {% trans 'YouTube Video' %}</a></li> |
57 | - <li><a href="#"><i class="fa fa-comments-o"></i> {% trans 'Forum' %}</a></li> | |
57 | + <!-- <li><a href="#"><i class="fa fa-comments-o"></i> {% trans 'Forum' %}</a></li> --> | |
58 | 58 | <li><a href="{% url 'file_links:create' topic.slug %}"><i class="fa fa-file-archive-o"></i> {% trans 'File Link' %}</a></li> |
59 | 59 | <li><a href="{% url 'links:create' topic.slug %}" > <i class="fa fa-globe"></i> {% trans "Link to Website" %}</a> |
60 | 60 | <li><a href="{% url 'goals:create' topic.slug %}"><i class="fa fa-line-chart"></i> {% trans 'Topic Goals' %}</a></li> |
61 | 61 | <li><a href="{% url 'webpages:create' topic.slug %}"><i class="fa fa-file-code-o"></i> {% trans 'Webpage' %}</a></li> |
62 | - <li><a href="#"><i class="fa fa-question-circle-o"></i> {% trans 'Questionary' %}</a></li> | |
62 | + <!-- <li><a href="#"><i class="fa fa-question-circle-o"></i> {% trans 'Questionary' %}</a></li> --> | |
63 | 63 | <li><a href="{% url 'webconferences:create' topic.slug %}"><i class="fa fa-desktop"></i> {% trans 'Web Conference' %}</a></li> |
64 | 64 | |
65 | 65 | </ul> | ... | ... |
topics/views.py
... | ... | @@ -20,6 +20,8 @@ from subjects.models import Subject |
20 | 20 | from .models import Topic, Resource |
21 | 21 | from .forms import TopicForm |
22 | 22 | |
23 | +import operator | |
24 | + | |
23 | 25 | class CreateView(LoginRequiredMixin, LogMixin, generic.edit.CreateView): |
24 | 26 | log_component = 'topic' |
25 | 27 | log_action = 'create' |
... | ... | @@ -285,7 +287,16 @@ def getResourceCount(request): |
285 | 287 | else: |
286 | 288 | data[key] = 1 |
287 | 289 | |
290 | + data = [(key,value) for key,value in sorted(data.items(), key=operator.itemgetter(1), reverse=True)] | |
291 | + | |
292 | + others = data[4:] | |
293 | + total_others = 0 | |
294 | + for key,value in others: | |
295 | + total_others += value | |
296 | + | |
297 | + del data[4:] #remove from the 5th element | |
298 | + data.append(("others", total_others)) #so I have the sum of all other resources added up | |
288 | 299 | real_data = [] |
289 | - for item in data.items(): | |
290 | - real_data.append(item) | |
300 | + for key,value in data: | |
301 | + real_data.append((key,value)) | |
291 | 302 | return JsonResponse(real_data, safe=False) | ... | ... |