diff --git a/tabellio.agenda.egg-info/SOURCES.txt b/tabellio.agenda.egg-info/SOURCES.txt index 7ae406a..e02f343 100644 --- a/tabellio.agenda.egg-info/SOURCES.txt +++ b/tabellio.agenda.egg-info/SOURCES.txt @@ -13,4 +13,8 @@ tabellio.agenda.egg-info/requires.txt tabellio.agenda.egg-info/top_level.txt tabellio/agenda/__init__.py tabellio/agenda/event.py -tabellio/agenda/interfaces.py \ No newline at end of file +tabellio/agenda/folder.py +tabellio/agenda/interfaces.py +tabellio/agenda/parlevent.py +tabellio/agenda/portlets.py +tabellio/agenda/utils.py \ No newline at end of file diff --git a/tabellio/agenda/event.py b/tabellio/agenda/event.py index 636fe9f..fe3b777 100644 --- a/tabellio/agenda/event.py +++ b/tabellio/agenda/event.py @@ -33,14 +33,25 @@ class BaseEvent(Item): def longdatetime(self): # unfortunately this forces the locale formatter = locales.getLocale('fr').dates.getFormatter('dateTime', 'medium') - formatter.setPattern(u'EEEE d MMM yyyy à HH:mm') + formatter.setPattern(u'EEEE d MMMM yyyy à HH:mm') return formatter.format(self.start) longdatetime = property(longdatetime) + def shortdatetime(self): + # unfortunately this forces the locale + formatter = locales.getLocale('fr').dates.getFormatter('dateTime', 'medium') + formatter.setPattern(u'd MMMM yyyy') + return formatter.format(self.start) + shortdatetime = property(shortdatetime) + + class Event(BaseEvent): implements(IEvent) + def klass(self): + return 'generic-event' + class View(grok.View): grok.context(IEvent) diff --git a/tabellio/agenda/folder.py b/tabellio/agenda/folder.py index 439656e..dae269a 100644 --- a/tabellio/agenda/folder.py +++ b/tabellio/agenda/folder.py @@ -4,16 +4,33 @@ from zope.interface import implements from Products.Five.browser import BrowserView from Products.CMFCore.utils import getToolByName +from zope.schema.interfaces import IVocabularyFactory +from zope.schema.vocabulary import SimpleVocabulary + from plone.directives import form, dexterity from plone.dexterity.content import Container from tabellio.agenda.interfaces import MessageFactory as _ +import tabellio.config.utils import utils +class AgendaModeVocabulary(object): + grok.implements(IVocabularyFactory) + + def __call__(self, context): + values = [('month', _(u'Month')), ('list', _(u'List')), ('seances', _(u'Seances'))] + terms = [] + for key, value in values: + terms.append(SimpleVocabulary.createTerm(key, value.encode('utf-8'), key)) + return SimpleVocabulary(terms) +grok.global_utility(AgendaModeVocabulary, name=u'tabellio.agenda.agendaModes') + class IAgendaFolder(form.Schema): title = schema.TextLine(title=_(u'Title')) + mode = schema.Choice(title=_(u'Mode'), + vocabulary='tabellio.agenda.agendaModes') class AgendaFolder(Container): @@ -24,6 +41,15 @@ class View(grok.View, utils.MonthlyView): grok.context(IAgendaFolder) grok.require('zope2.View') + def as_list(self): + return self.context.mode == 'list' + + def as_month(self): + return self.context.mode == 'month' + + def as_seances(self): + return self.context.mode == 'seances' + def update(self): utils.MonthlyView.update(self) return self.updated @@ -43,3 +69,4 @@ class View(grok.View, utils.MonthlyView): brains = self.get_events_from_catalog(last_date, first_date, sort_on='start') return [x.getObject() for x in brains] + diff --git a/tabellio/agenda/folder_templates/view.pt b/tabellio/agenda/folder_templates/view.pt index cd3b7f0..d8e3d36 100644 --- a/tabellio/agenda/folder_templates/view.pt +++ b/tabellio/agenda/folder_templates/view.pt @@ -20,6 +20,8 @@
+
+ + + + +
+ +
+ « + + monthname + year + + + » +
+ +
+ + + + + +
+

+

+ Détails +

+

+
+ + + + + + + +
StreamingCompte-rendu intégral
+ + +
diff --git a/tabellio/agenda/parlevent.py b/tabellio/agenda/parlevent.py index 912cf97..618abf6 100644 --- a/tabellio/agenda/parlevent.py +++ b/tabellio/agenda/parlevent.py @@ -21,3 +21,6 @@ class IParlEvent(IBaseEvent): class ParlEvent(BaseEvent): implements(IParlEvent) + def klass(self): + return 'parlementary-event' +