]> git.parisson.com Git - teleforma.git/commitdiff
add validation messages & seminar video preview
authoryomguy <yomguy@parisson.com>
Thu, 17 Jan 2013 12:44:04 +0000 (13:44 +0100)
committeryomguy <yomguy@parisson.com>
Thu, 17 Jan 2013 12:44:04 +0000 (13:44 +0100)
teleforma/admin.py
teleforma/locale/fr/LC_MESSAGES/django.mo
teleforma/locale/fr/LC_MESSAGES/django.po
teleforma/models/core.py
teleforma/models/pro.py
teleforma/templates/teleforma/inc/seminar_media_preview_video.html [new file with mode: 0644]
teleforma/templates/teleforma/messages/answer_validated.txt [new file with mode: 0644]
teleforma/templates/teleforma/messages/seminar_validated.txt [new file with mode: 0644]
teleforma/urls.py
teleforma/views/pro.py

index 115a4436e3af1295f62205bea2686a45c9f3e647..914e8f124e94d54bb1db4ab8d9b21ba92e710217 100644 (file)
@@ -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']
index 89051cebf6bff245ac546b6d4beefebe46bc61b4..8e85556fc21a90fe7391c439f67d692638dc5037 100644 (file)
Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ
index 9b048c615e7d858c23d3dd7e9e449844ad2f84b4..41f38da3cf678a05a742c19949a425c47720919a 100644 (file)
@@ -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 <yomguy@parisson.com>\n"
 "Language-Team: LANGUAGE <lists@parisson.com>\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"
index 8ce0dce628348ae4a19bb9c7c8271f1ddd83ce2b..c561ce3b46a3199c23eaf63b52b098791e852b9e 100755 (executable)
@@ -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)
 
index 56a441b872fc1f9147f73b2425d2548083871999..32c1030c46e506cb4a541af9d6367e092178aa27 100755 (executable)
@@ -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 (file)
index 0000000..6abb122
--- /dev/null
@@ -0,0 +1,15 @@
+{% load telemeta_utils %}
+{% load teleforma_tags %}
+{% load i18n %}
+
+<script src="{{STATIC_URL}}teleforma/video-js/video.js"></script>
+<link href="{{STATIC_URL}}teleforma/video-js/video-js.css" rel="stylesheet">
+
+<video id="my_video_1" class="video-js vjs-default-skin" width="415" height="235" controls preload="auto" data-setup='{}'>
+  <source src="{{ MEDIA_URL }}{{ object.media_preview.item.file }}#t=0" type="{{ object.media_preview.mime_type }}" />
+  {% for transcoded in object.media_preview.item.transcoded.all %}
+   {% if "video" in transcoded.mime_type %}
+    <source src="{{ MEDIA_URL }}{{ transcoded.file }}#t=0" type="{{ transcoded.mime_type }}" />
+   {% endif %} 
+  {% endfor %}
+</video>
diff --git a/teleforma/templates/teleforma/messages/answer_validated.txt b/teleforma/templates/teleforma/messages/answer_validated.txt
new file mode 100644 (file)
index 0000000..da8ce63
--- /dev/null
@@ -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 (file)
index 0000000..5617cf6
--- /dev/null
@@ -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
index 6a2a562cfc2b6c305a72f20c535707d137438e26..3aed0f28274547f20584e8ebcd40bbf257b970f7 100644 (file)
@@ -75,6 +75,9 @@ urlpatterns = patterns('',
     url(r'^desk/seminars/(?P<id>.*)/media/(?P<pk>.*)/audio/$', 
             SeminarMediaView.as_view(template_name='teleforma/seminar_media_audio.html'),
             name="teleforma-media-audio"),
+    url(r'^desk/seminars/(?P<pk>.*)/preview/$', 
+            SeminarMediaPreviewView.as_view(), 
+            name="teleforma-media-preview-video"),
 
     url(r'^desk/documents/(?P<pk>.*)/detail/$', DocumentView.as_view(),
         name="teleforma-document-detail"),
index 39366cb2867d55fd2a66c00f0eae467a8008fbba..719a32e56b5960ef6f8653c3182be9890aa8e628 100644 (file)
@@ -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()