def update(self): portal_state = getMultiAdapter( (self.context, self.request), name="plone_portal_state") if portal_state.anonymous(): IStatusMessage(self.request).addStatusMessage( _("Please log in first."), "info") self.status = _("Please log in first.") raise Unauthorized("You are not authorized! Go away!") super(AddBookmark, self).update() self.request.set('disable_border', 1)
def get_criteria(context): return { 'challengeIntIds': { 'label': _(u'Challenges'), 'vocabulary': challenges_source, 'groupable': True, }, 'universityIntIds': { 'label': _(u'Universities'), 'vocabulary': universities_source, 'groupable': True, }, }
def update(self): if not self.member: IStatusMessage(self.request).addStatusMessage( _(u"You are not a regular member of the Virtual Center. " "Please contact your administrator if this seems odd to " "you."), "warn") self.request.response.redirect(self.context.absolute_url())
def get_criteria(context): return { 'rmGroup': { 'label': _(u'Folder'), 'vocabulary': visible_groups_source, 'groupable': True } }
def decline(self, intid): project = self.get_project_by_intid(intid) if project: project.uninvite_workspace(self.context) msg = u"You have declined the invitation to ”${project_title}“." mapping = dict(project_title=project.title) IStatusMessage(self.request).addStatusMessage( _(msg, mapping=mapping), "info")
def get_project_by_intid(self, intid): intid = int(intid) if intid not in self.intids: IStatusMessage(self.request).addStatusMessage( _(u"Invitation invalid."), "error") return return self.intids_utility.getObject(intid)
def handle_add(self, action): data, errors = self.extractData() if errors: self.status = "Please select a Workspace." return add_url = data["workspace"] + "/++add++RichLink" self.request.response.redirect(add_url + "?" + data["query_string"]) self.status = _(u"Please review and complete the meta data.")
def accept(self, intid): project = self.get_project_by_intid(intid) if project: project.add_workspace(self.context) msg = u"“${ws_title}” is now part of the project “${project_title}”." mapping = dict( ws_title=self.context.title, project_title=project.title) IStatusMessage(self.request).addStatusMessage( _(msg, mapping=mapping), "info")
class IHomepage(form.Schema): eventSearchPaths = RelationList( title=_(u"Events-Search-Paths"), description=_(u"Folders to search for Events."), value_type=RelationChoice(source=ObjPathSourceBinder()), default=[], required=False, ) text = RichText( title=_(u"Text"), required=False, ) categories = SimpleVocabulary([ SimpleTerm(value='research', title=_(u'Research')), SimpleTerm(value='study', title=_(u'Study')), SimpleTerm(value='organisation', title=_(u'Organisation')), SimpleTerm(value='off-campus', title=_(u'Off-Campus')), ]) categoryDescriptions = { 'research': _(u"In the research challenges all official workspaces are " + "categorized. Here you find courses, research projects, thesis " + "workspaces and much more."), 'organisation': _(u"In the organization section you can find all " + "workspaces regarding internal CNRD work."), 'study': _(u"Help your fellow students, and find help yourself. Learn " + "more about the other universities and research culture within the " + "CNRD."), 'off-campus': _(u"The CNRD is not only about research and work, but " + "about people. This area is for your off-campus activities."), }