From: Emilie Date: Tue, 14 Feb 2017 10:22:43 +0000 (+0100) Subject: [Media] : playlist overlay X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=aa988c5717819382f44c76c39cc42aed5dd529aa;p=mezzo.git [Media] : playlist overlay --- diff --git a/app/organization/media/urls.py b/app/organization/media/urls.py index fc8a27e3..2233d5a0 100644 --- a/app/organization/media/urls.py +++ b/app/organization/media/urls.py @@ -36,6 +36,7 @@ urlpatterns = [ url("^video/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"), url("^playlist/list/(?P.*)$", PlaylistListView.as_view(), name="organization-playlist-list"), url("^playlist/detail/(?P.*)/$", PlaylistDetailView.as_view(), name="organization-playlist-detail"), url("^playlist-media-autocomplete/$", permission_required('playlist.can_edit')(PlayListMediaView.as_view()), name='media-autocomplete'), diff --git a/app/organization/media/views.py b/app/organization/media/views.py index e820096c..d5bdd646 100644 --- a/app/organization/media/views.py +++ b/app/organization/media/views.py @@ -34,7 +34,7 @@ class MediaDetailView(SlugMixin, DetailView): model = Media context_object_name = 'media' - + def get_template_names(self): templates = super(MediaDetailView, self).get_template_names() templates.insert(0,'media/'+self.kwargs['type'].lower()+'/'+self.kwargs['type'].lower()+'_detail.html') @@ -112,5 +112,11 @@ class PlayListMediaView(autocomplete.Select2QuerySetView): class MediaOverlayView(SlugMixin, DetailView): model = Media - template_name='media/overlay_detail.html' + template_name='media/media/media_overlay.html' context_object_name = 'media' + + +class PlaylistOverlayView(SlugMixin, DetailView): + model = Playlist + template_name='media/playlist_overlay.html' + context_object_name = 'playlist' diff --git a/app/templates/media/media/media_overlay.html b/app/templates/media/media/media_overlay.html new file mode 100644 index 00000000..97a2e907 --- /dev/null +++ b/app/templates/media/media/media_overlay.html @@ -0,0 +1,69 @@ +{% load mezzanine_tags keyword_tags i18n organization_tags %} + +
+ +
+ +
+ +
+ +
+
    + {% spaceless %} +
  1. {{ media.title }}{% if media.description %} {{ media.description }}{% endif %}
  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/overlay_detail.html b/app/templates/media/overlay_detail.html deleted file mode 100644 index 97a2e907..00000000 --- a/app/templates/media/overlay_detail.html +++ /dev/null @@ -1,69 +0,0 @@ -{% load mezzanine_tags keyword_tags i18n organization_tags %} - -
- -
- -
- -
- -
-
    - {% spaceless %} -
  1. {{ media.title }}{% if media.description %} {{ media.description }}{% endif %}
  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/playlist_overlay.html b/app/templates/media/playlist_overlay.html new file mode 100644 index 00000000..b769b185 --- /dev/null +++ b/app/templates/media/playlist_overlay.html @@ -0,0 +1,9 @@ +{% with playlist.type as type %} + {% with "media/inc/playlist_"|add:type|add:"_detail.html" as template %} + {% include template %} + {% endwith %} +{% endwith %} + +
+ {{ playlist.content|safe }} +