From a15732e72300630d1fa1d6931dd4280943c7dfb8 Mon Sep 17 00:00:00 2001 From: Emilie Date: Wed, 15 Feb 2017 10:25:45 +0100 Subject: [PATCH] [Media] : separating overlay for audio and video --- app/organization/media/urls.py | 2 +- app/organization/media/views.py | 6 +- .../audio_overlay.html} | 0 .../media/media/includes/media_card.html | 2 +- app/templates/media/video/video_overlay.html | 69 +++++++++++++++++++ 5 files changed, 76 insertions(+), 3 deletions(-) rename app/templates/media/{media/media_overlay.html => audio/audio_overlay.html} (100%) create mode 100644 app/templates/media/video/video_overlay.html diff --git a/app/organization/media/urls.py b/app/organization/media/urls.py index 2233d5a0..a890a03c 100644 --- a/app/organization/media/urls.py +++ b/app/organization/media/urls.py @@ -33,7 +33,7 @@ from organization.media.views import * urlpatterns = [ - url("^video/overlay/(?P.*)/$", MediaOverlayView.as_view(), name="organization-media-overlay"), + url("^(?P.*)/overlay/(?P.*)/$", MediaOverlayView.as_view(), name="organization-media-overlay"), url("^(?P.*)/detail/(?P.*)/$", MediaDetailView.as_view(), name="organization-media-detail"), url("^playlist/list/$", PlaylistListView.as_view(), name="organization-playlist-list"), url("^playlist/overlay/(?P.*)/$", PlaylistOverlayView.as_view(), name="organization-playlist-overlay"), diff --git a/app/organization/media/views.py b/app/organization/media/views.py index ca0634c6..f24ae5a4 100644 --- a/app/organization/media/views.py +++ b/app/organization/media/views.py @@ -46,7 +46,6 @@ class PlaylistDetailView(SlugMixin, DetailView): model = Playlist template_name='media/playlist_detail.html' context_object_name = 'playlist' - def get_context_data(self, **kwargs): context = super(PlaylistDetailView, self).get_context_data(**kwargs) self.related_objects = [] @@ -116,6 +115,11 @@ class MediaOverlayView(SlugMixin, DetailView): template_name='media/media/media_overlay.html' context_object_name = 'media' + def get_template_names(self): + templates = super(MediaOverlayView, self).get_template_names() + templates.insert(0,'media/'+self.object.type.lower()+'/'+self.object.type.lower()+'_overlay.html') + return templates + class PlaylistOverlayView(SlugMixin, DetailView): model = Playlist diff --git a/app/templates/media/media/media_overlay.html b/app/templates/media/audio/audio_overlay.html similarity index 100% rename from app/templates/media/media/media_overlay.html rename to app/templates/media/audio/audio_overlay.html diff --git a/app/templates/media/media/includes/media_card.html b/app/templates/media/media/includes/media_card.html index a0b5e9ad..db774cb9 100644 --- a/app/templates/media/media/includes/media_card.html +++ b/app/templates/media/media/includes/media_card.html @@ -2,7 +2,7 @@
- +
{% if object.poster_url %} diff --git a/app/templates/media/video/video_overlay.html b/app/templates/media/video/video_overlay.html new file mode 100644 index 00000000..e3390dd3 --- /dev/null +++ b/app/templates/media/video/video_overlay.html @@ -0,0 +1,69 @@ +{% load mezzanine_tags keyword_tags i18n organization_tags %} + +
+ + + +
+ +
+
+
+
+ {% trans 'Publish date' %} +
+ {% editable media.publish_date %} +
+ {{ media.publish_date|date:"DATE_FORMAT" }} +
+ {% endeditable %} + + {% with media as object %} +
+ +
+ {% endwith %} +
+
+
+ +
+ +

{{ media.title }}

+ {% if media.description %} +

+ {{ media.description }} +

+ {% endif %} + +
+ +
+ +
-- 2.39.5