From: Emilie Date: Wed, 15 Mar 2017 09:26:22 +0000 (+0100) Subject: [Vertigo M&C] live streaming X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=e8318b68065bab1e019c9b7eb3784678e9f0a28c;p=mezzo.git [Vertigo M&C] live streaming --- diff --git a/app/local_settings.py b/app/local_settings.py index 4d77d167..592145ad 100644 --- a/app/local_settings.py +++ b/app/local_settings.py @@ -87,6 +87,7 @@ ADMIN_MENU_ORDER = ( 'organization-core.LinkType')), (_('Media'), ('organization-media.Media', 'organization-media.Playlist', + 'organization-media.LiveStreaming', 'organization-media.MediaCategory', (_('Media Library'), 'fb_browse'), )), diff --git a/app/organization/core/templatetags/organization_tags.py b/app/organization/core/templatetags/organization_tags.py index a3db871a..7b66bf79 100644 --- a/app/organization/core/templatetags/organization_tags.py +++ b/app/organization/core/templatetags/organization_tags.py @@ -238,3 +238,7 @@ def filter_content(dynamic_contents): else : dict["other"].append(dc) return dict + +@register.filter +def format_iso(date): + return date.isoformat() diff --git a/app/organization/media/migrations/0015_livestreaming_event_location.py b/app/organization/media/migrations/0015_livestreaming_event_location.py new file mode 100644 index 00000000..30c0286c --- /dev/null +++ b/app/organization/media/migrations/0015_livestreaming_event_location.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2017-03-14 18:32 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('mezzanine_agenda', '0017_auto_20170222_1039'), + ('organization-media', '0014_livestreaming'), + ] + + operations = [ + migrations.AddField( + model_name='livestreaming', + name='event_location', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='live_streaming_location', to='mezzanine_agenda.EventLocation', verbose_name='Event Location'), + ), + ] diff --git a/app/organization/media/models.py b/app/organization/media/models.py index ffe49571..6baf0328 100644 --- a/app/organization/media/models.py +++ b/app/organization/media/models.py @@ -30,7 +30,7 @@ from mezzanine.core.models import RichText, Displayable, Slugged from mezzanine.core.fields import RichTextField, OrderField, FileField from mezzanine.utils.models import AdminThumbMixin, upload_to from organization.core.models import * -from mezzanine_agenda.models import Event +from mezzanine_agenda.models import Event, EventLocation from django.conf import settings import requests @@ -183,6 +183,7 @@ class LiveStreaming(Displayable): html5_url = models.URLField(_('html5 url'), max_length=1024, blank=True) youtube_id = models.CharField(_('youtube id'), max_length=64, blank=True, null=True) type = models.CharField(_('type'), max_length=32, choices=LIVE_STREAMING_TYPE_CHOICES, default='html5') + event_location = models.ForeignKey(EventLocation, verbose_name=_('Event Location'), related_name='live_streaming_location', blank=True, null=True, on_delete=models.SET_NULL) class Meta: verbose_name = "live streaming" diff --git a/app/organization/media/views.py b/app/organization/media/views.py index 8f89245c..0f1c8d25 100644 --- a/app/organization/media/views.py +++ b/app/organization/media/views.py @@ -25,6 +25,7 @@ from organization.media.models import * from organization.core.views import * from dal import autocomplete from django.core.exceptions import FieldDoesNotExist +from datetime import datetime # temporarily excluse not ready models EXCLUDED_MODELS = ("organizationplaylist", "personplaylist") @@ -132,4 +133,9 @@ class PlaylistOverlayView(SlugMixin, DetailView): class LiveStreamingDetailView(SlugMixin, DetailView): model = LiveStreaming - template_name='media/live_streaming_detail.html' + template_name='media/live_streaming/live_streaming_detail.html' + + def get_context_data(self, **kwargs): + context = super(LiveStreamingDetailView, self).get_context_data(**kwargs) + context['next_event'] = Event.objects.filter(location=self.object.event_location).filter(start__gt=datetime.now()).first() + return context diff --git a/app/organization/projects/models.py b/app/organization/projects/models.py index 75116285..3d5d1498 100644 --- a/app/organization/projects/models.py +++ b/app/organization/projects/models.py @@ -336,12 +336,12 @@ class ProjectPublicData(models.Model): project = models.ForeignKey(Project, verbose_name=_('project'), related_name='public_data', blank=True, null=True, on_delete=models.SET_NULL) brief_description = models.CharField(_('brief description'), max_length=110, help_text="Brief description of the challenges faced by the project to be used for wider communication strategy (e.g. Twitter) (110 characters max).") - challenges_description = models.TextField(_('challenges description'), help_text="Full description of the challenges faced by the project (100-150 words).") + challenges_description = models.TextField(_('full description'), help_text="Full description of the challenges faced by the project (100-150 words).") technology_description = models.TextField(_('technology description'), help_text="Must include the elements to be made available to the artist with sufficient functional and implementation details for enabling him/her to elaborate his/her technical approach (100-200 words).") - objectives_description = models.TextField(_('objectives description'), help_text="What the project is looking to gain from the collaboration and what kind of artist would be suitable (100 – 150 words).") + objectives_description = models.TextField(_('objective description'), help_text="What the project is looking to gain from the collaboration and what kind of artist would be suitable (100 – 150 words).") resources_description = models.TextField(_('resource description'), help_text="Resources available to the artist -- e.g. office facility, studio facility, technical equipment, internet connection, laboratory, and periods of availability for artistic production, staff possibly allocated to the project, available budget for travel, consumables and equipment, etc... (50 – 100 words).") period = models.CharField(_('period of implementation'), max_length=128, help_text="Possible period of implementation (must be part of the project implementation workplan)") - image = models.FileField(_("Image"), max_length=1024, upload_to="user/images/%Y/%m/%d/", help_text="Representing the project") + image = models.FileField(_("Image"), max_length=1024, upload_to="images", help_text="Representing the project") image_credits = models.CharField(_('Image credits'), max_length=256, blank=True, null=True) class Meta: @@ -355,7 +355,7 @@ class ProjectPrivateData(models.Model): description = models.TextField(_('project description'), help_text="(500 - 1000 words)") affiliation = models.CharField(_('affiliation'), max_length=512) - commitment_letter = models.FileField(_("letter of commitment by the project coordinator"), max_length=1024, upload_to="user/documents/%Y/%m/%d/", help_text="Written on behalf of the whole project consortium, this letter will commit in implementing the collaboration of a residency application selected by the VERTIGO jury, on the conditions set by the project (in annex of letter: synthesis of all related information entered by project).") + commitment_letter = models.FileField(_("letter of commitment by the project coordinator"), max_length=1024, upload_to="Documents/%Y/%m/%d/", help_text="Written on behalf of the whole project consortium, this letter will commit in implementing the collaboration of a residency application selected by the VERTIGO jury, on the conditions set by the project (in annex of letter: synthesis of all related information entered by project).") persons = models.CharField(_('persons'), max_length=512, help_text="First name and last name of the persons from organization / project who will be part preliminary of the project team (separated by a comma)") class Meta: diff --git a/app/themes/base/static/img/vertigo-starts/vertigo_tx.png b/app/themes/base/static/img/vertigo-starts/vertigo_tx.png deleted file mode 100644 index 7f32d1a4..00000000 Binary files a/app/themes/base/static/img/vertigo-starts/vertigo_tx.png and /dev/null differ diff --git a/app/themes/base/static/src/js/modules/live-streaming-counter.js b/app/themes/base/static/src/js/modules/live-streaming-counter.js index 1af7d49d..323b6e15 100644 --- a/app/themes/base/static/src/js/modules/live-streaming-counter.js +++ b/app/themes/base/static/src/js/modules/live-streaming-counter.js @@ -32,7 +32,7 @@ function cleanCounter() { $('#countdown').html('
'); } -function CountDownTimer(dt, id, video_id, video_url) +function CountDownTimer(dt, id, video_id/*, video_url*/) { var end = new Date(dt); @@ -52,7 +52,7 @@ function CountDownTimer(dt, id, video_id, video_url) $('#countdown-title').html('

'); $('#'+id).html('
'); $('#live').html('- Live !'); - switchVideo(video_id, video_url); + //switchVideo(video_id, video_url); return; } @@ -82,4 +82,3 @@ jQuery.fn.center = function () { $(window).scrollLeft()) + "px"); return this; } - diff --git a/app/themes/base/static/src/sass/modules/_all.scss b/app/themes/base/static/src/sass/modules/_all.scss index be0adf8b..53b1c05e 100755 --- a/app/themes/base/static/src/sass/modules/_all.scss +++ b/app/themes/base/static/src/sass/modules/_all.scss @@ -70,6 +70,8 @@ @import 'instagram'; @import 'hero'; @import 'overlay'; +@import 'live-streaming'; + // Typography modules @import 'dashed'; diff --git a/app/themes/base/static/src/sass/modules/_live-streaming.scss b/app/themes/base/static/src/sass/modules/_live-streaming.scss new file mode 100644 index 00000000..8fb6e446 --- /dev/null +++ b/app/themes/base/static/src/sass/modules/_live-streaming.scss @@ -0,0 +1,53 @@ +// -*- coding: utf-8 -*- + +// Copyright (c) 2016-2017 Ircam +// Copyright (c) 2016-2017 Jérémy Fabre + +// This file is part of mezzanine-organization. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. + +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +$module: ".page--live-streaming"; + +#{$module} { + + & .page__content { + + text-align: center; + + } + + video { + + } + + .overlay { + background: #FFFFFF; + position:relative; + top:-260px; + z-index:90; + color: white; + font-size:1.3em; + height: 720px; + } + + #countdown { + margin-top: 1em; + font-weight: bold; + color: red; + } + + + +} diff --git a/app/themes/base/templates/media/live_streaming/base.html b/app/themes/base/templates/media/live_streaming/base.html new file mode 100644 index 00000000..3e3fd0b7 --- /dev/null +++ b/app/themes/base/templates/media/live_streaming/base.html @@ -0,0 +1,174 @@ +{% extends "base.html" %} +{% load i18n mezzanine_tags keyword_tags organization_tags pages_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 main %} + + {% block hero %} + {% endblock %} + +
+
+ +
+ +
+ {% block page_title %} + {{ page.title }} + {% endblock %} +
+ +
+ +
+ +
+ +
+ {% block page_sidebar %} + {% endblock %} +
+ +
+ +
+ {% block page_content %} + {{ page.content }} + {% endblock %} + {% block page_link %} + {% with object.links.all as links %} + {% if links %} + {% include 'core/inc/link.html' %} + {% endif %} + {% endwith %} + {% endblock %} + {% block page_file %} + {% with object.files.all as files %} + {% if files %} + {% include 'core/inc/files.html' %} + {% endif %} + {% endwith %} + {% endblock %} + {% block page_audio %} + {% 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 %} +
+ +
+ +
+ + {% block page_slider %} + {% with object.images.all|get_type:'page_slider' as slider_images %} + {% if slider_images %} + {% include 'core/inc/slider.html' %} + {% endif %} + {% endwith %} + {% endblock %} + + {% block page_video %} + {% 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 page_demo %} + {% endblock %} + + {% block page_blog %} + {% endblock %} + + {% block page_sub_content %} + {% with object.blocks.all as blocks %} + {% include "core/inc/block.html" %} + {% endwith %} + {% endblock %} + + {% block related_project %} + {% endblock %} + + {% block products %} + {% if page.product_lists.all|length > 0 %} + {% for page_product_list in page.product_lists.all %} + {% with page_product_list.list as list %} + {% with "shop/includes/product_list_"|add:list.style|add:"_style.html" as template %} + {% include template %} + {% endwith %} + {% endwith %} + {% endfor %} + {% endif %} + {% endblock %} + + {% block page_sub_content_2 %} + {% endblock %} + + {% block page_person_list_team %} + {% endblock %} + + {% block page_sub_content_3 %} + {% endblock %} + + {% block logo %} + {% with page.images.all|get_type:'logo' as images %} + {% if images %} +
+
+
+
+
+
    + {% include 'core/inc/logo.html' %} +
+
+
+
+
+
+ {% endif %} + {% endwith %} + {% endblock %} + +
+ +
+ +
+ + {% block page_related_content %} + {% with dynamic_content=page.dynamic_content_pages.all|filter_content object=page %} + {% include "core/inc/related_content.html" %} + {% endwith %} + {% endblock %} + +
+ + +{% endblock %} diff --git a/app/themes/base/templates/media/live_streaming/live_streaming_detail.html b/app/themes/base/templates/media/live_streaming/live_streaming_detail.html new file mode 100644 index 00000000..11a142e6 --- /dev/null +++ b/app/themes/base/templates/media/live_streaming/live_streaming_detail.html @@ -0,0 +1,53 @@ +{% extends "media/media_base.html" %} +{% load mezzanine_tags keyword_tags i18n organization_tags staticfiles %} + +{% block meta_title %}{% trans "Live Streaming" %}{% endblock %} + + +{% block page_class %} + live-streaming +{% endblock %} + +{% block page_title %} + {% editable person.title %} +

{{ object.title }}

+ {% endeditable %} +{% endblock %} + +{% block page_sidebar %} +{% endblock %} + +{% block page_content %} + {% if object.type = "youtube" %} + {% if object.youtube_id %} +
+ +
+ {% else %} +

Please fill youtube id

+ {% endif %} + {% elif object.type = "html5" %} + {% if object.html5_url %} + + {% else %} +

Please fill html5 live streaming url

+ {% endif %} + {% endif %} + +
+
+
+
+{% endblock %} + +{% block footer_scripts %} + {{ block.super }} + + + +{% endblock %} diff --git a/app/themes/base/templates/media/media_base.html b/app/themes/base/templates/media/media_base.html new file mode 100644 index 00000000..cfe5065b --- /dev/null +++ b/app/themes/base/templates/media/media_base.html @@ -0,0 +1,152 @@ +{% extends "pages/page.html" %} +{% load mezzanine_tags keyword_tags i18n organization_tags %} + + +{% block main %} + + {% block hero %} + {% endblock %} + +
+
+ +
+ +
+ {% block page_title %} + {{ page.title }} + {% endblock %} +
+ +
+ +
+ +
+ {% block page_content %} + {{ page.content }} + {% endblock %} + {% block page_link %} + {% with object.links.all as links %} + {% if links %} + {% include 'core/inc/link.html' %} + {% endif %} + {% endwith %} + {% endblock %} + {% block page_file %} + {% with object.files.all as files %} + {% if files %} + {% include 'core/inc/files.html' %} + {% endif %} + {% endwith %} + {% endblock %} + {% block page_audio %} + {% 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 %} +
+ +
+ +
+ + {% block page_slider %} + {% with object.images.all|get_type:'page_slider' as slider_images %} + {% if slider_images %} + {% include 'core/inc/slider.html' %} + {% endif %} + {% endwith %} + {% endblock %} + + {% block page_video %} + {% 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 page_demo %} + {% endblock %} + + {% block page_blog %} + {% endblock %} + + {% block page_sub_content %} + {% with object.blocks.all as blocks %} + {% include "core/inc/block.html" %} + {% endwith %} + {% endblock %} + + {% block related_project %} + {% endblock %} + + {% block products %} + {% if page.product_lists.all|length > 0 %} + {% for page_product_list in page.product_lists.all %} + {% with page_product_list.list as list %} + {% with "shop/includes/product_list_"|add:list.style|add:"_style.html" as template %} + {% include template %} + {% endwith %} + {% endwith %} + {% endfor %} + {% endif %} + {% endblock %} + + {% block page_sub_content_2 %} + {% endblock %} + + {% block page_person_list_team %} + {% endblock %} + + {% block page_sub_content_3 %} + {% endblock %} + + {% block logo %} + {% with page.images.all|get_type:'logo' as images %} + {% if images %} +
+
+
+
+
+
    + {% include 'core/inc/logo.html' %} +
+
+
+
+
+
+ {% endif %} + {% endwith %} + {% endblock %} + +
+ +
+ +
+ + {% block page_related_content %} + {% with dynamic_content=page.dynamic_content_pages.all|filter_content object=page %} + {% include "core/inc/related_content.html" %} + {% endwith %} + {% endblock %} + +
+ + +{% endblock %}