From: Emilie Date: Wed, 15 Feb 2017 09:25:45 +0000 (+0100) Subject: [Media] : separating overlay for audio and video X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=a15732e72300630d1fa1d6931dd4280943c7dfb8;p=mezzo.git [Media] : separating overlay for audio and video --- 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/audio/audio_overlay.html b/app/templates/media/audio/audio_overlay.html new file mode 100644 index 00000000..e3390dd3 --- /dev/null +++ b/app/templates/media/audio/audio_overlay.html @@ -0,0 +1,69 @@ +{% load mezzanine_tags keyword_tags i18n organization_tags %} + +
+ +
+ +
+ +
+ +
+
    + {% spaceless %} +
  1. {{ media.title }}
  2. + {% endspaceless %} +
+ +
+ +
+ +
+ +
+
+
+
+ {% 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 %} + +
+ +
+ +
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/media/media_overlay.html b/app/templates/media/media/media_overlay.html deleted file mode 100644 index e3390dd3..00000000 --- a/app/templates/media/media/media_overlay.html +++ /dev/null @@ -1,69 +0,0 @@ -{% 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 %} - -
- -
- -
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 %} + +
+ +
+ +
+ +
+ +
+
    + {% spaceless %} +
  1. {{ media.title }}
  2. + {% endspaceless %} +
+ +
+ +
+ +
+ +
+
+
+
+ {% 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 %} + +
+ +
+ +