From af41a6538a46da3772f4d6304f6b0cb916a77657 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 13 Jul 2015 17:18:31 +0200 Subject: [PATCH] go back to 1.4 url style, add user score views --- .../exam/templates/exam/inc/script_list.html | 10 +-- .../templates/exam/messages/script_marked.txt | 2 +- teleforma/exam/templates/exam/quotas.html | 2 +- teleforma/exam/templates/exam/scores.html | 25 ++++++- .../exam/templates/exam/script_detail.html | 4 +- teleforma/exam/templates/exam/scripts.html | 17 ++--- teleforma/exam/urls.py | 3 +- teleforma/exam/views.py | 74 ++++++++++++++++--- teleforma/templates/postman/base.html | 10 +-- teleforma/templates/postman/base_folder.html | 12 +-- teleforma/templates/postman/view.html | 12 +-- .../templates/registration/activate.html | 2 +- .../registration/activation_complete.html | 2 +- .../registration/activation_email.html | 2 +- .../registration/activation_email.txt | 2 +- teleforma/templates/registration/login.html | 6 +- .../registration/password_reset_email.html | 2 +- teleforma/templates/teleforma/annals.html | 10 +-- teleforma/templates/teleforma/course.html | 2 +- .../teleforma/course_conference.html | 10 +-- .../teleforma/course_conference_audio.html | 6 +- .../teleforma/course_conference_record.html | 2 +- .../templates/teleforma/course_detail.html | 4 +- .../templates/teleforma/course_document.html | 4 +- .../templates/teleforma/course_media.html | 12 +-- .../teleforma/course_media_video_embed.html | 4 +- teleforma/templates/teleforma/courses.html | 8 +- .../teleforma/inc/conference_list.html | 4 +- .../teleforma/inc/document_list.html | 4 +- .../templates/teleforma/inc/media_list.html | 4 +- teleforma/templates/telemeta/base.html | 32 ++++---- teleforma/templates/telemeta/home.html | 2 +- .../telemeta/inc/module_revisions.html | 14 ++-- .../telemeta/inc/module_searches.html | 2 +- .../telemeta/inc/module_user_revisions.html | 4 +- .../templates/telemeta/inc/user_list.html | 6 +- teleforma/templates/telemeta/lists.html | 12 +-- teleforma/templates/telemeta/login.html | 4 +- .../templates/telemeta/profile_detail.html | 10 +-- .../templates/telemeta/search_criteria.html | 4 +- teleforma/templates/telemeta/users.html | 10 +-- 41 files changed, 215 insertions(+), 146 deletions(-) diff --git a/teleforma/exam/templates/exam/inc/script_list.html b/teleforma/exam/templates/exam/inc/script_list.html index 03e85424..622533c3 100644 --- a/teleforma/exam/templates/exam/inc/script_list.html +++ b/teleforma/exam/templates/exam/inc/script_list.html @@ -24,11 +24,11 @@ {% for script in object_list %} - {% if script.status != 2 %}{% endif %}{{ script.course.title }}{% if script.status != 2 %}{% endif %} - {% if script.status != 2 %}{% endif %}{{ script.session }}{% if script.status != 2 %}{% endif %} - {% if script.status != 2 %}{% endif %}{{ script.type }}{% if script.status != 2 %}{% endif %} - {% if script.author.username %}{{ script.author.last_name }}{% endif %} - {% if script.author.username %}{{ script.author.first_name }}{% endif %} + {% if script.status != 2 %}{% endif %}{{ script.course.title }}{% if script.status != 2 %}{% endif %} + {% if script.status != 2 %}{% endif %}{{ script.session }}{% if script.status != 2 %}{% endif %} + {% if script.status != 2 %}{% endif %}{{ script.type }}{% if script.status != 2 %}{% endif %} + {% if script.author.username %}{{ script.author.last_name }}{% endif %} + {% if script.author.username %}{{ script.author.first_name }}{% endif %} {{ script.date_added }} {% if script.date_marked %}{{ script.date_marked }}{% endif %} {% if script.corrector %}{{ script.corrector }}{% endif %} diff --git a/teleforma/exam/templates/exam/messages/script_marked.txt b/teleforma/exam/templates/exam/messages/script_marked.txt index f899c837..628853d0 100644 --- a/teleforma/exam/templates/exam/messages/script_marked.txt +++ b/teleforma/exam/templates/exam/messages/script_marked.txt @@ -4,7 +4,7 @@ Votre copie soumise le {{ script.date_added }} en {{ script.course }} pour la s La note, les commentaires et les annotations sont disponibles à cette adresse : -http://{{ site.domain }}{% url 'teleforma-exam-script-detail' script.period.id script.id %} +http://{{ site.domain }}{% url teleforma-exam-script-detail script.period.id script.id %} {% trans "Best regards" %}, {% trans "The site administrator" %} {% trans "of the" %} {% organization %} diff --git a/teleforma/exam/templates/exam/quotas.html b/teleforma/exam/templates/exam/quotas.html index ac6138f0..4f8b8ff2 100644 --- a/teleforma/exam/templates/exam/quotas.html +++ b/teleforma/exam/templates/exam/quotas.html @@ -30,7 +30,7 @@ {% for quota in object_list %} - {{ quota.corrector.username }} + {{ quota.corrector.username }} {{ quota.course.title }} {{ quota.date_start }} {{ quota.date_end }} diff --git a/teleforma/exam/templates/exam/scores.html b/teleforma/exam/templates/exam/scores.html index 97241647..5d3b71f2 100644 --- a/teleforma/exam/templates/exam/scores.html +++ b/teleforma/exam/templates/exam/scores.html @@ -1,9 +1,9 @@ {% extends "exam/scripts.html" %} +{% load i18n %} {% load telemeta_utils %} {% load teleforma_tags %} {% load static %} {% load nvd3_tags %} -{% load i18n %} {% block extra_javascript %} @@ -12,13 +12,32 @@ {% load_chart data.charttype data.chartdata data.chartcontainer data.extra %} {% endblock extra_javascript %} +{% block module-action %} + +
+

playlists{% trans "My courses" %}

+
+
    + {% with user|user_courses as courses %} + {% for c in courses %} + {% with c.course as course %} +
  • {{ course.title}} {{ course.type }}
  • + {% endwith %} + {% endfor %} + {% endwith %} +
+
+
+ +{% endblock module-action %} + {% block answers %}
-{% trans "Scores" %} +{% trans "Scores" %} : {{ course }}

-{% include_container data.chartcontainer 400 '100%' %} +{% include_container data.chartcontainer 600 '100%' %} {% endblock answers %} diff --git a/teleforma/exam/templates/exam/script_detail.html b/teleforma/exam/templates/exam/script_detail.html index 0f754f1a..813f605a 100644 --- a/teleforma/exam/templates/exam/script_detail.html +++ b/teleforma/exam/templates/exam/script_detail.html @@ -91,11 +91,11 @@
- {{ script.title }} + {{ script.title }}
{% if topic.file %} -  {% trans "Topic" %} +  {% trans "Topic" %} {% endif %} {% if script.score %} {% trans "Score" %} : {{ script.score|floatformat }}/20 diff --git a/teleforma/exam/templates/exam/scripts.html b/teleforma/exam/templates/exam/scripts.html index a059cdce..5d630ee3 100644 --- a/teleforma/exam/templates/exam/scripts.html +++ b/teleforma/exam/templates/exam/scripts.html @@ -18,27 +18,26 @@ {% block modules %} - -{% if upload %} {% block module-action %} +{% if upload %} -{% endblock module-action %} {% endif %} +{% endblock module-action %} {% endblock modules %} diff --git a/teleforma/exam/urls.py b/teleforma/exam/urls.py index 33512037..9f6dc360 100644 --- a/teleforma/exam/urls.py +++ b/teleforma/exam/urls.py @@ -54,7 +54,8 @@ urlpatterns = patterns('', url(r'^exam/periods/(?P.*)/scripts_pending/$', ScriptsPendingView.as_view(), name="teleforma-exam-scripts-pending"), url(r'^exam/periods/(?P.*)/scripts_treated/$', ScriptsTreatedView.as_view(), name="teleforma-exam-scripts-treated"), url(r'^exam/periods/(?P.*)/scripts_rejected/$', ScriptsRejectedView.as_view(), name="teleforma-exam-scripts-rejected"), - url(r'^exam/periods/(?P.*)/scripts_scores/$', ScriptsScoreView.as_view(), name="teleforma-exam-scripts-scores"), + url(r'^exam/periods/(?P.*)/scripts_scores_all/$', ScriptsScoreAllView.as_view(), name="teleforma-exam-scripts-scores-all"), + url(r'^exam/periods/(?P.*)/scripts_scores/(?P.*)/$', ScriptsScoreCourseView.as_view(), name="teleforma-exam-scripts-scores-course"), url(r'^exam/periods/(?P.*)/quotas/$', QuotasView.as_view(), name="teleforma-exam-quotas"), diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index c5eb2e87..a7a3a9ae 100644 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -8,6 +8,7 @@ from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.core.urlresolvers import reverse_lazy, reverse from django.utils.translation import ugettext_lazy as _ +import numpy as np class ScriptView(CourseAccessMixin, UpdateView): @@ -175,17 +176,18 @@ class QuotasView(ListView): return super(QuotasView, self).dispatch(*args, **kwargs) -class ScriptsScoreView(ScriptsTreatedView): +class ScriptsScoreAllView(ScriptsTreatedView): template_name='exam/scores.html' - def get_nvd3_data(self): - scripts = self.get_queryset() - xdata = [script.session for script in scripts] - ydata = [float(script.score) for script in scripts] - chartdata = {'x': xdata, 'name1': 'scores', 'y1': ydata} - charttype = "lineChart" - chartcontainer = 'linechart_container' + def get_score_data(self, xdata, y1data, y1title, y2data, y2title): + chartdata = {'x': xdata, + 'name1': y1title, 'y1': y1data, + 'name2': y2title, 'y2': y2data, + } + charttype = "multiBarChart" + chartcontainer = 'multibarchart_container' + extra_serie = {"tooltip": {"y_start": "There are ", "y_end": " calls"}} data = { 'charttype': charttype, 'chartdata': chartdata, @@ -199,7 +201,57 @@ class ScriptsScoreView(ScriptsTreatedView): return data def get_context_data(self, **kwargs): - context = super(ScriptsScoreView, self).get_context_data(**kwargs) - context['title'] = ugettext('Scores') - context['data'] = self.get_nvd3_data() + context = super(ScriptsScoreAllView, self).get_context_data(**kwargs) + scripts = self.get_queryset() + + sessions = [] + for script in scripts: + if not script.session in sessions: + sessions.append(script.session) + sessions = sorted(sessions) + + # user mean scores + user_scores = [] + for session in sessions: + user_scores.append(np.mean([float(script.score) for script in scripts.filter(session=session)])) + + # all user mean scores + all_user_score = [] + for session in sessions: + scripts = Script.objects.filter(session=session).exclude(score=None) + all_user_score.append(np.mean([s.score for s in scripts])) + + context['course'] = ugettext('all courses') + context['data'] = self.get_score_data(sessions, user_scores, 'moyenne personnelle', all_user_score, 'moyenne generale') + return context + + +class ScriptsScoreCourseView(ScriptsScoreAllView): + + def get_context_data(self, **kwargs): + context = super(ScriptsScoreCourseView, self).get_context_data(**kwargs) + course = Course.objects.get(id=self.kwargs['course_id']) + scripts = self.get_queryset() + scripts = scripts.filter(course=course) + + sessions = [] + for script in scripts: + if not script.session in sessions: + sessions.append(script.session) + sessions = sorted(sessions) + + # user mean scores + user_scores = [] + for session in sessions: + user_scores.append(np.mean([float(script.score) for script in scripts.filter(session=session)])) + + # all user mean scores + all_user_score = [] + for session in sessions: + scripts = Script.objects.filter(session=session, course=course).exclude(score=None) + all_user_score.append(np.mean([s.score for s in scripts])) + + context['course'] = course.title + context['data'] = self.get_score_data(sessions, user_scores, 'note personnelle', all_user_score, 'moyenne generale') return context + diff --git a/teleforma/templates/postman/base.html b/teleforma/templates/postman/base.html index 254de435..cc500fb3 100644 --- a/teleforma/templates/postman/base.html +++ b/teleforma/templates/postman/base.html @@ -12,15 +12,15 @@
diff --git a/teleforma/templates/postman/base_folder.html b/teleforma/templates/postman/base_folder.html index e089c004..a46c0661 100644 --- a/teleforma/templates/postman/base_folder.html +++ b/teleforma/templates/postman/base_folder.html @@ -47,13 +47,13 @@ - {% block pm_sender_cell %}{% if message.is_new %}{% endif %}{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% if message.is_new %}{% endif %}{% endblock %} + {% block pm_sender_cell %}{% if message.is_new %}{% endif %}{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% if message.is_new %}{% endif %}{% endblock %} - {% block pm_recipient_cell %}{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% endblock %} + {% block pm_recipient_cell %}{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% endblock %} {% if message.is_new %}{% endif %}{% if message.is_replied %}{% endif %} {% block pm_subject %} - + {% include "postman/inc_subject_ex.html" %} {% endblock %} {% if message.is_replied %}{% endif %}{% if message.is_new %}{% endif %} @@ -66,13 +66,13 @@
{% block pm_form_buttons %} {% block pm_delete_button %} -{% trans "Delete" %} +{% trans "Delete" %} {% endblock %} {% block pm_archive_button %} -{% trans "Archive" %} +{% trans "Archive" %} {% endblock %} {% block pm_undelete_button %} -{% trans "Undelete" %} +{% trans "Undelete" %} {% endblock %} {% endblock %} diff --git a/teleforma/templates/postman/view.html b/teleforma/templates/postman/view.html index 78bff28b..7822482a 100644 --- a/teleforma/templates/postman/view.html +++ b/teleforma/templates/postman/view.html @@ -14,10 +14,10 @@ {% for message in pm_messages %}
- + {{ message.obfuscated_sender|or_me:user }} » - + {{ message.obfuscated_recipient|or_me:user }} | {{ message.sent_at|date:"DATETIME_FORMAT"}} | @@ -36,19 +36,19 @@ {% trans "Back" %} {% block pm_delete_button %} -{% trans "Delete" %} +{% trans "Delete" %} {% endblock %} {% block pm_archive_button %} {% if not archived %} -{% trans "Archive" %} +{% trans "Archive" %} {% endif %} {% endblock %} -{% if reply_to_pk %}{% trans "Reply" %}{% endif %} +{% if reply_to_pk %}{% trans "Reply" %}{% endif %} {% if reply_to_pk %}

{% trans 'Reply' %}

-
{% csrf_token %} +{% csrf_token %}
{{ form.body }}

{% trans "Reply" %} diff --git a/teleforma/templates/registration/activate.html b/teleforma/templates/registration/activate.html index 4f3bdbe2..6cf22cbc 100644 --- a/teleforma/templates/registration/activate.html +++ b/teleforma/templates/registration/activate.html @@ -2,7 +2,7 @@ {% load i18n %} {% block title %}{% if account %}{% trans "Activation complete" %}{% else %}{% trans "Activation problem" %}{% endif %}{% endblock %} {% block content %} -{% url 'auth_login' as auth_login_url %} +{% url auth_login as auth_login_url %} {% if account %} {% blocktrans %} Thanks {{ account }}, activation complete! diff --git a/teleforma/templates/registration/activation_complete.html b/teleforma/templates/registration/activation_complete.html index c2ab8dd6..2082f775 100644 --- a/teleforma/templates/registration/activation_complete.html +++ b/teleforma/templates/registration/activation_complete.html @@ -2,7 +2,7 @@ {% load i18n %} {% block title %}{% trans "Activation complete" %}{% endblock %} {% block content %} -{% url 'auth_login' as auth_login_url %} +{% url auth_login as auth_login_url %} {% blocktrans %} Thanks, activation complete! You may now login using the username and password you set at registration. {% endblocktrans %} diff --git a/teleforma/templates/registration/activation_email.html b/teleforma/templates/registration/activation_email.html index c6ebc265..8483b4a9 100644 --- a/teleforma/templates/registration/activation_email.html +++ b/teleforma/templates/registration/activation_email.html @@ -4,7 +4,7 @@ This template is used for the html alternative of the activation email if you use a django-registration backend that looks for it. e.g. https://github.com/huseyinyilmaz/django-registration-extended-backend {% endcomment %} -{% url 'registration_activate' activation_key as activation_key_url %} +{% url registration_activate activation_key as activation_key_url %} {% blocktrans with sitename=site.name sitedomain=site.domain%}

Account registration for {{ sitename }}

diff --git a/teleforma/templates/registration/activation_email.txt b/teleforma/templates/registration/activation_email.txt index 9ca54b3c..c29561fa 100644 --- a/teleforma/templates/registration/activation_email.txt +++ b/teleforma/templates/registration/activation_email.txt @@ -1,5 +1,5 @@ {% load i18n %} -{% url 'registration_activate' activation_key as activation_key_url%} +{% url registration_activate activation_key as activation_key_url%} {% blocktrans with sitename=site.name siteurl=site.domain %} You (or someone pretending to be you) have asked to register an account at {{ sitename }}. If this wasn't you, please ignore this email diff --git a/teleforma/templates/registration/login.html b/teleforma/templates/registration/login.html index 2fd6edb6..f8ceae74 100644 --- a/teleforma/templates/registration/login.html +++ b/teleforma/templates/registration/login.html @@ -2,14 +2,14 @@ {% load i18n %} {% block title %}{% trans "Login" %}{% endblock %} {% block content %} -{% url 'auth_password_reset' as auth_pwd_reset_url %} -{% url 'registration_register' as register_url%} +{% url auth_password_reset as auth_pwd_reset_url %} +{% url registration_register as register_url%} {% if form.errors %}

{% blocktrans %}Your username and password didn't match. Please try again.{% endblocktrans %}

{% endif %} -{% csrf_token %} +{% csrf_token %} diff --git a/teleforma/templates/registration/password_reset_email.html b/teleforma/templates/registration/password_reset_email.html index 287737fb..c59f65a1 100644 --- a/teleforma/templates/registration/password_reset_email.html +++ b/teleforma/templates/registration/password_reset_email.html @@ -7,7 +7,7 @@ wish to reset your password, please ignore this message. To reset your password, please click the following link, or copy and paste it into your web browser:{% endblocktrans %} -{{ protocol }}://{{ domain }}{% url 'auth_password_reset_confirm' uid token %} +{{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uid token %} {% blocktrans with username=user.username %} Your username, in case you've forgotten: {{ username }} diff --git a/teleforma/templates/teleforma/annals.html b/teleforma/templates/teleforma/annals.html index 2d481f42..2e0c8f5b 100644 --- a/teleforma/templates/teleforma/annals.html +++ b/teleforma/templates/teleforma/annals.html @@ -12,13 +12,13 @@
-

playlists{% trans "My courses" %}

+

playlists{% trans "My courses" %}

{% for doc in docs %} - + - + {% endfor %} diff --git a/teleforma/templates/teleforma/course.html b/teleforma/templates/teleforma/course.html index cfda3e84..65d2f05d 100644 --- a/teleforma/templates/teleforma/course.html +++ b/teleforma/templates/teleforma/course.html @@ -36,7 +36,7 @@ {% for media in course.media.all %} - + diff --git a/teleforma/templates/teleforma/course_conference.html b/teleforma/templates/teleforma/course_conference.html index 7e931c48..bbdd17ed 100644 --- a/teleforma/templates/teleforma/course_conference.html +++ b/teleforma/templates/teleforma/course_conference.html @@ -10,7 +10,7 @@ var conferenceUtils = { stop : function(id){ json([id],'teleforma.stop_conference',function(){ - location.href = '{% url 'teleforma-conference-record' %}'; + location.href = '{% url teleforma-conference-record %}'; } ); }} @@ -34,10 +34,10 @@
-{{ course.title }} - {{ type }} - {% trans "Session" %} {{ conference.session }} +{{ course.title }} - {{ type }} - {% trans "Session" %} {{ conference.session }}
@@ -67,10 +67,10 @@
{% if conference.professor %} -
{% trans "Course" %}
{{ conference.course.title }} - {{ conference.course_type }}
+
{% trans "Course" %}
{{ conference.course.title }} - {{ conference.course_type }}
{% trans "Session" %}
{{ conference.session }}
{% trans "Professor" %}
-
{{ conference.professor }}
+
{{ conference.professor }}
{% endif %} {% if conference.comment %}
{% trans "Comment" %}
{{ conference.comment }}
{% endif %}
{% trans "Begin date" %}
{{ conference.date_begin }}
diff --git a/teleforma/templates/teleforma/course_conference_audio.html b/teleforma/templates/teleforma/course_conference_audio.html index 19783fa1..bdd06489 100644 --- a/teleforma/templates/teleforma/course_conference_audio.html +++ b/teleforma/templates/teleforma/course_conference_audio.html @@ -8,7 +8,7 @@ var conferenceUtils = { stop : function(id){ json([id],'teleforma.conference_stop',function(){ - location.href = '{% url 'teleforma-conference-record' %}';}); + location.href = '{% url teleforma-conference-record %}';}); }} jQuery(window).ready(function(){ @@ -33,7 +33,7 @@
{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %} - {{ conference.session }} - {{ conference.professor }} @@ -64,7 +64,7 @@
{% trans "Title" %}
{{ conference.course.title }}
-
{% trans "Professor" %}
{{ conference.professor }}
+
{% trans "Professor" %}
{{ conference.professor }}
{% trans "Session" %}
{{ conference.session }}
{% trans "Room" %}
{{ conference.room }}
{% trans "Begin" %}
{{ conference.date_begin }}
diff --git a/teleforma/templates/teleforma/course_conference_record.html b/teleforma/templates/teleforma/course_conference_record.html index d1c44e26..de39e9fb 100644 --- a/teleforma/templates/teleforma/course_conference_record.html +++ b/teleforma/templates/teleforma/course_conference_record.html @@ -16,7 +16,7 @@ jQuery(window).ready(function(){ diff --git a/teleforma/templates/teleforma/course_detail.html b/teleforma/templates/teleforma/course_detail.html index 6d15b3de..07ae0873 100644 --- a/teleforma/templates/teleforma/course_detail.html +++ b/teleforma/templates/teleforma/course_detail.html @@ -4,7 +4,7 @@ {% block extra_javascript %} {% endblock extra_javascript %} @@ -12,7 +12,7 @@ $(document).ready(function(){ {% block courses %} {% for c in all_courses %} {% with c.course as course %} -
  • {{ course.title }}
  • +
  • {{ course.title }}
  • {% endwith %} {% endfor %} {% endblock courses %} diff --git a/teleforma/templates/teleforma/course_document.html b/teleforma/templates/teleforma/course_document.html index ef780a44..9a33fbb9 100644 --- a/teleforma/templates/teleforma/course_document.html +++ b/teleforma/templates/teleforma/course_document.html @@ -7,7 +7,7 @@ @@ -23,7 +23,7 @@ $(document).ready(function(){ // // Fetch the PDF document from the URL using promices // -PDFJS.getDocument('{% url 'teleforma-document-download' document.id %}').then(function(pdf) { +PDFJS.getDocument('{% url teleforma-document-download document.id %}').then(function(pdf) { // Using promise to fetch the page pdf.getPage(1).then(function(page) { var scale = 1.5; diff --git a/teleforma/templates/teleforma/course_media.html b/teleforma/templates/teleforma/course_media.html index 6b7ead0e..076032c6 100644 --- a/teleforma/templates/teleforma/course_media.html +++ b/teleforma/templates/teleforma/course_media.html @@ -13,7 +13,7 @@ @@ -73,17 +73,17 @@ $(document).ready(function(){ @@ -131,11 +131,11 @@ $(document).ready(function(){
    {% if media.conference %} -
    {% trans "Course" %}
    {{ media.course.title }} - {{ media.course_type }}
    +
    {% trans "Course" %}
    {{ media.course.title }} - {{ media.course_type }}
    {% trans "Session" %}
    {{ media.conference.session }}
    {% if media.conference.professor %}
    {% trans "Professor" %}
    -
    {{ media.conference.professor }}
    +
    {{ media.conference.professor }}
    {% endif %} {% if media.conference.comment %}
    {% trans "Comment" %}
    {{ media.conference.comment }}
    {% endif %}
    {% trans "Begin date" %}
    {{ media.conference.date_begin }}
    diff --git a/teleforma/templates/teleforma/course_media_video_embed.html b/teleforma/templates/teleforma/course_media_video_embed.html index b63c9899..6e422a60 100644 --- a/teleforma/templates/teleforma/course_media_video_embed.html +++ b/teleforma/templates/teleforma/course_media_video_embed.html @@ -30,11 +30,11 @@
    {% if media.conference %} -
    {% trans "Course" %}
    {{ media.course.title }} - {{ media.course_type }}
    +
    {% trans "Course" %}
    {{ media.course.title }} - {{ media.course_type }}
    {% trans "Session" %}
    {{ media.conference.session }}
    {% if media.conference.professor %}
    {% trans "Professor" %}
    -
    {{ media.conference.professor }}
    +
    {{ media.conference.professor }}
    {% endif %} {% if media.conference.comment %}
    {% trans "Comment" %}
    {{ media.conference.comment }}
    {% endif %}
    {% trans "Begin date" %}
    {{ media.conference.date_begin }}
    diff --git a/teleforma/templates/teleforma/courses.html b/teleforma/templates/teleforma/courses.html index a00b8039..2c15236d 100644 --- a/teleforma/templates/teleforma/courses.html +++ b/teleforma/templates/teleforma/courses.html @@ -7,7 +7,7 @@ {% block extra_javascript %} {% endblock extra_javascript %} @@ -26,7 +26,7 @@ $(document).ready(function(){ {% block courses %} {% for c in all_courses %} {% with c.course as course %} -
  • {{ course.title }}
  • +
  • {{ course.title }}
  • {% endwith %} {% endfor %} {% endblock courses %} @@ -39,7 +39,7 @@ $(document).ready(function(){ {% get_telecaster as telecaster %} {% if telecaster %} {% endif %} {% endblock module-action %} @@ -73,7 +73,7 @@ $(document).ready(function(){ {% for type in c.types %}
    {% block conference %} diff --git a/teleforma/templates/teleforma/inc/conference_list.html b/teleforma/templates/teleforma/inc/conference_list.html index 418cbfce..76e97b1a 100644 --- a/teleforma/templates/teleforma/inc/conference_list.html +++ b/teleforma/templates/teleforma/inc/conference_list.html @@ -15,7 +15,7 @@
    {% if stream.streaming %} @@ -25,7 +25,7 @@
    {% trans "Title" %}
    {{ stream.conference.course.title }}
    {% trans "Session" %}
    {{ stream.conference.session }}
    {% if stream.conference.professor.user.username %} -
    {% trans "Professor" %}
    {{ stream.conference.professor }}
    +
    {% trans "Professor" %}
    {{ stream.conference.professor }}
    {% endif %}
    {% trans "Begin" %}
    {{ stream.conference.date_begin }}
    diff --git a/teleforma/templates/teleforma/inc/document_list.html b/teleforma/templates/teleforma/inc/document_list.html index e2964586..4c649158 100644 --- a/teleforma/templates/teleforma/inc/document_list.html +++ b/teleforma/templates/teleforma/inc/document_list.html @@ -17,9 +17,9 @@ {% if doc.course_type.all|length > 1 and type_counter > 1 %} {% else %} - + - + {% endif %} {% endfor %} diff --git a/teleforma/templates/teleforma/inc/media_list.html b/teleforma/templates/teleforma/inc/media_list.html index b4140630..400cc1ba 100644 --- a/teleforma/templates/teleforma/inc/media_list.html +++ b/teleforma/templates/teleforma/inc/media_list.html @@ -14,7 +14,7 @@ {% if media.type == 'webm' %}
    {% trans form.username.label_tag %}
    {% if doc.file %}{% endif %} {{ doc.title }}{% if doc.file %}{% endif %}{% if doc.file %}{% endif %} {{ doc.title }}{% if doc.file %}{% endif %} {{ year }}{% if doc.file %}{% endif %}{% if doc.file %}{% endif %}
    {{ media.item.title }}{{ media.item.title }} {{ media.item.description }} {{ media.date_added }}
    - + {% trans 'Click here' %}
    {% if doc.file %}{% endif %} {{ doc.title }}{% if doc.file %}{% endif %}{% if doc.file %}{% endif %} {{ doc.title }}{% if doc.file %}{% endif %} {{ doc.date_added }}{% if doc.file %}{% endif %}{% if doc.file %}{% endif %}
    - + {% if media.item.related.all %} {% for related in media.item.related.all %} {% if related.title == "preview" %} @@ -36,7 +36,7 @@
    {% trans "Title" %}
    {{ media.conference.course.title }}
    {% trans "Session" %}
    {{ media.conference.session }}
    {% if media.conference.professor %} -
    {% trans "Professor" %}
    {{ media.conference.professor }}
    +
    {% trans "Professor" %}
    {{ media.conference.professor }}
    {% endif %}
    {% trans "Begin" %}
    {{ media.conference.date_begin }}
    {% if media.conference.comment %} diff --git a/teleforma/templates/telemeta/base.html b/teleforma/templates/telemeta/base.html index 692eb975..97d4c434 100644 --- a/teleforma/templates/telemeta/base.html +++ b/teleforma/templates/telemeta/base.html @@ -25,7 +25,6 @@ {% block stylesheets %} - + diff --git a/teleforma/templates/telemeta/search_criteria.html b/teleforma/templates/telemeta/search_criteria.html index 26ca809e..bfee8ac2 100644 --- a/teleforma/templates/telemeta/search_criteria.html +++ b/teleforma/templates/telemeta/search_criteria.html @@ -32,7 +32,7 @@ function update_period(source, from_field, to_field) { } $(document).ready(function () { - $('#location').autocomplete('{% url 'telemeta-complete-location' %}', { + $('#location').autocomplete('{% url telemeta-complete-location %}', { max: 20, formatResult: function(data) { return data[0].replace(/ *\([0-9]+.*\) *$/, ''); @@ -75,7 +75,7 @@ $(document).ready(function () {

    {% trans "Advanced Search" %}

    -{% csrf_token %} +{% csrf_token %}

    diff --git a/teleforma/templates/telemeta/users.html b/teleforma/templates/telemeta/users.html index 52e000aa..3409b83a 100644 --- a/teleforma/templates/telemeta/users.html +++ b/teleforma/templates/telemeta/users.html @@ -17,7 +17,7 @@

    @@ -30,7 +30,7 @@ @@ -43,7 +43,7 @@
      {% block courses %} {% for c in courses %} -
    • {{ c }}
    • +
    • {{ c }}
    • {% endfor %} {% endblock courses %}
    @@ -52,7 +52,7 @@ {% if users %} {% endif %} @@ -62,7 +62,7 @@ {% if user.is_staff %} {% endif %} -- 2.39.5