From: yomguy Date: Mon, 21 Jan 2013 16:29:48 +0000 (+0100) Subject: update answer validated and rejected messages, styles X-Git-Tag: 0.9-probarreau~120 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=661e3332e4ba2f8d24ea8bc1ca60716906723ac1;p=teleforma.git update answer validated and rejected messages, styles --- diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 01676e07..3a945420 100644 Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ diff --git a/teleforma/locale/fr/LC_MESSAGES/django.po b/teleforma/locale/fr/LC_MESSAGES/django.po index 71f4eb03..45bc4166 100644 --- a/teleforma/locale/fr/LC_MESSAGES/django.po +++ b/teleforma/locale/fr/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-17 17:49+0100\n" +"POT-Creation-Date: 2013-01-21 17:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Guillaume Pellerin \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1)\n" #: models/ae.py:46 models/core.py:202 models/crfpa.py:108 models/crfpa.py:146 -#: models/pro.py:142 models/pro.py:186 models/pro.py:201 +#: models/pro.py:142 models/pro.py:186 models/pro.py:201 models/pro.py:238 msgid "user" msgstr "utilisateur" @@ -56,11 +56,11 @@ msgstr "Publié" #: models/core.py:85 msgid "Mr." -msgstr "Mr" +msgstr "Monsieur" #: models/core.py:85 msgid "Mrs." -msgstr "Mme" +msgstr "Madame" #: models/core.py:94 models/core.py:106 models/core.py:129 models/core.py:141 #: models/core.py:186 models/core.py:223 models/core.py:327 models/crfpa.py:47 @@ -193,6 +193,7 @@ msgid "credits" msgstr "crédits" #: models/core.py:310 models/pro.py:96 models/pro.py:149 models/pro.py:192 +#: models/pro.py:239 msgid "date added" msgstr "date d'ajout" @@ -400,7 +401,7 @@ msgstr "formulaire" msgid "Seminar" msgstr "Sémimaire" -#: models/pro.py:122 models/pro.py:185 +#: models/pro.py:122 models/pro.py:185 models/pro.py:237 msgid "seminar" msgstr "séminaire" @@ -420,12 +421,12 @@ msgstr "status" msgid "Question" msgstr "Question" -#: models/pro.py:144 +#: models/pro.py:144 views/pro.py:291 msgid "answer" msgstr "réponse" #: models/pro.py:146 templates/teleforma/seminar_detail.html:50 -#: templates/teleforma/seminars.html:98 +#: templates/teleforma/seminars.html:98 views/pro.py:292 msgid "validated" msgstr "validé" @@ -437,7 +438,7 @@ msgstr "date de soumission" msgid "date validated" msgstr "date de validation" -#: models/pro.py:162 templates/teleforma/answer_detail.html:28 +#: models/pro.py:162 templates/teleforma/answer_detail.html:43 #: templates/teleforma/answer_form.html:105 msgid "Answer" msgstr "Réponse" @@ -456,7 +457,7 @@ msgstr "Modèle d'attestation" #: models/pro.py:196 templates/teleforma/seminar_testimonial.html:13 #: templates/teleforma/inc/testimonial_list.html:7 -#: templates/teleforma/inc/testimonial_step.html:7 views/pro.py:502 +#: templates/teleforma/inc/testimonial_step.html:7 views/pro.py:582 msgid "Testimonial" msgstr "Attestation" @@ -484,6 +485,14 @@ msgstr "Fax" msgid "Auditor" msgstr "Auditeur" +#: models/pro.py:246 +msgid "Seminar revision" +msgstr "Révision des sémimaires" + +#: models/pro.py:247 +msgid "Seminar revisions" +msgstr "Révisions des sémimaires" + #: templates/404.html:10 msgid "Page not found" msgstr "Page non trouvée" @@ -750,11 +759,11 @@ msgstr "" msgid "Write" msgstr "" -#: templates/teleforma/answer_detail.html:38 +#: templates/teleforma/answer_detail.html:53 msgid " validate" msgstr "valider" -#: templates/teleforma/answer_detail.html:39 +#: templates/teleforma/answer_detail.html:54 msgid " reject" msgstr " rejeter" @@ -929,7 +938,8 @@ msgstr "Audio" #: templates/teleforma/course_conference.html:70 #: templates/teleforma/course_media.html:130 -#: templates/teleforma/seminar_testimonial.html:38 +#: templates/teleforma/seminar_testimonial.html:38 views/pro.py:320 +#: views/pro.py:362 msgid "Course" msgstr "Matière" @@ -1264,42 +1274,120 @@ msgstr "validé" msgid "duration" msgstr "durée" -#: templates/teleforma/messages/answer_rejected.txt:2 +#: templates/teleforma/messages/answer_rejected.txt:1 +#, python-format msgid "" -"Sorry!\n" +"%(gender)s %(lastname)s,\n" +"\n" +"We are sorry we cannot validate your answer n°%(rank)s of the e-learning " +"seminar \"%(title)s\".\n" "\n" -"Your answer has been rejected. \n" -"You can work and try again following this link:\n" +"This validation is a requisite to allow us to deliver you a testimonial for " +"this training. However, your submitted answer can not be taken into account. " +"We encourage you to complete your answer following this link:\n" +"\n" +"http://%(domain)s%(path)s\n" +"\n" +"We remind you that you absolutely need to terminate your training before " +"%(date)s.\n" +"\n" +"The team of the %(organization)s thank you for your confidence and we remain " +"at your disposal for further information.\n" msgstr "" -"Nous sommes désolés!\n" +"%(gender)s %(lastname)s,\n" +"\n" +"Nous sommes au regret de ne pouvoir valider votre réponse à la consultation n" +"°%(rank)s du séminaire e-learning \"%(title)s\".\n" "\n" -"Votre consultation n'a pas été validée.\n" -"Vous pouvez la re-travailler et la soumettre en suivant ce lien :\n" +"En effet, la validation des acquis de la formation e-learning que vous avez " +"suivie est une étape nécessaire pour permettre à Pro-Barreau de vous " +"délivrer une attestation de formation. Pour valider cette étape, vous devez " +"répondre aux consultations fictives. Or, la réponse soumise ne peut être " +"prise en compte. Aussi, nous prions-vous de bien vouloir compléter votre " +"réponse en suivant ce lien :\n" +"\n" +"http://%(domain)s%(path)s\n" +"\n" +"Nous vous rappelons que vous devez impérativement achever toutes les étapes " +"de votre formation avant le %(date)s.\n" +"\n" +"L’équipe e-learning de %(organization)s vous remercie de votre confiance et " +"reste à votre disposition pour renseignement complémentaire.\n" -#: templates/teleforma/messages/answer_validated.txt:2 +#: templates/teleforma/messages/answer_validated.txt:1 +#, python-format msgid "" -"Congratulations!\n" +"%(gender)s %(lastname)s,\n" +"\n" +"Your answer to the question n°%(rank)s of the e-learning seminar \"%(title)s" +"\" has been validated.\n" +"\n" +"You can now continue to next step following this link:\n" +"\n" +"http://%(domain)s%(path)s\n" "\n" -"Your answer has been validated. \n" -"You can go to the next step of your seminar following this link:\n" +"We remind you that you absolutely need to terminate all steps of your " +"training before %(date)s.\n" +"\n" +"The team of the %(organization)s thank you for your confidence and we remain " +"at your disposal for further information.\n" msgstr "" -"Félicitations!\n" +"%(gender)s %(lastname)s,\n" +"\n" +"Votre réponse à la consultation n°%(rank)s du séminaire e-learning " +"\"%(title)s\" a été validée.\n" +"\n" +"Vous pouvez dès à présent poursuivre votre formation en passant à l’étape " +"suivante, en suivant ce lien :\n" +"\n" +"http://%(domain)s%(path)s\n" "\n" -"Votre dernière consultation a été validée.\n" -"Vous pouvez accéder à la prochaine étape de votre séminaire en suivant ce " -"lien :\n" +"Nous vous rappelons que vous devez impérativement achever toutes les étapes " +"de votre formation avant le %(date)s.\n" +"\n" +"L’équipe e-learning de %(organization)s vous remercie de votre confiance et " +"reste à votre disposition pour renseignement complémentaire.\n" -#: templates/teleforma/messages/seminar_validated.txt:2 +#: templates/teleforma/messages/seminar_validated.txt:1 +#, python-format msgid "" -"Congratulations!\n" +"%(gender)s %(lastname)s,\n" +"\n" +"Your answer to the question n°%(rank)s of the e-learning seminar \"%(title)s" +"\" has been validated.\n" "\n" -"Your seminar has been validated. \n" -"You can now download the training testimonial following this link:\n" +"You have then achieved the step 4 of your training.\n" +"\n" +"Now read the corrected document of all questions (step 5) and evaluate the " +"training (step 6) in order to obtain your testimonial (step 7) following " +"this link:\n" +"\n" +"http://%(domain)s%(path)s\n" +"\n" +"We remind you that you absolutely need to terminate all steps of your " +"training before %(date)s.\n" +"\n" +"The team of the %(organization)s thank you for your confidence and we remain " +"at your disposal for further information.\n" msgstr "" -"Félicitations!\n" +"%(gender)s %(lastname)s,\n" +"\n" +"Votre réponse à la consultation n°%(rank)s du séminaire e-learning " +"\"%(title)s\" a été validée.\n" +"\n" +"Vous avez achevé l’étape 4 de votre formation.\n" +"\n" +"Consultez dès à présent le corrigé-type des consultations fictives (étape 5) " +"et évaluez la formation suivie (étape 6) afin d’obtenir votre attestation " +"(étape 7) en suivant ce lien :\n" "\n" -"Votre séminaire a été validé.\n" -"Vous pouvez télecharger votre attestation en cliquant sur ce lien :\n" +"http://%(domain)s%(path)s\n" +"\n" +"Nous vous rappelons que vous devez impérativement achever toutes les étapes " +"de votre formation avant le %(date)s.\n" +"\n" +"L’équipe e-learning de %(organization)s vous remercie de votre confiance et " +"reste à votre disposition pour renseignement complémentaire.\n" #: templates/telemeta/base.html:96 msgid "Desk" @@ -1556,7 +1644,7 @@ msgstr "" "Merci de vous connecter ou bien contactez l'administateur du site pour " "obtenir un accès privé." -#: views/pro.py:116 +#: views/pro.py:117 msgid "" "You have successfully terminated your e-learning seminar. A training " "testimonial will be available as soon as the pedagogical team validate all " @@ -1566,7 +1654,7 @@ msgstr "" "formation vous sera délivrée dès que vos réponses aux consultations fictives " "auront été validées par notre équipe pédagogique (48h maximum)." -#: views/pro.py:118 +#: views/pro.py:119 msgid "" "All your answers have been validated! You can now download the training " "testimonial below." @@ -1574,30 +1662,74 @@ msgstr "" "Toutes vos consultations fictives ont été validées ! Vous pouvez désormais " "télécharger l'attestation de formation ci-dessous." -#: views/pro.py:160 +#: views/pro.py:163 msgid "You have successfully saved your answer" msgstr "Vous avez enregistré votre consultation avec succès" -#: views/pro.py:162 +#: views/pro.py:165 msgid "You have successfully submitted your answer" msgstr "Vous avez soumis votre consultation avec succès" -#: views/pro.py:265 -msgid "Seminar validated" -msgstr "Séminaire validé" +#: views/pro.py:286 +#, fuzzy +msgid "all your answers has been validated" +msgstr "Votre consultation a été validée" -#: views/pro.py:271 -msgid "Answer validated" -msgstr "Consultation validée" +#: views/pro.py:318 views/pro.py:360 +msgid "Subtitle" +msgstr "Sous-titre" -#: views/pro.py:295 -msgid "Answer rejected" -msgstr "Consultation rejetée" +#: views/pro.py:340 +msgid "validation conditions for an answer" +msgstr "conditions de validation d'une consultation" -#: views/pro.py:377 +#: views/pro.py:455 msgid "You have successfully submitted your evaluation" msgstr "Vous avez soumis votre évaluation avec succès" +#~ msgid "" +#~ "Congratulations!\n" +#~ "\n" +#~ "Your answer has been validated. \n" +#~ "You can go to the next step of your seminar following this link:\n" +#~ msgstr "" +#~ "Félicitations!\n" +#~ "\n" +#~ "Votre dernière consultation a été validée.\n" +#~ "Vous pouvez accéder à la prochaine étape de votre séminaire en suivant ce " +#~ "lien :\n" + +#~ msgid "" +#~ "Congratulations!\n" +#~ "\n" +#~ "Your seminar has been validated. \n" +#~ "You can now download the training testimonial following this link:\n" +#~ msgstr "" +#~ "Félicitations!\n" +#~ "\n" +#~ "Votre séminaire a été validé.\n" +#~ "Vous pouvez télecharger votre attestation en cliquant sur ce lien :\n" + +#~ msgid "Seminar validated" +#~ msgstr "Séminaire validé" + +#~ msgid "Answer validated" +#~ msgstr "Consultation validée" + +#~ msgid "" +#~ "Sorry!\n" +#~ "\n" +#~ "Your answer has been rejected. \n" +#~ "You can work and try again following this link:\n" +#~ msgstr "" +#~ "Nous sommes désolés!\n" +#~ "\n" +#~ "Votre consultation n'a pas été validée.\n" +#~ "Vous pouvez la re-travailler et la soumettre en suivant ce lien :\n" + +#~ msgid "Answer rejected" +#~ msgstr "Consultation rejetée" + #~ msgid "keywords" #~ msgstr "mots clés" @@ -1617,9 +1749,6 @@ msgstr "Vous avez soumis votre évaluation avec succès" #~ "Vous pouvez accéder à la prochaine étape de votre séminaire en suivant ce " #~ "lien :\n" -#~ msgid "Your answer has been validated" -#~ msgstr "Votre consultation a été validée" - #~ msgid "Index" #~ msgstr "Index" diff --git a/teleforma/static/teleforma/css/teleforma.css b/teleforma/static/teleforma/css/teleforma.css index cdb5643e..74b45731 100644 --- a/teleforma/static/teleforma/css/teleforma.css +++ b/teleforma/static/teleforma/css/teleforma.css @@ -59,6 +59,13 @@ a:hover { a img { border: none; } +textarea { + padding: 1em; + -moz-border-radius: 8px 0px 8px 8px; + -webkit-border-radius: 8px 0px 8px 8px; + border-radius: 8px 0px 8px 8px; + } + .rst-content h1 { font-size: 1.2em; font-weight: bold; @@ -1620,7 +1627,15 @@ input,textarea{ #pm_messages td { font-weight: normal; font-size: 1em; + } + +#pm_reply textarea { + padding: 1em; + -moz-border-radius: 8px 0px 8px 8px; + -webkit-border-radius: 8px 0px 8px 8px; + border-radius: 8px 0px 8px 8px; + width: 97%; } #id_body { diff --git a/teleforma/templates/postman/view.html b/teleforma/templates/postman/view.html index c0002767..f294ec23 100644 --- a/teleforma/templates/postman/view.html +++ b/teleforma/templates/postman/view.html @@ -54,7 +54,6 @@
{% csrf_token %}
{{ form.body }}

{% trans "Reply" %} - {% endif %}
diff --git a/teleforma/templates/teleforma/answer_detail.html b/teleforma/templates/teleforma/answer_detail.html index b018a220..f908717c 100644 --- a/teleforma/templates/teleforma/answer_detail.html +++ b/teleforma/templates/teleforma/answer_detail.html @@ -18,8 +18,7 @@ $('#validate').unbind('click').click(function() { $('#reject').unbind('click').click(function() { json(['{{answer.id}}'],'teleforma.reject_answer'); setTimeout(function() {window.location.href = "{% url teleforma-answers %}";}, 1000); -}); - + }); }); @@ -43,7 +42,7 @@ $('#reject').unbind('click').click(function() {

{% trans "Answer" %}

-
+
{{ answer.answer|safe }}
diff --git a/teleforma/templates/teleforma/messages/answer_rejected.txt b/teleforma/templates/teleforma/messages/answer_rejected.txt index 9026db90..c2f90266 100644 --- a/teleforma/templates/teleforma/messages/answer_rejected.txt +++ b/teleforma/templates/teleforma/messages/answer_rejected.txt @@ -1,9 +1,12 @@ -{% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %} -{% blocktrans %}Sorry! +{% load i18n %}{% blocktrans %}{{ gender }} {{ lastname }}, -Your answer has been rejected. -You can work and try again following this link: -{% endblocktrans %} -http://{{ site.name }}{{ url }} +We are sorry we cannot validate your answer n°{{ rank }} of the e-learning seminar "{{ title }}". -{% organization %} \ No newline at end of file +This validation is a requisite to allow us to deliver you a testimonial for this training. However, your submitted answer can not be taken into account. We encourage you to complete your answer following this link: + +http://{{ domain }}{{ path }} + +We remind you that you absolutely need to terminate your training before {{ date }}. + +The team of the {{ organization }} thank you for your confidence and we remain at your disposal for further information. +{% endblocktrans %} \ No newline at end of file diff --git a/teleforma/templates/teleforma/messages/answer_validated.txt b/teleforma/templates/teleforma/messages/answer_validated.txt index 55e24566..5d3315b7 100644 --- a/teleforma/templates/teleforma/messages/answer_validated.txt +++ b/teleforma/templates/teleforma/messages/answer_validated.txt @@ -1,9 +1,12 @@ -{% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %} -{% blocktrans %}Congratulations! +{% load i18n %}{% blocktrans %}{{ gender }} {{ lastname }}, -Your answer has been validated. -You can go to the next step of your seminar following this link: -{% endblocktrans %} -http://{{ site.name }}{{ url }} +Your answer to the question n°{{ rank }} of the e-learning seminar "{{ title }}" has been validated. -{% organization %} \ No newline at end of file +You can now continue to next step following this link: + +http://{{ domain }}{{ path }} + +We remind you that you absolutely need to terminate all steps of your training before {{ date }}. + +The team of the {{ organization }} thank you for your confidence and we remain at your disposal for further information. +{% endblocktrans %} diff --git a/teleforma/templates/teleforma/messages/seminar_validated.txt b/teleforma/templates/teleforma/messages/seminar_validated.txt index 3d3e65d2..bebc9429 100644 --- a/teleforma/templates/teleforma/messages/seminar_validated.txt +++ b/teleforma/templates/teleforma/messages/seminar_validated.txt @@ -1,9 +1,14 @@ -{% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %} -{% blocktrans %}Congratulations! +{% load i18n %}{% blocktrans %}{{ gender }} {{ lastname }}, -Your seminar has been validated. -You can now download the training testimonial following this link: -{% endblocktrans %} -http://{{ site.name }}{{ url }} +Your answer to the question n°{{ rank }} of the e-learning seminar "{{ title }}" has been validated. + +You have then achieved the step 4 of your training. + +Now read the corrected document of all questions (step 5) and evaluate the training (step 6) in order to obtain your testimonial (step 7) following this link: -{% organization %} \ No newline at end of file +http://{{ domain }}{{ path }} + +We remind you that you absolutely need to terminate all steps of your training before {{ date }}. + +The team of the {{ organization }} thank you for your confidence and we remain at your disposal for further information. +{% endblocktrans %} diff --git a/teleforma/urls.py b/teleforma/urls.py index 3aed0f28..fe02c07b 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -155,4 +155,6 @@ urlpatterns = patterns('', url(r'^tinymce/', include('tinymce.urls')), + url(r'^desk/test/(?P.*)/$', AnswerDetailViewTest.as_view(), name="test"), + ) diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 03442fc3..61e230f7 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -258,25 +258,44 @@ class AnswersView(ListView): @jsonrpc_method('teleforma.validate_answer') def validate(request, id): + context = {} answer = Answer.objects.get(id=id) answer.validate() user = answer.user sender = request.user seminar = answer.question.seminar site = Site.objects.get_current() + path = reverse('teleforma-seminar-detail', kwargs={'pk':seminar.id}) + if answer.question.seminar.sub_title: + title = unicode(_('Subtitle')) + ' : ' + seminar.sub_title + else: + title = unicode(_('Course')) + ' : ' + seminar.course.title + organization = seminar.course.department.name + + auditor = user.auditor.all() + if auditor: + context['gender'] = auditor[0].gender + else: + context['gender'] = user.first_name + context['lastname'] = user.last_name + context['rank'] = answer.question.rank + context['domain'] = site.name + context['path'] = path + context['title'] = title + context['organization'] = organization + context['date'] = answer.question.seminar.expiry_date if seminar_validated(user, seminar): testimonial = Testimonial(user=user, seminar=seminar) testimonial.save() url = reverse('teleforma-seminar-testimonial-download', kwargs={'pk':seminar.id}) + '?format=pdf' - ctx_dict = {'site': site, 'url': url,} - subject = _('Seminar validated') + ' : ' + seminar.title - text = render_to_string('teleforma/messages/seminar_validated.txt', ctx_dict) + text = render_to_string('teleforma/messages/seminar_validated.txt', context) + subject = seminar.title + ' : ' + unicode(_('all your answers has been validated')) + else: - url = reverse('teleforma-seminar-detail', kwargs={'pk':seminar.id}) - ctx_dict = {'site': site, 'url': url,} - text = render_to_string('teleforma/messages/answer_validated.txt', ctx_dict) - subject = _('Answer validated') + ' : ' + seminar.title + text = render_to_string('teleforma/messages/answer_validated.txt', context) + subject = seminar.title + ' : ' + unicode(_('answer')) + 'n°' + \ + context['rank'] + ' ' + unicode(_('validated')).decode('utf8') mess = Message(sender=sender, recipient=user, subject=subject, body=text) mess.moderation_status = 'a' @@ -285,10 +304,13 @@ class AnswersView(ListView): @jsonrpc_method('teleforma.reject_answer') def reject(request, id): + context = {} answer = Answer.objects.get(id=id) seminar = answer.question.seminar user = answer.user sender = request.user + site = Site.objects.get_current() + testimonials = Testimonial.objects.filter(user=user, seminar=seminar) if testimonials: for testimonial in testimonials: @@ -296,16 +318,69 @@ class AnswersView(ListView): answer.validated = False answer.status = 2 answer.save() - site = Site.objects.get_current() - url = reverse('teleforma-question-answer', kwargs={'pk':answer.question.id}) - ctx_dict = {'site': site, 'url': url,} - text = render_to_string('teleforma/messages/answer_rejected.txt', ctx_dict) - subject = _('Answer rejected') + ' : ' + seminar.title + + path = reverse('teleforma-question-answer', kwargs={'pk':answer.question.id}) + if answer.question.seminar.sub_title: + title = unicode(_('Subtitle')) + ' : ' + seminar.sub_title + else: + title = unicode(_('Course')) + ' : ' + seminar.course.title + organization = seminar.course.department.name + auditor = user.auditor.all() + if auditor: + context['gender'] = auditor[0].gender + else: + context['gender'] = user.first_name + context['lastname'] = user.last_name + context['rank'] = answer.question.rank + context['domain'] = site.name + context['path'] = path + context['title'] = title + context['organization'] = organization + context['date'] = answer.question.seminar.expiry_date + + seminar = answer.question.seminar + user = answer.user + sender = request.user + + text = render_to_string('teleforma/messages/answer_rejected.txt', context) + subject = seminar.title + ' : ' + unicode(_('validation conditions for an answer')) mess = Message(sender=sender, recipient=user, subject=subject, body=text) mess.moderation_status = 'a' mess.save() notify_user(mess, 'acceptance') +class AnswerDetailViewTest(DetailView): + + model = Answer + template_name='teleforma/messages/answer_rejected.txt' + + def get_context_data(self, **kwargs): + context = super(AnswerDetailViewTest, self).get_context_data(**kwargs) + answer = self.get_object() + seminar = answer.question.seminar + user = answer.user + sender = self.request.user + site = Site.objects.get_current() + path= reverse('teleforma-question-answer', kwargs={'pk':answer.question.id}) + if answer.question.seminar.sub_title: + title = unicode(_('Subtitle')) + ' : ' + seminar.sub_title + else: + title = unicode(_('Course')) + ' : ' + seminar.course.title + organization = seminar.course.department.name + auditor = user.auditor.all() + if auditor: + context['gender'] = auditor[0].gender + else: + context['gender'] = user.first_name + context['lastname'] = user.last_name + context['rank'] = answer.question.rank + context['domain'] = site.name + context['path'] = path + context['title'] = title + context['organization'] = organization + context['date'] = answer.question.seminar.expiry_date + return context + class AnswerDetailView(DetailView):