'organization-core.LinkType')),
(_('Media'), ('organization-media.Media',
'organization-media.Playlist',
+ 'organization-media.LiveStreaming',
'organization-media.MediaCategory',
(_('Media Library'), 'fb_browse'),
)),
else :
dict["other"].append(dc)
return dict
+
+@register.filter
+def format_iso(date):
+ return date.isoformat()
--- /dev/null
+# -*- 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'),
+ ),
+ ]
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
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"
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")
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
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:
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:
$('#countdown').html('<br />');
}
-function CountDownTimer(dt, id, video_id, video_url)
+function CountDownTimer(dt, id, video_id/*, video_url*/)
{
var end = new Date(dt);
$('#countdown-title').html('<br /><br />');
$('#'+id).html('<br />');
$('#live').html('- Live !');
- switchVideo(video_id, video_url);
+ //switchVideo(video_id, video_url);
return;
}
$(window).scrollLeft()) + "px");
return this;
}
-
@import 'instagram';
@import 'hero';
@import 'overlay';
+@import 'live-streaming';
+
// Typography modules
@import 'dashed';
--- /dev/null
+// -*- 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 <http://www.gnu.org/licenses/>.
+
+$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;
+ }
+
+
+
+}
--- /dev/null
+{% 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 %}
+
+ <div class="page page--{% spaceless %}{% block page_class %}{% endblock %}{% endspaceless %}">
+ <div class="container">
+
+ <div class="row">
+
+ <div class="col-sm-16 col-md-12 col-md-push-2 tac">
+ {% block page_title %}
+ {{ page.title }}
+ {% endblock %}
+ </div>
+
+ </div>
+
+ <div class="row">
+
+ <div class="col-md-2 page__sidebar">
+
+ <div style="position: relative;">
+ {% block page_sidebar %}
+ {% endblock %}
+ </div>
+
+ </div>
+
+ <div class="mb2 col-sm-16 col-md-12 page__content" data-summary-content>
+ {% 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 %}
+ </div>
+
+ </div>
+
+ </div>
+
+ {% 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 %}
+
+ <div class="">
+
+ {% 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 %}
+ <div class="page__block{% if block.background_color %} page__block--{{ block.background_color }}{% endif %}">
+ <div class="white-bg pb2">
+ <div class="container">
+ <div class="row" data-summary-content>
+ <div class="col-sm-16">
+ <ul class="partners-list">
+ {% include 'core/inc/logo.html' %}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endif %}
+ {% endwith %}
+ {% endblock %}
+
+ </div>
+
+ </div>
+
+ <div>
+
+ {% block page_related_content %}
+ {% with dynamic_content=page.dynamic_content_pages.all|filter_content object=page %}
+ {% include "core/inc/related_content.html" %}
+ {% endwith %}
+ {% endblock %}
+
+ </div>
+
+
+{% endblock %}
--- /dev/null
+{% 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 %}
+ <h1 class="section-title section-title--uppercase section-title--main">{{ object.title }}</h1>
+ {% endeditable %}
+{% endblock %}
+
+{% block page_sidebar %}
+{% endblock %}
+
+{% block page_content %}
+ {% if object.type = "youtube" %}
+ {% if object.youtube_id %}
+ <div style="position:relative;height:0;padding-bottom:75.0%">
+ <iframe src="https://www.youtube.com/embed/{{ object.youtube_id }}?ecver=2" width="1280" height="720" frameborder="0" style="position:absolute;width:100%;height:100%;left:0" allowfullscreen></iframe>
+ </div>
+ {% else %}
+ <p>Please fill youtube id</p>
+ {% endif %}
+ {% elif object.type = "html5" %}
+ {% if object.html5_url %}
+ <video id="live-streaming" width="1280" height="720" controls autoplay>
+ <source src="{{ object.html5_url }}" type="video/webm">
+ </video>
+ {% else %}
+ <p>Please fill html5 live streaming url</p>
+ {% endif %}
+ {% endif %}
+
+ <div class="overlay">
+ <div id="countdown-title"></div>
+ <div id="countdown"></div>
+ </div>
+{% endblock %}
+
+{% block footer_scripts %}
+ {{ block.super }}
+ <script src="{% static "src/js/modules/live-streaming-counter.js" %}"></script>
+
+ <script type="text/javascript">
+ var countdowndate = '{{ next_event.start|format_iso }}';
+ CountDownTimer(countdowndate, 'countdown', 'live-streaming');
+ </script>
+{% endblock %}
--- /dev/null
+{% extends "pages/page.html" %}
+{% load mezzanine_tags keyword_tags i18n organization_tags %}
+
+
+{% block main %}
+
+ {% block hero %}
+ {% endblock %}
+
+ <div class="page page--{% spaceless %}{% block page_class %}{% endblock %}{% endspaceless %}">
+ <div class="container">
+
+ <div class="row">
+
+ <div class="col-sm-16 col-md-12 col-md-push-2 tac">
+ {% block page_title %}
+ {{ page.title }}
+ {% endblock %}
+ </div>
+
+ </div>
+
+ <div class="row">
+
+ <div class="mb2 col-sm-16 col-md-12 col-lg-16 page__content" data-summary-content>
+ {% 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 %}
+ </div>
+
+ </div>
+
+ </div>
+
+ {% 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 %}
+
+ <div class="">
+
+ {% 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 %}
+ <div class="page__block{% if block.background_color %} page__block--{{ block.background_color }}{% endif %}">
+ <div class="white-bg pb2">
+ <div class="container">
+ <div class="row" data-summary-content>
+ <div class="col-sm-16">
+ <ul class="partners-list">
+ {% include 'core/inc/logo.html' %}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endif %}
+ {% endwith %}
+ {% endblock %}
+
+ </div>
+
+ </div>
+
+ <div>
+
+ {% block page_related_content %}
+ {% with dynamic_content=page.dynamic_content_pages.all|filter_content object=page %}
+ {% include "core/inc/related_content.html" %}
+ {% endwith %}
+ {% endblock %}
+
+ </div>
+
+
+{% endblock %}