def review_state(self,value): ''' A key to value method ''' states = {'created':_('Created'), 'accepted':_('Accepted'), 'rejected':_('Rejected'), 'confirmed':_('Confirmed'), 'cancelled':_('Cancelled'),} return states.get(value,value)
def update(self): super(OrganizeView, self).update() messages = IStatusMessage(self.request) # Remove Portlets self.request['disable_plone.leftcolumn']=1 self.request['disable_plone.rightcolumn']=1 if 'form.submitted' in self.request.form: vote = self.process_form() ordering.vote(self.context, self.member_id, vote) messages.addStatusMessage(_(u"Your vote was computed"), type="info") elif self.my_vote(): messages.addStatusMessage(_(u"You already voted in this track"), type="info")
# -*- coding: utf-8 -*- from Products.CMFCore.utils import getToolByName from zope.schema.vocabulary import SimpleVocabulary from zope.schema.vocabulary import SimpleTerm from sc.base.grokutils import registerSimpleVocabulary from apyb.papers import MessageFactory as _ registerSimpleVocabulary( "ReferenceType", u"apyb.papers.talk", [("article", _(u"Article / Post")), ("presentation", _(u"Presentation")), ("video", _(u"Video"))], globals(), ) registerSimpleVocabulary("Type", u"apyb.papers.talk", [("talk", _(u"Talk")), ("panel", _(u"Panel"))], globals()) def trackVocabulary(context): """Vocabulary factory for talk track options """ ct = getToolByName(context, "portal_catalog") tracks = ct.searchResults(portal_type="apyb.papers.track", sort_on="getObjPositionInParent") items = [SimpleTerm(b.UID, b.UID, b.Title) for b in tracks] return SimpleVocabulary(items) registerSimpleVocabulary("Track", u"apyb.papers.talk", trackVocabulary, globals()) registerSimpleVocabulary( "Level",