]> git.parisson.com Git - mezzo.git/commitdiff
Fix playlist management, simplify and validate all playlist inclusions in various...
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 14 Oct 2016 10:17:15 +0000 (12:17 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 14 Oct 2016 10:17:15 +0000 (12:17 +0200)
32 files changed:
app/organization/__init__.py
app/organization/agenda/admin.py
app/organization/agenda/migrations/0010_auto_20161014_0002.py [new file with mode: 0644]
app/organization/agenda/models.py
app/organization/job/models.py
app/organization/magazine/migrations/0013_auto_20161013_2353.py [new file with mode: 0644]
app/organization/magazine/models.py
app/organization/media/migrations/0009_auto_20161013_2353.py [new file with mode: 0644]
app/organization/media/migrations/0010_auto_20161014_0849.py [new file with mode: 0644]
app/organization/media/migrations/0011_auto_20161014_1136.py [new file with mode: 0644]
app/organization/media/models.py
app/organization/network/admin.py
app/organization/network/migrations/0039_auto_20161014_0002.py [new file with mode: 0644]
app/organization/network/models.py
app/organization/pages/admin.py
app/organization/pages/migrations/0009_auto_20161014_0002.py [new file with mode: 0644]
app/organization/pages/models.py
app/organization/projects/admin.py
app/organization/projects/migrations/0021_auto_20161014_0002.py [new file with mode: 0644]
app/organization/projects/models.py
app/templates/agenda/event_detail.html
app/templates/core/inc/audio.html [deleted file]
app/templates/core/inc/slider_video.html [deleted file]
app/templates/core/inc/video.html [deleted file]
app/templates/media/inc/playlist_audio_detail.html
app/templates/media/inc/playlist_video_detail.html
app/templates/media/inc/playlist_video_slider.html [new file with mode: 0644]
app/templates/pages/custompage.html
app/templates/pages/departmentpage.html
app/templates/pages/page.html
app/templates/pages/teampage.html
app/templates/projects/project_detail.html

index efe892afb7c36464583291857c15b3b80b3704e3..ac056e539b7a175c338b7e4ed332c96878b1038c 100644 (file)
@@ -1,2 +1,2 @@
 
-__version__ = 0.1
+__version__ = 1.0
index 5a1bed381da51252c8a8e2a976f33a06988d9181..23c67223cdb163d12883ee15fb1cc8c97feec26f 100644 (file)
@@ -27,7 +27,7 @@ class EventImageInline(TabularDynamicInlineAdmin):
     model = EventImage
 
 
-class EventPlaylistInline(StackedDynamicInlineAdmin):
+class EventPlaylistInline(TabularDynamicInlineAdmin):
 
     model = EventPlaylist
 
diff --git a/app/organization/agenda/migrations/0010_auto_20161014_0002.py b/app/organization/agenda/migrations/0010_auto_20161014_0002.py
new file mode 100644 (file)
index 0000000..4a148ac
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-13 22:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-media', '0009_auto_20161013_2353'),
+        ('organization-agenda', '0009_auto_20161013_1631'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='eventplaylist',
+            name='playlist_ptr',
+        ),
+        migrations.AddField(
+            model_name='eventplaylist',
+            name='playlistrelated_ptr',
+            field=models.OneToOneField(auto_created=True, default=1, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='organization-media.PlaylistRelated'),
+            preserve_default=False,
+        ),
+    ]
index 288f90a35c1ea5f2e3ea86208c265500ec8ef3ec..8de24c7c367f115d705827a8bcaecb372e6f97dc 100644 (file)
@@ -57,7 +57,7 @@ class EventLink(Link):
         verbose_name_plural = _("links")
 
 
-class EventPlaylist(Playlist):
+class EventPlaylist(PlaylistRelated):
 
     event = models.ForeignKey(Event, verbose_name=_('event'), related_name='playlists', blank=True, null=True, on_delete=models.SET_NULL)
 
index 272747994160729053704df9dc272b913e2eda05..11fa98173a563077d44cf0c58ba49b9e137ff5f0 100644 (file)
@@ -5,6 +5,7 @@ from mezzanine.core.models import Displayable
 from organization.core.models import *
 from organization.media.models import *
 
+
 class JobResponse(models.Model):
 
     first_name = models.CharField(max_length=255, null=False, verbose_name=_('first name'))
diff --git a/app/organization/magazine/migrations/0013_auto_20161013_2353.py b/app/organization/magazine/migrations/0013_auto_20161013_2353.py
new file mode 100644 (file)
index 0000000..325e31a
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-13 21:53
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-media', '0009_auto_20161013_2353'),
+        ('organization-magazine', '0012_auto_20161013_1631'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='articleplaylist',
+            name='playlist_ptr',
+        ),
+        migrations.AddField(
+            model_name='articleplaylist',
+            name='playlistrelated_ptr',
+            field=models.OneToOneField(auto_created=True, default=1, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='organization-media.PlaylistRelated'),
+            preserve_default=False,
+        ),
+    ]
index b044f0a524cea0b38384eaeb8af8ae142f349375..971ce7c21b0723ad3e31068b685dafef3dcb72ce 100644 (file)
@@ -12,7 +12,7 @@ from mezzanine.core.models import RichText, Displayable, Slugged
 from mezzanine.pages.models import Page
 from mezzanine.blog.models import BlogPost
 from organization.network.models import Department, PersonListBlock
-from organization.media.models import Playlist
+from organization.media.models import *
 from organization.core.models import *
 from organization.magazine.apps import *
 
@@ -40,7 +40,7 @@ class ArticleImage(Image):
         order_with_respect_to = "article"
 
 
-class ArticlePlaylist(Playlist):
+class ArticlePlaylist(PlaylistRelated):
 
     article = models.ForeignKey(Article, verbose_name=_('article'), related_name='playlists', blank=True, null=True, on_delete=models.SET_NULL)
 
diff --git a/app/organization/media/migrations/0009_auto_20161013_2353.py b/app/organization/media/migrations/0009_auto_20161013_2353.py
new file mode 100644 (file)
index 0000000..70906f9
--- /dev/null
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-13 21:53
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-media', '0008_auto_20161013_1810'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='PlaylistRelated',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('playlist', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization-media.Playlist', verbose_name='playlist')),
+            ],
+            options={
+                'verbose_name': 'playlist',
+                'verbose_name_plural': 'playlists',
+            },
+        ),
+        migrations.AlterModelOptions(
+            name='mediatranscoded',
+            options={'verbose_name': 'media file', 'verbose_name_plural': 'media files'},
+        ),
+    ]
diff --git a/app/organization/media/migrations/0010_auto_20161014_0849.py b/app/organization/media/migrations/0010_auto_20161014_0849.py
new file mode 100644 (file)
index 0000000..e0adf32
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-14 06:49
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-media', '0009_auto_20161013_2353'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='playlist',
+            name='type',
+            field=models.CharField(choices=[('audio', 'audio'), ('video', 'video')], max_length=32, verbose_name='type'),
+        ),
+    ]
diff --git a/app/organization/media/migrations/0011_auto_20161014_1136.py b/app/organization/media/migrations/0011_auto_20161014_1136.py
new file mode 100644 (file)
index 0000000..f15256f
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-14 09:36
+from __future__ import unicode_literals
+
+from django.db import migrations
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-media', '0010_auto_20161014_0849'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='mediatranscoded',
+            name='file',
+            field=mezzanine.core.fields.FileField(blank=True, max_length=1024, null=True, verbose_name='file'),
+        ),
+    ]
index 1edb66ae49660e853ad3126f9f855394ee12495d..9c45315e49d8648817a5fe90560cd89abd1ea6a6 100644 (file)
@@ -47,6 +47,7 @@ class Media(Displayable):
         return MEDIA_BASE_URL + self.external_id
 
     def get_html(self):
+        print(self.uri)
         r = requests.get(self.uri)
         return r.content
 
@@ -78,15 +79,15 @@ models.signals.post_save.connect(create_media, sender=Media, dispatch_uid='creat
 class MediaTranscoded(models.Model):
 
     media = models.ForeignKey('Media', verbose_name=_('media'), related_name='transcoded')
-    file = FileField(_("file"), max_length=1024, upload_to="uploads/media/")
+    file = FileField(_("file"), max_length=1024, upload_to="uploads/media/", blank=True, null=True)
     url = models.URLField(_('URL'), max_length=1024, blank=True)
     mime_type = models.CharField(_('mime type'), max_length=64)
 
     preferred_mime_type = ['video/webm', 'audio/ogg']
 
     class Meta:
-        verbose_name = "media"
-        verbose_name_plural = "medias"
+        verbose_name = "media file"
+        verbose_name_plural = "media files"
 
     def __str__(self):
         return self.url
@@ -106,12 +107,15 @@ class MediaCategory(Slugged, Description):
 class Playlist(Displayable):
     """Playlist"""
 
-    type = models.CharField(_('type'), max_length=32, choices=PLAYLIST_TYPE_CHOICES, blank=True, null=True)
+    type = models.CharField(_('type'), max_length=32, choices=PLAYLIST_TYPE_CHOICES)
 
     class Meta:
         verbose_name = _('playlist')
         verbose_name_plural = _('playlists')
 
+    def __str__(self):
+        return ' '.join((self.title, '(' + self.type + ')'))
+
     def get_absolute_url(self):
         return reverse("organization-playlist-detail", kwargs={"slug": self.slug})
 
@@ -125,3 +129,13 @@ class PlaylistMedia(models.Model):
     class Meta:
         verbose_name = _('media')
         verbose_name_plural = _('medias')
+
+
+class PlaylistRelated(models.Model):
+    """Playlist inline"""
+
+    playlist = models.ForeignKey(Playlist, verbose_name=_('playlist'), blank=True, null=True, on_delete=models.SET_NULL)
+
+    class Meta:
+        verbose_name = _('playlist')
+        verbose_name_plural = _('playlists')
index 1877178f32d410b2a56189e4b412c121a5bc3fa6..08a775a204cb6d27ba618380d6d53a6fd8c8a3f3 100644 (file)
@@ -12,7 +12,7 @@ from organization.core.admin import *
 from organization.pages.admin import PageImageInline, PageBlockInline, PagePlaylistInline
 
 
-class OrganizationPlaylistInline(StackedDynamicInlineAdmin):
+class OrganizationPlaylistInline(TabularDynamicInlineAdmin):
 
     model = OrganizationPlaylist
 
diff --git a/app/organization/network/migrations/0039_auto_20161014_0002.py b/app/organization/network/migrations/0039_auto_20161014_0002.py
new file mode 100644 (file)
index 0000000..22b026d
--- /dev/null
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-13 22:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-media', '0009_auto_20161013_2353'),
+        ('organization-network', '0038_auto_20161013_1631'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='organizationplaylist',
+            name='playlist_ptr',
+        ),
+        migrations.RemoveField(
+            model_name='personplaylist',
+            name='playlist_ptr',
+        ),
+        migrations.AddField(
+            model_name='organizationplaylist',
+            name='playlistrelated_ptr',
+            field=models.OneToOneField(auto_created=True, default=1, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='organization-media.PlaylistRelated'),
+            preserve_default=False,
+        ),
+        migrations.AddField(
+            model_name='personplaylist',
+            name='playlistrelated_ptr',
+            field=models.OneToOneField(auto_created=True, default=1, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='organization-media.PlaylistRelated'),
+            preserve_default=False,
+        ),
+    ]
index 01bf36a1161dac065d3fe5add654ff70accbcc8c..333fd0ad5b12973244e6ae1d9090ad28de86741f 100644 (file)
@@ -125,7 +125,7 @@ class Organization(Named, Address, URL, AdminThumbRelatedMixin):
         super(Organization, self).save()
 
 
-class OrganizationPlaylist(Playlist):
+class OrganizationPlaylist(PlaylistRelated):
 
     organization = models.ForeignKey(Organization, verbose_name=_('organization'), related_name='playlists', blank=True, null=True, on_delete=models.SET_NULL)
 
@@ -268,7 +268,7 @@ class Person(Displayable, AdminThumbMixin):
         super(Person, self).save(*args, **kwargs)
 
 
-class PersonPlaylist(Playlist):
+class PersonPlaylist(PlaylistRelated):
 
     person = models.ForeignKey(Person, verbose_name=_('person'), related_name='playlists', blank=True, null=True, on_delete=models.SET_NULL)
 
index cb04bfeefa3f38010fe5db114761dd8f8c2dfb9f..9e346c0bbe4633b36b90b31e86f3abafafbcb265 100644 (file)
@@ -26,10 +26,9 @@ class PageImageInline(TabularDynamicInlineAdmin):
     model = PageImage
 
 
-class PagePlaylistInline(StackedDynamicInlineAdmin):
+class PagePlaylistInline(TabularDynamicInlineAdmin):
 
     model = PagePlaylist
-    exclude = ("short_url", "keywords", "description", "slug", )
 
 
 class PageLinkInline(StackedDynamicInlineAdmin):
diff --git a/app/organization/pages/migrations/0009_auto_20161014_0002.py b/app/organization/pages/migrations/0009_auto_20161014_0002.py
new file mode 100644 (file)
index 0000000..dc4942c
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-13 22:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-media', '0009_auto_20161013_2353'),
+        ('organization-pages', '0008_auto_20161013_1631'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='pageplaylist',
+            name='playlist_ptr',
+        ),
+        migrations.AddField(
+            model_name='pageplaylist',
+            name='playlistrelated_ptr',
+            field=models.OneToOneField(auto_created=True, default=1, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='organization-media.PlaylistRelated'),
+            preserve_default=False,
+        ),
+    ]
index b9b8d5b3c5db53690bb6a0da37ec5e2995c4ad91..2028861739fb445f509f3ba5d4511c0b008643fd 100644 (file)
@@ -33,7 +33,7 @@ class PageImage(Image):
         order_with_respect_to = "page"
 
 
-class PagePlaylist(Playlist):
+class PagePlaylist(PlaylistRelated):
 
     page = models.ForeignKey(Page, verbose_name=_('page'), related_name='playlists', blank=True, null=True, on_delete=models.SET_NULL)
 
index b217e5461b4efc4da2ead70291fba087c9f13b9f..4c506f7b448b9bcacbbe82acbba664f8c1bb68e4 100644 (file)
@@ -26,7 +26,7 @@ class ProjectBlockInline(StackedDynamicInlineAdmin):
     model = ProjectBlock
 
 
-class ProjectPlaylistInline(StackedDynamicInlineAdmin):
+class ProjectPlaylistInline(TabularDynamicInlineAdmin):
 
     model = ProjectPlaylist
 
diff --git a/app/organization/projects/migrations/0021_auto_20161014_0002.py b/app/organization/projects/migrations/0021_auto_20161014_0002.py
new file mode 100644 (file)
index 0000000..a0d8cbe
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-13 22:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-media', '0009_auto_20161013_2353'),
+        ('organization-projects', '0020_auto_20161013_1631'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='projectplaylist',
+            name='playlist_ptr',
+        ),
+        migrations.AddField(
+            model_name='projectplaylist',
+            name='playlistrelated_ptr',
+            field=models.OneToOneField(auto_created=True, default=1, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='organization-media.PlaylistRelated'),
+            preserve_default=False,
+        ),
+    ]
index 38d14adb6c3bb57d2df62bee2399e2bd43664508..2b6525e82de2c537e481c7a4f53ae20c302701e6 100644 (file)
@@ -79,7 +79,7 @@ class ProjectProgramType(Named):
         ordering = ['name',]
 
 
-class ProjectPlaylist(Playlist):
+class ProjectPlaylist(PlaylistRelated):
 
     project = models.ForeignKey(Project, verbose_name=_('project'), related_name='playlists', blank=True, null=True, on_delete=models.SET_NULL)
 
index 0fe29e573d7cf428c6983382bd66f1ca5b325a69..5a560eaf014046104cc5272c4a9f3408a2e906e9 100644 (file)
 {% endblock %}
 
 {% block page_audio %}
-    {% with event.audios.all as audios %}
-        {% if audios %}
-            {% include 'core/inc/audio.html' %}
-        {% endif %}
+    {% with event as object %}
+        {{ block.super }}
     {% endwith %}
 {% endblock %}
 
 {% block page_slider %}
-    {% with event.images.all|get_type:'page_slider' as slider_images %}
-        {% if slider_images %}
-            {% include 'core/inc/slider.html' %}
-        {% endif %}
+    {% with event as object %}
+        {{ block.super }}
     {% endwith %}
 {% endblock %}
 
 {% block page_video %}
-    {% with event.videos.all as videos %}
-        {% if videos %}
-            {% include 'core/inc/slider_video.html' %}
-        {% endif %}
+    {% with event as object %}
+        {{ block.super }}
     {% endwith %}
 {% endblock %}
 
diff --git a/app/templates/core/inc/audio.html b/app/templates/core/inc/audio.html
deleted file mode 100644 (file)
index 8c31aa4..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-{% if audios %}
-
-    <audio preload="true"></audio>
-    <ol class="audio-playlist">
-
-        {% for audio in audios %}
-
-        <li class="audio-playlist__item">
-            <a href="#" data-src="{{ audio.open_source_url }}">{{ audio.title }}</a>
-        </li>
-
-        {% comment %}
-
-            {# audio.title #}<br>
-            {# audio.open_source_mime_type #}<br>
-            {# audio.closed_source_mime_type #}<br>
-            {# audio.category #}<br>
-            {# audio.media_id #}<br>
-            {# audio.open_source_url #}<br>
-            {# audio.closed_source_url #}<br>
-            {# audio.poster_url #}<br>
-            <audio>
-                <source src="{{ audio.open_source_url }}" type="{{ audio.open_source_mime_type }}">
-                <source src="{{ audio.closed_source_mime_type }}" type="{{ audio.closed_source_url }}">
-                Your browser does not support the audio element.
-            </audio>
-
-        {% endcomment %}
-
-        {% endfor %}
-
-    </ol>
-
-{% endif %}
diff --git a/app/templates/core/inc/slider_video.html b/app/templates/core/inc/slider_video.html
deleted file mode 100644 (file)
index 30ebaad..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-{% load mezzanine_tags %}
-<div class="page__slider">
-    <ul class="slider-page" data-slider-page>
-        {% for video in videos %}
-            <li class="slider-page__slide">
-                <div class="slider-page__wrapper">
-                    <div class="slider-page__video">
-                        <video controls class="video-js vjs-ircam-skin" data-setup='{"aspectRatio":"905:520"}' {% if video.poster_url %}poster="{{ video.poster_url }}"{% endif %}>
-                            <source src="{{ video.closed_source_url }}" type="{{ video.closed_source_mime_type }}">
-                            <source src="{{ video.open_source_url }}" type="{{ video.open_source_mime_type }}">
-                            Your browser does not support the video tag.
-                        </video>
-                    </div>
-                    <div class="slider-page__caption">
-                        {{ video.title }}
-                    </div>
-                </div>
-            </li>
-        {% endfor %}
-    </ul>
-</div>
diff --git a/app/templates/core/inc/video.html b/app/templates/core/inc/video.html
deleted file mode 100644 (file)
index 0f2df01..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{% for video in videos %}
-    {% comment %}
-        {# video.title #}<br>
-        {# video.open_source_mime_type #}<br>
-        {# video.closed_source_mime_type #}<br>
-        {# video.category #}<br>
-        {# video.media_id #}<br>
-        {# video.open_source_url #}<br>
-        {# video.closed_source_url #}<br>
-        {# video.poster_url #}<br>
-    {% endcomment %}
-
-  <video width="905" height="520" controls>
-    <source src="{{ video.closed_source_url }}" type="{{ video.closed_source_mime_type }}">
-    <source src="{{ video.open_source_url }}" type="{{ video.open_source_mime_type }}">
-    Your browser does not support the video tag.
-  </video>
-{% endfor %}
index a373955e9a534bbad72e7f94b271d6d3105b4091..f622fa19fdc96b74c07c4f47a7bceb9896cc414f 100644 (file)
@@ -5,9 +5,11 @@
 <ol class="audio-playlist">
     {% for media in playlist.medias.all %}
         <li class="audio-playlist__item">
-            {% for transcoded in media.media.transcoded.all %}
-                <a href="#" data-src="{{ transcoded.url }}">{{ media.media.title }}</a>
-            {% endfor %}
+            {% with media.media as media %}
+                {% for transcoded in media.transcoded.all %}
+                    <a href="#" data-src="{{ transcoded.url }}">{{ media.title }}</a>
+                {% endfor %}
+            {% endwith %}
         </li>
     {% endfor %}
 </ol>
index 7f638b66a2d0051c4c75f3d9c3668f00398aab00..7632f2d50cdc1a110f66c2e2ad06e2e6c5155d56 100644 (file)
@@ -1,11 +1,12 @@
 {% load mezzanine_tags keyword_tags i18n organization_tags %}
 
 {% for media in playlist.medias.all %}
+  {% with media.media as media %}
     {% if forloop.first %}
         <div class="embed-responsive">
                <video width="100%" poster="{{ media.poster_url }}" controls data-title="{{ media.title }}" preload="none">
-                {% for transcoded_media in media.transcoded.all %}
-                      <source src="{{ transcoded_media.url }}" type="{{ transcoded_media.mime_type }}" />
+                {% for transcoded in media.transcoded.all %}
+                      <source src="{{ transcoded.url }}" type="{{ transcoded.mime_type }}" />
                 {% endfor %}
                </video>
         </div>
@@ -16,4 +17,5 @@
     {% if forloop.last %}
         </ol>
     {% endif %}
+  {% endwith %}
 {% endfor %}
diff --git a/app/templates/media/inc/playlist_video_slider.html b/app/templates/media/inc/playlist_video_slider.html
new file mode 100644 (file)
index 0000000..eece8a2
--- /dev/null
@@ -0,0 +1,24 @@
+{% load mezzanine_tags %}
+<div class="page__slider">
+    <ul class="slider-page" data-slider-page>
+        {% for media in playlist.medias.all %}
+          {% with media.media as media %}
+            <li class="slider-page__slide">
+                <div class="slider-page__wrapper">
+                    <div class="slider-page__video">
+                        <video controls class="video-js vjs-ircam-skin" data-title="{{ media.title }}" data-setup='{"aspectRatio":"905:520"}' {% if media.poster_url %}poster="{{ media.poster_url }}"{% endif %}>
+                            {% for transcoded in media.transcoded.all %}
+                              <source src="{{ transcoded.url }}" type="{{ transcoded.mime_type }}" />
+                            {% endfor %}
+                            Your browser does not support the video tag.
+                        </video>
+                    </div>
+                    <div class="slider-page__caption">
+                        {{ video.title }}
+                    </div>
+                </div>
+            </li>
+          {% endwith %}
+        {% endfor %}
+    </ul>
+</div>
index cfb3b245bfa2428bfdbe6fcab42e3996abe78e6c..49c1f476aab8988364e44da40b2532e9fda580d2 100644 (file)
@@ -1,20 +1,6 @@
 {% extends "pages/page.html" %}
 {% load i18n mezzanine_tags keyword_tags pages_tags organization_tags %}
 
-{% block meta_title %}{{ page.meta_title }}{% endblock %}
-
-{% block meta_keywords %}{% metablock %}
-{% keywords_for page as keywords %}
-{% for keyword in keywords %}
-    {% if not forloop.first %}, {% endif %}
-    {{ keyword }}
-{% endfor %}
-{% endmetablock %}{% endblock %}
-
-{% block meta_description %}{% metablock %}
-{{ page.description }}
-{% endmetablock %}{% endblock %}
-
 {% block page_class %}
     custompage
 {% endblock %}
 
 {% endblock %}
 
-{% block page_link %}
-    {% with page.custompage.links.all as links %}
-        {% if links %}
-            {% include 'core/inc/link.html' %}
-        {% endif %}
-    {% endwith %}
-{% endblock %}
-
 {% block page_audio %}
-  {% with page.custompage.audios.all as audios %}
-    {% if audios %}
-      {% include 'core/inc/audio.html' %}
-    {% endif %}
+  {% with page.custompage as object %}
+      {{ block.super }}
   {% endwith %}
 {% endblock %}
 
 {% block page_slider %}
-  {% with page.custompage.images.all|get_type:'page_slider' as slider_images %}
-    {% if slider_images %}
-      {% include 'core/inc/slider.html' %}
-    {% endif %}
-  {% endwith %}
+    {% with page.custompage as object %}
+        {{ block.super }}
+    {% endwith %}
 {% endblock %}
 
 {% block page_video %}
-  {% with page.custompage.videos.all as videos %}
-    {% if videos %}
-      {% include 'core/inc/slider_video.html' %}
-    {% endif %}
+  {% with page.custompage as object %}
+      {{ block.super }}
   {% endwith %}
 {% endblock %}
 
index f833a2eba8a61beb827e5801759cc20a73293003..dd1523ff2fbeb99af1258258cc8e126ea2420735 100644 (file)
@@ -1,20 +1,6 @@
-{% extends "pages/custompage.html" %}
+{% extends "pages/page.html" %}
 {% load i18n mezzanine_tags keyword_tags pages_tags organization_tags %}
 
-{% block meta_title %}{{ page.meta_title }}{% endblock %}
-
-{% block meta_keywords %}{% metablock %}
-{% keywords_for page as keywords %}
-{% for keyword in keywords %}
-    {% if not forloop.first %}, {% endif %}
-    {{ keyword }}
-{% endfor %}
-{% endmetablock %}{% endblock %}
-
-{% block meta_description %}{% metablock %}
-{{ page.description }}
-{% endmetablock %}{% endblock %}
-
 {% block page_class %}
     department
 {% endblock %}
 {% endblock %}
 
 {% block page_audio %}
-  {% with page.departmentpage.audios.all as audios %}
-    {% if audios %}
-      {% include 'core/inc/audio.html' %}
-    {% endif %}
+  {% with page.departmentpage as object %}
+      {{ block.super }}
   {% endwith %}
 {% endblock %}
 
 {% block page_slider %}
-{% with page.departmentpage.images.all|get_type:'page_slider' as slider_images %}
-  {% if slider_images %}
-    {% include 'core/inc/slider.html' %}
-  {% endif %}
-{% endwith %}
+    {% with page.departmentpage as object %}
+        {{ block.super }}
+    {% endwith %}
 {% endblock %}
 
 {% block page_video %}
-  {% with page.departmentpage.videos.all as videos %}
-    {% if videos %}
-      {% include 'core/inc/slider_video.html' %}
-    {% endif %}
+  {% with page.departmentpage as object %}
+      {{ block.super }}
   {% endwith %}
 {% endblock %}
 
index 1b927040ce2798b193563d19405dbb3110fdefb7..af1e55e66b9c51842ecb0c79de3bdbbf4ca44fec 100644 (file)
                         {% endwith %}
                     {% endblock %}
                     {% block page_audio %}
-                        {% with object.audios.all as audios %}
-                            {% if audios %}
-                                {% include 'core/inc/audio.html' %}
-                            {% endif %}
-                        {% endwith %}
+                        {% for related in object.playlists.all %}
+                            {% with related.playlist as playlist %}
+                                {% if playlist.type == 'audio' %}
+                                    {% include 'media/inc/playlist_audio_detail.html' %}
+                                {% endif %}
+                            {% endwith %}
+                        {% endfor %}
                     {% endblock %}
                 </div>
 
             </div>
 
         </div>
+
         {% block page_slider %}
         {% with object.images.all|get_type:'page_slider' as slider_images %}
             {% if slider_images %}
             {% endif %}
         {% endwith %}
         {% endblock %}
+
         {% block page_video %}
-            {% with object.videos.all as videos %}
-                {% if videos %}
-                    {% include 'core/inc/slider_video.html' %}
-                {% endif %}
-            {% endwith %}
+            {% for related in object.playlists.all %}
+                {% with related.playlist as playlist %}
+                    {% if playlist.type == 'video' %}
+                        {% include 'media/inc/playlist_video_slider.html' %}
+                    {% endif %}
+                {% endwith %}
+            {% endfor %}
         {% endblock %}
+
+
         {% block page_person_list %}
         {% endblock %}
         {% block products %}
index 3b70d1162bb83e83c2aec0e2e9bd4315866ffc1d..b22e1097cc1109234f37cc41e888a44b3a80ea4b 100644 (file)
@@ -1,20 +1,6 @@
-{% extends "pages/custompage.html" %}
+{% extends "pages/page.html" %}
 {% load i18n mezzanine_tags keyword_tags  pages_tags organization_tags %}
 
-{% block meta_title %}{{ page.meta_title }}{% endblock %}
-
-{% block meta_keywords %}{% metablock %}
-{% keywords_for page as keywords %}
-{% for keyword in keywords %}
-    {% if not forloop.first %}, {% endif %}
-    {{ keyword }}
-{% endfor %}
-{% endmetablock %}{% endblock %}
-
-{% block meta_description %}{% metablock %}
-{{ page.description }}
-{% endmetablock %}{% endblock %}
-
 {% block page_class %}
     department
 {% endblock %}
 {% endblock %}
 
 {% block page_audio %}
-  {% with page.teampage.audios.all as audios %}
-    {% if audios %}
-      {% include 'core/inc/audio.html' %}
-    {% endif %}
+  {% with page.teampage as object %}
+      {{ block.super }}
   {% endwith %}
 {% endblock %}
 
 {% block page_slider %}
-    {% with page.teampage.images.all|get_type:'page_slider' as slider_images %}
-      {% if slider_images %}
-        {% include 'core/inc/slider.html' %}
-      {% endif %}
+    {% with page.teampage as object %}
+        {{ block.super }}
     {% endwith %}
 {% endblock %}
 
 {% block page_video %}
-  {% with page.teampage.videos.all as videos %}
-    {% if videos %}
-      {% include 'core/inc/slider_video.html' %}
-    {% endif %}
+  {% with page.teampage as object %}
+      {{ block.super }}
   {% endwith %}
 {% endblock %}
 
-
 {% block page_sub_content %}
   {% with page.teampage.blocks.all as blocks %}
     {% include "core/inc/block.html" %}
index f5a81066f7410c5af33adb399becfe9cde4ae7a0..c2e5e182342bdeb98974efa2a27e68eca3642410 100644 (file)
 {% endblock %}
 
 {% block page_audio %}
-    {% with project.audios.all as audios %}
-        {% if audios %}
-            {% include 'core/inc/audio.html' %}
-        {% endif %}
-    {% endwith %}
+  {% with project as object %}
+      {{ block.super }}
+  {% endwith %}
 {% endblock %}
 
 {% block page_slider %}
-    {% with project.images.all|get_type:'page_slider' as slider_images %}
-        {% if slider_images %}
-            {% include 'core/inc/slider.html' %}
-        {% endif %}
+    {% with project as object %}
+        {{ block.super }}
     {% endwith %}
 {% endblock %}
 
 {% block page_video %}
-    {% with project.videos.all as videos %}
-        {% if videos %}
-            {% include 'core/inc/slider_video.html' %}
-        {% endif %}
-    {% endwith %}
+  {% with project as object %}
+      {{ block.super }}
+  {% endwith %}
 {% endblock %}
 
 {% block page_sub_content %}