From b0f7b6f9cce0b902dd6f8533fd41af9bdc279e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 2 Dec 2011 15:53:07 +0100 Subject: [PATCH] Turn "listen" link into a popup if a player is configured (#995) --- tabellio/webviews/streaming.pt | 11 ++++++++++- tabellio/webviews/streaming.py | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/tabellio/webviews/streaming.pt b/tabellio/webviews/streaming.pt index 52e466e..716f46f 100644 --- a/tabellio/webviews/streaming.pt +++ b/tabellio/webviews/streaming.pt @@ -15,8 +15,17 @@ tal:define="current_meeting view/current_meeting; next_meeting view/next_meeting;">
- Écoutez la séance en direct + Écoutez la séance en direct
+ +
Prochaine séance :
diff --git a/tabellio/webviews/streaming.py b/tabellio/webviews/streaming.py index 47b1742..2f30ebc 100644 --- a/tabellio/webviews/streaming.py +++ b/tabellio/webviews/streaming.py @@ -1,5 +1,7 @@ import datetime +from zope import component + from plone.portlets.interfaces import IPortletDataProvider from zope.component import adapts, getMultiAdapter, queryUtility from zope.formlib import form @@ -8,6 +10,8 @@ from zope import schema from Acquisition import aq_inner, aq_base, aq_parent from Products.CMFCore.utils import getToolByName +from plone.registry.interfaces import IRegistry +from tabellio.config.interfaces import ITabellioSettings from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from plone.app.portlets.portlets import base @@ -65,6 +69,12 @@ class Renderer(base.Renderer): return event return None + def live_url(self): + settings = component.getUtility(IRegistry).forInterface(ITabellioSettings, False) + if settings.embedded_audio_player_url: + return settings.embedded_audio_player_url + return self.current_meeting.absolute_url() + '/ecouter.m3u' + def next_meeting(self): catalog = getToolByName(self.context, 'portal_catalog') # do not go more than 30 days in the future