From 3973c3951d6712c693d1490a88e2212a1b1f4a72 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 13 Oct 2016 18:16:06 +0200 Subject: [PATCH] Prepare playlist templates --- app/templates/media/audio/inc/audio_card.html | 30 -------------- .../media/inc/playlist_audio_card.html | 11 +++++ .../media/inc/playlist_audio_detail.html | 37 +++++++++++++++++ ...dia_shutter.html => playlist_shutter.html} | 0 .../media/inc/playlist_video_card.html | 11 +++++ .../media/inc/playlist_video_detail.html | 37 +++++++++++++++++ .../{media_list.html => playlist_detail.html} | 2 - app/templates/media/playlist_list.html | 41 +++++++++++++++++++ app/templates/media/video/inc/video_card.html | 18 -------- app/templates/media/video/video_detail.html | 26 ------------ 10 files changed, 137 insertions(+), 76 deletions(-) delete mode 100644 app/templates/media/audio/inc/audio_card.html create mode 100644 app/templates/media/inc/playlist_audio_card.html create mode 100644 app/templates/media/inc/playlist_audio_detail.html rename app/templates/media/inc/{media_shutter.html => playlist_shutter.html} (100%) create mode 100644 app/templates/media/inc/playlist_video_card.html create mode 100644 app/templates/media/inc/playlist_video_detail.html rename app/templates/media/{media_list.html => playlist_detail.html} (95%) create mode 100644 app/templates/media/playlist_list.html delete mode 100644 app/templates/media/video/inc/video_card.html delete mode 100644 app/templates/media/video/video_detail.html diff --git a/app/templates/media/audio/inc/audio_card.html b/app/templates/media/audio/inc/audio_card.html deleted file mode 100644 index 38541296..00000000 --- a/app/templates/media/audio/inc/audio_card.html +++ /dev/null @@ -1,30 +0,0 @@ - -
    - - {% for audio in object %} - -
  1. - {{ audio.title }} -
  2. - - {% comment %} - - {# audio.title #}
    - {# audio.open_source_mime_type #}
    - {# audio.closed_source_mime_type #}
    - {# audio.category #}
    - {# audio.media_id #}
    - {# audio.open_source_url #}
    - {# audio.closed_source_url #}
    - {# audio.poster_url #}
    - - - {% endcomment %} - - {% endfor %} - -
diff --git a/app/templates/media/inc/playlist_audio_card.html b/app/templates/media/inc/playlist_audio_card.html new file mode 100644 index 00000000..96460dab --- /dev/null +++ b/app/templates/media/inc/playlist_audio_card.html @@ -0,0 +1,11 @@ + + +
    + {% for media in playlist %} +
  1. + {% for transcoded_media in media.transcoded.all %} + {{ media.title }} + {% endfor %} +
  2. + {% endfor %} +
diff --git a/app/templates/media/inc/playlist_audio_detail.html b/app/templates/media/inc/playlist_audio_detail.html new file mode 100644 index 00000000..23fdb87a --- /dev/null +++ b/app/templates/media/inc/playlist_audio_detail.html @@ -0,0 +1,37 @@ +{% extends "base.html" %} +{% load i18n %} +{% load mezzanine_tags keyword_tags %} + +{% block title %} +{{ playlist.title }} +{% endblock %} + +{% block main %} + +{% for media in playlist.medias.all %} + {% if forloop.first %} +
+ +
+ + {% endif %} +{% endfor %} + +
+ {{ playlist.content|safe }} +
+ +{% with playlist as object %} + {% include "includes/share_buttons.html" %} +{% endwith %} + +{% endblock %} diff --git a/app/templates/media/inc/media_shutter.html b/app/templates/media/inc/playlist_shutter.html similarity index 100% rename from app/templates/media/inc/media_shutter.html rename to app/templates/media/inc/playlist_shutter.html diff --git a/app/templates/media/inc/playlist_video_card.html b/app/templates/media/inc/playlist_video_card.html new file mode 100644 index 00000000..2246e8a1 --- /dev/null +++ b/app/templates/media/inc/playlist_video_card.html @@ -0,0 +1,11 @@ + + +
    + {% for media in playlist %} +
  1. + {% for transcoded_media in media.transcoded.all %} + {{ media.title }} + {% endfor %} +
  2. + {% endfor %} +
diff --git a/app/templates/media/inc/playlist_video_detail.html b/app/templates/media/inc/playlist_video_detail.html new file mode 100644 index 00000000..8529df19 --- /dev/null +++ b/app/templates/media/inc/playlist_video_detail.html @@ -0,0 +1,37 @@ +{% extends "base.html" %} +{% load i18n %} +{% load mezzanine_tags keyword_tags %} + +{% block title %} +{{ playlist.title }} +{% endblock %} + +{% block main %} + +{% for media in playlist.medias.all %} + {% if forloop.first %} +
+ +
+
    + {% else %} +
  1. {{ media.title }}
  2. + {% endif %} + {% if forloop.last %} +
+ {% endif %} +{% endfor %} + +
+ {{ playlist.content|safe }} +
+ +{% with playlist as object %} + {% include "includes/share_buttons.html" %} +{% endwith %} + +{% endblock %} diff --git a/app/templates/media/media_list.html b/app/templates/media/playlist_detail.html similarity index 95% rename from app/templates/media/media_list.html rename to app/templates/media/playlist_detail.html index 89718dcf..4f5e0c50 100644 --- a/app/templates/media/media_list.html +++ b/app/templates/media/playlist_detail.html @@ -27,7 +27,6 @@ {% endblock %} {% block page_content %} - {# not working for audio for the moment... #} {% for object in media %} {% with object|classname|lower as class_name %} {% with "media/"|add:class_name|add:"/inc/"|add:class_name|add:"_card.html" as template %} @@ -37,5 +36,4 @@ {{ object|classname }} : {{ object.created_at }} : {{ object.title }}
{% endfor %} - {% endblock %} diff --git a/app/templates/media/playlist_list.html b/app/templates/media/playlist_list.html new file mode 100644 index 00000000..9a56fcb8 --- /dev/null +++ b/app/templates/media/playlist_list.html @@ -0,0 +1,41 @@ +{% extends "pages/page.html" %} +{% load mezzanine_tags keyword_tags i18n organization_tags pages_tags %} + +{% block meta_title %}{% trans "Media" %}{% endblock %} + +{% block meta_keywords %}{% metablock %} +{% keywords_for person as keywords %} +{% for keyword in keywords %} + {% if not forloop.first %}, {% endif %} + {{ keyword }} +{% endfor %} +{% endmetablock %}{% endblock %} + +{% block page_class %} + person +{% endblock %} + +{% block breadcrumb_menu %} + {{ block.super }} + +{% endblock %} + +{% block page_title %} + {% editable person.title %} +

{% trans "Media" %}

+ {% endeditable %} +{% endblock %} + +{% block page_content %} + {# not working for audio for the moment... #} + {% for playlist in playlists %} + {% with playlist.type as type %} + {% with "media/inc/playlist_"|add:type|add:"_card.html" as template %} + {% include template %} + {% endwith %} + {% endwith %} + {{ playlist|classname }} : {{ playlist.created }} : {{ playlist.title }} +
+ {% endfor %} + +{% endblock %} diff --git a/app/templates/media/video/inc/video_card.html b/app/templates/media/video/inc/video_card.html deleted file mode 100644 index 0f2df011..00000000 --- a/app/templates/media/video/inc/video_card.html +++ /dev/null @@ -1,18 +0,0 @@ -{% for video in videos %} - {% comment %} - {# video.title #}
- {# video.open_source_mime_type #}
- {# video.closed_source_mime_type #}
- {# video.category #}
- {# video.media_id #}
- {# video.open_source_url #}
- {# video.closed_source_url #}
- {# video.poster_url #}
- {% endcomment %} - - -{% endfor %} diff --git a/app/templates/media/video/video_detail.html b/app/templates/media/video/video_detail.html deleted file mode 100644 index 014c7b0c..00000000 --- a/app/templates/media/video/video_detail.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load mezzanine_tags keyword_tags %} - -{% block title %} -{{ video.title }} -{% endblock %} - -{% block main %} - -
- {{ video.content|safe }} -
- -
- -
- -{% with video as object %} - {% include "includes/share_buttons.html" %} -{% endwith %} - -{% endblock %} -- 2.39.5