From: yomguy Date: Thu, 17 Jan 2013 12:44:04 +0000 (+0100) Subject: add validation messages & seminar video preview X-Git-Tag: 0.9-probarreau~133 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=8f57571836db3ff11b514fe6f1c554c6a53b3afc;p=teleforma.git add validation messages & seminar video preview --- diff --git a/teleforma/admin.py b/teleforma/admin.py index 115a4436..914e8f12 100644 --- a/teleforma/admin.py +++ b/teleforma/admin.py @@ -56,12 +56,7 @@ class DocumentAdmin(admin.ModelAdmin): class MediaAdmin(admin.ModelAdmin): exclude = ['readers'] - search_fields = ['id'] - -class MediaPackageAdmin(admin.ModelAdmin): - exclude = ['mime_type'] - search_fields = ['id'] - filter_horizontal = ['video', 'audio'] + search_fields = ['id', 'title'] class ConferenceAdmin(admin.ModelAdmin): exclude = ['readers'] @@ -72,7 +67,7 @@ class SeminarQuestionInline(admin.StackedInline): class SeminarAdmin(admin.ModelAdmin): inlines = [SeminarQuestionInline,] - filter_horizontal = ['professor', 'medias', 'media_previews', + filter_horizontal = ['professor', 'medias', 'docs_1', 'docs_2', 'docs_correct'] ordering = ['course', 'rank'] search_fields = ['course__title', 'title', 'sub_title'] diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 89051ceb..8e85556f 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 9b048c61..41f38da3 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-16 17:56+0100\n" +"POT-Creation-Date: 2013-01-17 10:04+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Guillaume Pellerin \n" "Language-Team: LANGUAGE \n" @@ -455,7 +455,7 @@ msgid "Testimonial template" msgstr "Modèle d'attestation" #: models/pro.py:196 templates/teleforma/inc/testimonial_list.html:7 -#: templates/teleforma/inc/testimonial_step.html:7 views/pro.py:479 +#: templates/teleforma/inc/testimonial_step.html:7 views/pro.py:484 msgid "Testimonial" msgstr "Attestation" @@ -708,6 +708,20 @@ msgstr "" msgid "Reply" msgstr "" +#: templates/postman/seminar_validated.txt:3 +#, fuzzy +msgid "" +"Congratulations!\n" +"\n" +"Your seminar 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" + #: templates/postman/sent.html:6 msgid "Sent" msgstr "" @@ -918,7 +932,7 @@ msgstr "S T O P" #: templates/teleforma/course_media.html:73 #: templates/teleforma/seminar_media_video.html:83 msgid "Audio" -msgstr "" +msgstr "Audio" #: templates/teleforma/course_conference.html:70 #: templates/teleforma/course_media.html:130 @@ -967,7 +981,7 @@ msgstr "ID Conférence" #: templates/teleforma/course_media.html:76 #: templates/teleforma/seminar_media_audio.html:22 msgid "Video" -msgstr "" +msgstr "Vidéo" #: templates/teleforma/course_conference_audio.html:70 #: templates/teleforma/inc/conference_list.html:28 @@ -1540,11 +1554,11 @@ msgstr "Vous avez enregistré votre consultation avec succès" msgid "You have successfully submitted your answer" msgstr "Vous avez soumis votre consultation avec succès" -#: views/pro.py:257 +#: views/pro.py:262 msgid "Your answer has been validated" msgstr "Votre consultation a été validée" -#: views/pro.py:352 +#: views/pro.py:357 #, fuzzy msgid "You have successfully submitted your evaluation" msgstr "Vous avez soumis votre évaluation avec succès" diff --git a/teleforma/models/core.py b/teleforma/models/core.py index 8ce0dce6..c561ce3b 100755 --- a/teleforma/models/core.py +++ b/teleforma/models/core.py @@ -430,8 +430,10 @@ class Media(MediaBase): strings.append(self.course.code + ' ' + self.course_type.name) elif self.course: strings.append(self.course.code) + elif self.item.title: + strings.append(self.item.title) else: - strings.append(self.item.file) + strings.append(os.path.basename(self.item.file.path)) strings.append(self.mime_type) return ' - '.join(strings) diff --git a/teleforma/models/pro.py b/teleforma/models/pro.py index 56a441b8..32c1030c 100755 --- a/teleforma/models/pro.py +++ b/teleforma/models/pro.py @@ -82,7 +82,7 @@ class Seminar(Displayable): medias = models.ManyToManyField(Media, related_name="seminar", verbose_name=_('media'), blank=True, null=True) - media_previews = models.ManyToManyField(Media, related_name="seminar_media_previews", + media_preview = models.ForeignKey(Media, related_name="seminar_preview", verbose_name=_('media_preview'), blank=True, null=True) docs_2 = models.ManyToManyField(Document, related_name="seminar_docs_2", diff --git a/teleforma/templates/teleforma/inc/seminar_media_preview_video.html b/teleforma/templates/teleforma/inc/seminar_media_preview_video.html new file mode 100644 index 00000000..6abb122c --- /dev/null +++ b/teleforma/templates/teleforma/inc/seminar_media_preview_video.html @@ -0,0 +1,15 @@ +{% load telemeta_utils %} +{% load teleforma_tags %} +{% load i18n %} + + + + + diff --git a/teleforma/templates/teleforma/messages/answer_validated.txt b/teleforma/templates/teleforma/messages/answer_validated.txt new file mode 100644 index 00000000..da8ce631 --- /dev/null +++ b/teleforma/templates/teleforma/messages/answer_validated.txt @@ -0,0 +1,10 @@ +{% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %} +{% blocktrans %} +Congratulations! + +Your answer have been validated. +You can now download the training testimonial following this link: + +http://{{ site.name }}{{ testimonial_url }} + +{% endblocktrans } \ No newline at end of file diff --git a/teleforma/templates/teleforma/messages/seminar_validated.txt b/teleforma/templates/teleforma/messages/seminar_validated.txt new file mode 100644 index 00000000..5617cf6f --- /dev/null +++ b/teleforma/templates/teleforma/messages/seminar_validated.txt @@ -0,0 +1,10 @@ +{% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %} +{% blocktrans %} +Congratulations! + +Your answer has been validated. +You can continue to the next step of your seminar following this link: + +http://{{ site.name }}{{ seminar_url }} + +{% endblocktrans } \ No newline at end of file diff --git a/teleforma/urls.py b/teleforma/urls.py index 6a2a562c..3aed0f28 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -75,6 +75,9 @@ urlpatterns = patterns('', url(r'^desk/seminars/(?P.*)/media/(?P.*)/audio/$', SeminarMediaView.as_view(template_name='teleforma/seminar_media_audio.html'), name="teleforma-media-audio"), + url(r'^desk/seminars/(?P.*)/preview/$', + SeminarMediaPreviewView.as_view(), + name="teleforma-media-preview-video"), url(r'^desk/documents/(?P.*)/detail/$', DocumentView.as_view(), name="teleforma-document-detail"), diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 39366cb2..719a32e5 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -207,6 +207,14 @@ class SeminarMediaView(MediaView): media = self.get_object() return super(SeminarMediaView, self).dispatch(*args, **kwargs) + +class SeminarMediaPreviewView(DetailView): + + model = Seminar + template_name = 'teleforma/inc/seminar_media_preview_video.html' + + def dispatch(self, *args, **kwargs): + return super(SeminarMediaPreviewView, self).dispatch(*args, **kwargs) class AnswersView(ListView): @@ -254,7 +262,7 @@ class AnswersView(ListView): ctx_dict = {'site': site, 'seminar_url': seminar_url,} text = render_to_string('teleforma/messages/seminar_validated.txt', ctx_dict) mess = Message(sender=sender, recipient=user, - subject=_('Your answer has been validated'), + subject=_('Answer validated') + ' : ' + seminar.title, body=text) mess.moderation_status = 'a' mess.save()