'organization-network.TeamPage',
'organization-projects.ProjectTopicPage',
'pages.Page',
- 'organization-media.Media',
+ 'organization-media.Playlist',
'mezzanine_agenda.Event')
# aggregate all Page types : CustomPage, TeamPage, Topic etc...
if result._meta.get_parent_list() :
parent_class = result._meta.get_parent_list()[0]
-
if full_classname in settings.PAGES_MODELS:
classname = "CustomPage"
verbose_name = "Page"
app_label = "organization-pages"
- elif "Video" in parent_class.__name__:
- classname = "Video"
- app_label = parent_class._meta.app_label
- elif "Audio" in parent_class.__name__:
- classname = "Audio"
- app_label = parent_class._meta.app_label
+ elif classname == "Playlist":
+ verbose_name = "Media"
if classname in filter_dict:
filter_dict[classname]['count'] += 1
--- /dev/null
+{% load i18n mezzanine_tags organization_tags %}
+{% with playlist.get_absolute_url as playlist_url %}
+ {% if playlist.medias.first.media.poster_url %}
+ <!-- url of the media is distant. We can't generate back side thumbnail. Do it with css pliz -->
+ <img src="{{playlist.medias.first.media.poster_urlĀ }}" width="200" height="150">
+ {% else %}
+ <!--placeholder picture-->
+ {% endif %}
+
+ {{ playlist.type }}
+
+ <h5>
+ {% if playlist_url %}
+ <a href="{{ playlist_url }}">{{ playlist.title }}</a>
+ {% else %}
+ {{ playlist }}
+ {% endif %}
+ </h5>
+ {% if playlist.description != playlist|stringformat:"s" %}
+ <p>{{ playlist.description|truncatewords_html:200|safe }}</p>
+ {% endif %}
+ {% if playlist_url %}
+ <a href="{{ playlist_url }}">{% trans "read more" %}</a>
+ {% endif %}
+ <br>
+{% endwith %}
{% endif %}
</p>
{% for result in results.object_list %}
+ {{ result|classname }}
{% if result|classname == 'Event' %}
{% with result as event %}
{% include 'agenda/includes/event_search.html' %}
{% endwith %}
- {% elif result|classname == 'Audio' %}
- {% with result as audio %}
- {% include 'media/audio/inc/audio_search.html' %}
- {% endwith %}
- {% elif result|classname == 'Video' %}
- {% with result as video %}
- {% include 'media/video/inc/video_search.html' %}
+ {% elif result|classname == 'Playlist' %}
+ {% with result as playlist %}
+ {% include 'media/inc/playlist_search.html' %}
{% endwith %}
{% else %}
{% with result as page %}