コード例 #1
0
    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)
コード例 #2
0
def get_criteria(context):
    return {
        'challengeIntIds': {
            'label': _(u'Challenges'),
            'vocabulary': challenges_source,
            'groupable': True, },
        'universityIntIds': {
            'label': _(u'Universities'),
            'vocabulary': universities_source,
            'groupable': True, },
    }
コード例 #3
0
 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())
コード例 #4
0
ファイル: rm_groups.py プロジェクト: ixds/plone-virtualcenter
def get_criteria(context):
    return {
        'rmGroup': {
            'label': _(u'Folder'),
            'vocabulary': visible_groups_source,
            'groupable': True
            }
        }
コード例 #5
0
    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")
コード例 #6
0
    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)
コード例 #7
0
    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.")
コード例 #8
0
    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")
コード例 #9
0
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."), }