remove event views, moved to parlement specific modules

This commit is contained in:
Frédéric Péters 2011-11-25 15:13:37 +01:00
parent 812f1374fc
commit fca8f5a1dd
6 changed files with 1 additions and 221 deletions

View File

@ -1,19 +1,13 @@
from five import grok
from zope import schema
from zope.interface import implements
from z3c.relationfield.schema import RelationChoice
from Products.CMFCore.utils import getToolByName
import datetime
from plone.formwidget.contenttree import ObjPathSourceBinder
from themis.fields import LegisSession
from plone.app.textfield import RichText
from themis.datatypes.commission import ICommission
from tabellio.agenda.interfaces import MessageFactory as _
from parlevent import IParlEvent, ParlEvent, ParlEventBaseView
from parlevent import IParlEvent, ParlEvent
class IComEvent(IParlEvent):
@ -29,8 +23,3 @@ class ComEvent(ParlEvent):
def klass(self):
return 'commission-event'
class View(grok.View, ParlEventBaseView):
grok.context(IComEvent)
grok.require('zope2.View')

View File

@ -1,61 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="tabellio.agenda">
<body>
<metal:main fill-slot="main">
<tal:main-macro metal:define-macro="main"
tal:define="toLocalizedTime nocall:context/@@plone/toLocalizedTime">
<div tal:replace="structure provider:plone.abovecontenttitle" />
<h1 class="documentFirstHeading"><span tal:content="context/aq_parent/Title"/></h1>
<div tal:replace="structure provider:plone.belowcontenttitle" />
<div class="blocdate">
<a href="#" class="previous" tal:attributes="href view/previous_event_url">←</a>
<div class="date">
<span class="day" tal:content="context/start/day">30</span>
<span class="month" tal:content="context/start_month">mars</span>
<a href="." class="open-calendar" tal:attributes="href string:./?year=${context/start/year}&month=${context/start/month}">Ouvrir le calendrier</a>
</div>
<a href="#" class="next" tal:attributes="href view/next_event_url">→</a>
</div>
<h1 class="parlevent-title"><span tal:content="context/title">title</span><br/><span tal:content="string: (${context/session})">(2011-2012)</span></h1>
<p>
<span class="parlevent-start" tal:content="string: ${context/start_hour}">14h00</span>
<span tal:condition="context/end"> -
<span class="parlevent-end" tal:content="string: ${context/end_hour}">16h00</span>
</span>
</p>
<p class="place" tal:content="context/place">
</p>
<ul id="cri-stream">
<li><a href="#" class="cri" tal:condition="python: context.cri and context.cri.to_object"
tal:attributes="href context/cri/to_object/absolute_url">Compte-rendu intégral</a>
<span class="cri" tal:condition="python: not(context.cri and context.cri.to_object)">Compte-rendu intégral (non disponible)</span></li>
<li><a href="#" class="streaming" tal:condition="view/has_stream">Streaming</a>
<span class="streaming" tal:condition="not: view/has_stream">Streaming (non disponible)</span></li>
</ul>
<div class="order-of-the-day" tal:condition="context/order_of_the_day">
<h2>Ordre du jour</h2>
<div tal:content="structure context/order_of_the_day/output"/>
</div>
<div tal:replace="structure provider:plone.belowcontentbody" />
</tal:main-macro>
</metal:main>
</body>
</html>

View File

@ -2,7 +2,6 @@
import datetime
from five import grok
from zope import schema
from zope.interface import implements
from Products.Five.browser import BrowserView
@ -115,13 +114,3 @@ class EventBaseView:
return serie_of_events[i-1].getURL()
return None
class View(grok.View, EventBaseView):
grok.context(IEvent)
grok.require('zope2.View')
def next_event_url(self):
return EventBaseView.next_event_url(self)
def previous_event_url(self):
return EventBaseView.previous_event_url(self)

View File

@ -1,46 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="tabellio.agenda">
<body>
<metal:main fill-slot="main">
<tal:main-macro metal:define-macro="main"
tal:define="toLocalizedTime nocall:context/@@plone/toLocalizedTime">
<div tal:replace="structure provider:plone.abovecontenttitle" />
<h1 class="documentFirstHeading"><span tal:content="context/aq_parent/Title"/></h1>
<div tal:replace="structure provider:plone.belowcontenttitle" />
<div class="blocdate">
<a href="#" class="previous" tal:attributes="href view/previous_event_url">←</a>
<div class="date">
<span class="day" tal:content="context/start/day">30</span>
<span class="month" tal:content="context/start_month">mars</span>
<a href="." class="open-calendar" tal:attributes="href string:./?year=${context/start/year}&month=${context/start/month}">Ouvrir le calendrier</a>
</div>
<a href="#" class="next" tal:attributes="href view/next_event_url">→</a>
</div>
<h1 class="parlevent-title"><span tal:content="context/title">title</span></h1>
<p tal:condition="context/start_hour">
<span class="parlevent-start" tal:content="string: ${context/start_hour}">14h00</span>
<span tal:condition="context/end"> -
<span class="parlevent-end" tal:content="string: ${context/end_hour}">16h00</span>
</span>
</p>
<p class="place" tal:content="context/place">
</p>
<div tal:replace="structure provider:plone.belowcontentbody" />
</tal:main-macro>
</metal:main>
</body>
</html>

View File

@ -1,21 +1,15 @@
import os
from five import grok
from zope import schema, component
from zope.interface import implements
from z3c.relationfield.schema import RelationChoice
from Products.CMFCore.utils import getToolByName
import datetime
from plone.formwidget.contenttree import ObjPathSourceBinder
from themis.fields import LegisSession
from plone.app.textfield import RichText
from themis.datatypes.commission import ICommission
from plone.registry.interfaces import IRegistry
from tabellio.config.interfaces import ITabellioSettings
from tabellio.agenda.interfaces import MessageFactory as _
from event import IBaseEvent, BaseEvent, EventBaseView
@ -45,29 +39,3 @@ class ParlEventBaseView(EventBaseView):
return EventBaseView.previous_event_url(self,
portal_type=('tabellio.agenda.parlevent',
'tabellio.agenda.comevent'))
def get_stream_name(self):
filename = '%04d%02d%02d%02d-SEAN.mp3' % (
self.context.start.year, self.context.start.month,
self.context.start.day, self.context.start.hour)
return filename
def has_stream(self):
settings = component.getUtility(IRegistry).forInterface(ITabellioSettings, False)
if not settings.audiofiles_path:
return False
return os.path.exists(os.path.join(settings.audiofiles_path, self.get_stream_name()))
class View(grok.View, ParlEventBaseView):
grok.context(IParlEvent)
grok.require('zope2.View')
class M3U(grok.View, ParlEventBaseView):
grok.context(IParlEvent)
grok.require('zope2.View')
grok.name('seance.m3u')
def render(self):
portal_url = getToolByName(self.context, 'portal_url').getPortalObject().absolute_url()
self.request.response.setHeader('Content-type', 'audio/x-mpegurl')
return portal_url + '/mp3/' + self.get_stream_name() + '\n'

View File

@ -1,59 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="tabellio.agenda">
<body>
<metal:main fill-slot="main">
<tal:main-macro metal:define-macro="main"
tal:define="toLocalizedTime nocall:context/@@plone/toLocalizedTime">
<div tal:replace="structure provider:plone.abovecontenttitle" />
<h1 class="documentFirstHeading"><span tal:content="context/aq_parent/Title"/></h1>
<div tal:replace="structure provider:plone.belowcontenttitle" />
<div class="blocdate">
<a href="#" class="previous" tal:attributes="href view/previous_event_url">←</a>
<div class="date">
<span class="day" tal:content="context/start/day">30</span>
<span class="month" tal:content="context/start_month">mars</span>
<a href="." class="open-calendar" tal:attributes="href string:./?year=${context/start/year}&month=${context/start/month}">Ouvrir le calendrier</a>
</div>
<a href="#" class="next" tal:attributes="href view/next_event_url">→</a>
</div>
<h1 class="parlevent-title"><span tal:content="context/title">title</span><br/><span tal:content="string: (${context/session})">(2011-2012)</span></h1>
<p>
<span class="parlevent-start" tal:content="string: ${context/start_hour}">14h00</span>
<span tal:condition="context/end"> -
<span class="parlevent-end" tal:content="string: ${context/end_hour}">16h00</span>
</span>
</p>
<p class="place" tal:content="context/place">
</p>
<ul id="cri-stream">
<li><a href="#" class="cri" tal:condition="python: context.cri and context.cri.to_object"
tal:attributes="href context/cri/to_object/absolute_url">Compte-rendu intégral</a>
<span class="cri" tal:condition="python: not(context.cri and context.cri.to_object)">Compte-rendu intégral (non disponible)</span></li>
<li><a tal:attributes="href string:${context/absolute_url}/seance.m3u" class="streaming" tal:condition="view/has_stream">Streaming</a>
<span class="streaming" tal:condition="not: view/has_stream">Streaming (non disponible)</span></li>
</ul>
<div class="order-of-the-day" tal:condition="context/order_of_the_day">
<h2>Ordre du jour</h2>
<div tal:content="structure context/order_of_the_day/output"/>
</div>
<div tal:replace="structure provider:plone.belowcontentbody" />
</tal:main-macro>
</metal:main>
</body>
</html>