-__version__ = 0.1
+__version__ = 1.0
model = EventImage
-class EventPlaylistInline(StackedDynamicInlineAdmin):
+class EventPlaylistInline(TabularDynamicInlineAdmin):
model = EventPlaylist
--- /dev/null
+# -*- 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,
+ ),
+ ]
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)
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'))
--- /dev/null
+# -*- 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,
+ ),
+ ]
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 *
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)
--- /dev/null
+# -*- 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'},
+ ),
+ ]
--- /dev/null
+# -*- 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'),
+ ),
+ ]
--- /dev/null
+# -*- 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'),
+ ),
+ ]
return MEDIA_BASE_URL + self.external_id
def get_html(self):
+ print(self.uri)
r = requests.get(self.uri)
return r.content
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
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})
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')
from organization.pages.admin import PageImageInline, PageBlockInline, PagePlaylistInline
-class OrganizationPlaylistInline(StackedDynamicInlineAdmin):
+class OrganizationPlaylistInline(TabularDynamicInlineAdmin):
model = OrganizationPlaylist
--- /dev/null
+# -*- 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,
+ ),
+ ]
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)
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)
model = PageImage
-class PagePlaylistInline(StackedDynamicInlineAdmin):
+class PagePlaylistInline(TabularDynamicInlineAdmin):
model = PagePlaylist
- exclude = ("short_url", "keywords", "description", "slug", )
class PageLinkInline(StackedDynamicInlineAdmin):
--- /dev/null
+# -*- 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,
+ ),
+ ]
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)
model = ProjectBlock
-class ProjectPlaylistInline(StackedDynamicInlineAdmin):
+class ProjectPlaylistInline(TabularDynamicInlineAdmin):
model = ProjectPlaylist
--- /dev/null
+# -*- 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,
+ ),
+ ]
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)
{% 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 %}
+++ /dev/null
-{% 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 %}
+++ /dev/null
-{% 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>
+++ /dev/null
-{% 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 %}
<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>
{% 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>
{% if forloop.last %}
</ol>
{% endif %}
+ {% endwith %}
{% endfor %}
--- /dev/null
+{% 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>
{% 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 %}
-{% 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 %}
{% 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 %}
-{% 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" %}
{% 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 %}