From 819879677550aa7ee7967585501a71c0f53689af Mon Sep 17 00:00:00 2001 From: yomguy Date: Mon, 17 Dec 2012 17:24:03 +0100 Subject: [PATCH] update answer management --- teleforma/static/teleforma/css/teleforma.css | 2 +- teleforma/static/teleforma/js/application.js | 1 + .../templates/teleforma/answer_detail.html | 47 +++++++++++++ .../templates/teleforma/answer_form.html | 3 +- teleforma/templates/teleforma/answers.html | 70 +++++++++++++++++++ .../templates/teleforma/inc/answer_list.html | 48 +++++++++++++ .../templates/teleforma/seminar_detail.html | 9 +-- .../teleforma/seminar_media_video.html | 36 +++++----- teleforma/templates/teleforma/seminars.html | 6 +- teleforma/templates/telemeta/base.html | 8 +-- teleforma/templatetags/teleforma_tags.py | 4 ++ teleforma/urls.py | 2 + teleforma/views/pro.py | 61 ++++++++++++++++ 13 files changed, 264 insertions(+), 33 deletions(-) create mode 100644 teleforma/templates/teleforma/answer_detail.html create mode 100644 teleforma/templates/teleforma/answers.html create mode 100644 teleforma/templates/teleforma/inc/answer_list.html diff --git a/teleforma/static/teleforma/css/teleforma.css b/teleforma/static/teleforma/css/teleforma.css index 03cb3fb5..bb473a95 100644 --- a/teleforma/static/teleforma/css/teleforma.css +++ b/teleforma/static/teleforma/css/teleforma.css @@ -1488,7 +1488,7 @@ input,textarea{ .course_description { background-color: #FFF; - padding: 0em 1em 1em 1em; + padding: 0em 1em 0.5em 1em; -moz-border-radius: 8px 0px 8px 8px; -webkit-border-radius: 8px 0px 8px 8px; border-radius: 8px 0px 8px 8px; diff --git a/teleforma/static/teleforma/js/application.js b/teleforma/static/teleforma/js/application.js index 4187e27a..6d1a9478 100644 --- a/teleforma/static/teleforma/js/application.js +++ b/teleforma/static/teleforma/js/application.js @@ -28,3 +28,4 @@ var rainbow = new Rainbow(); rainbow.setSpectrum('#bb0000', '#e65911', '#f3ad17', 'green'); + diff --git a/teleforma/templates/teleforma/answer_detail.html b/teleforma/templates/teleforma/answer_detail.html new file mode 100644 index 00000000..68a1b393 --- /dev/null +++ b/teleforma/templates/teleforma/answer_detail.html @@ -0,0 +1,47 @@ +{% extends "teleforma/seminar_detail.html" %} +{% load teleforma_tags %} +{% load i18n %} + +{% block extra_javascript %} + + +{% endblock extra_javascript %} + + +{% block course_content %} + +
+
+

{{ answer.question|safe }}

+
+
+ {{ answer.question.question|safe }} +
+
+ +
+ +
+
+

{% trans "Answer" %}

+
+
+ {{ answer.answer|safe }} +
+
+ +
+ +{% if user.is_staff %} +{% trans " validate" %} +{% trans " reject" %} +{% endif %} + +{% endblock course_content %} + + +{% block progress %} +{% endblock progress %} + diff --git a/teleforma/templates/teleforma/answer_form.html b/teleforma/templates/teleforma/answer_form.html index 14e4f9fc..e1e704dc 100644 --- a/teleforma/templates/teleforma/answer_form.html +++ b/teleforma/templates/teleforma/answer_form.html @@ -55,11 +55,12 @@ $(document).ready(function(){ {{ form }} +{% if status != 3 %}
{% trans "Save" %} - {% trans "Submit it" %} +{% endif %} {% endblock course_content %} diff --git a/teleforma/templates/teleforma/answers.html b/teleforma/templates/teleforma/answers.html new file mode 100644 index 00000000..b9bd6e7a --- /dev/null +++ b/teleforma/templates/teleforma/answers.html @@ -0,0 +1,70 @@ +{% extends "telemeta/base.html" %} +{% load i18n %} +{% load telemeta_utils %} +{% load teleforma_tags %} + +{% block head_title %}{% trans "Answers" %} - {{ block.super }}{% endblock %} + +{% block title %} +{% endblock %} + + +{% block infra_javascript %} + +{% endblock infra_javascript %} + +{% block content %} + +
+ +{% block modules %} +
+ +

playlists{% trans "My seminars" %}

+
+
    +{% block courses %} +{% for seminar in all_seminars %} +
  • {{ seminar.title }}
  • + {% endfor %} +{% endblock courses %} +
+
+
+ +
+{% endblock modules %} + +
+ +{% if user.is_staff %} +
+
+{% endif %} + +
{% trans "Answers" %}
+
+ {% if object_list %} + {% include "teleforma/inc/answer_list.html" %} + {% else %} +

{% trans "No answer" %}

+ {% endif %} +
+{% endblock %} diff --git a/teleforma/templates/teleforma/inc/answer_list.html b/teleforma/templates/teleforma/inc/answer_list.html new file mode 100644 index 00000000..5ef4a36b --- /dev/null +++ b/teleforma/templates/teleforma/inc/answer_list.html @@ -0,0 +1,48 @@ +{% load i18n %} +{% load telemeta_utils %} +{% load teleforma_tags %} +{% load pagination_tags %} + + + +
+ + + + + + + + + + + + {% for answer in page.object_list %} + + + + + + + + + + {% endfor %} + +
{% trans "Last Name"%}{% trans "First Name"%}{% trans "Seminar"%}{% trans "Date submitted"%}{% trans "Summary"%}{% trans "Action / status"%}
{{ answer.user.last_name }}{{ answer.user.first_name }}{{ answer.question.seminar }}{{ answer.date_submitted }}{{ answer.answer|summary:120 }}{% if user.is_staff %} + + {% if answer.validated %}{% trans " validated" %}{% else %}{% trans " rejected" %}{% endif %} + {% endif %} +
+
diff --git a/teleforma/templates/teleforma/seminar_detail.html b/teleforma/templates/teleforma/seminar_detail.html index 75b64b41..8f57d6b6 100644 --- a/teleforma/templates/teleforma/seminar_detail.html +++ b/teleforma/templates/teleforma/seminar_detail.html @@ -23,7 +23,6 @@ $(function() { $('#progressbar-seminar div').css({"background": color}); }); - {% endblock infra_javascript %} @@ -38,7 +37,7 @@ $(function() {
{% if seminar_progress == 100 %} - {% trans " validated" %} + {% trans {% endif %}
@@ -51,8 +50,8 @@ $(function() {

{% trans "Informations" %}

-
-
+
+
{% if seminar.keywords.all %}
{% trans "keywords" %}
{% for kw in seminar.keywords.all %}{{ kw }}, {% endfor %}
{% endif %}
{% trans "level" %}
{{ seminar.level }}
{% trans "public concerned" %}
{{ seminar.concerned }}
@@ -114,6 +113,8 @@ $(function() { {% include "teleforma/inc/question_list.html" %} {% endwith %} {% else %} + + {% with _("Step 4 : answer to the following question") as title %} {% include "teleforma/inc/question_list.html" %} {% endwith %} diff --git a/teleforma/templates/teleforma/seminar_media_video.html b/teleforma/templates/teleforma/seminar_media_video.html index 55973787..af88f02a 100644 --- a/teleforma/templates/teleforma/seminar_media_video.html +++ b/teleforma/templates/teleforma/seminar_media_video.html @@ -12,16 +12,17 @@ {% if user.is_staff %} {% endif %} diff --git a/teleforma/templates/teleforma/seminars.html b/teleforma/templates/teleforma/seminars.html index 94529584..f8717681 100644 --- a/teleforma/templates/teleforma/seminars.html +++ b/teleforma/templates/teleforma/seminars.html @@ -7,7 +7,7 @@