Esempio n. 1
0
class IExpertAssignmentBehavior(model.Schema):

    experts_assigned = schema.Tuple(
        title=_(u"Experts"),
        value_type=schema.TextLine(),
        required=False,
        missing_value=(),
    )
    widget(
        "experts_assigned",
        AjaxSelectFieldWidget,
        vocabulary="empower.parent_allowed_users",
        pattern_options={"placeholder": _(u"Type and select expert.")},
    )
    write_permission(experts_assigned="bda.empower.ModifyExpertsAssigned")
Esempio n. 2
0
class IContributionBehavior(model.Schema, IWorkspaceAware):
    """ Schema Only Behavior Contribution
    """

    text = RichText(title=_(u"Contribution"), required=False)

    workspace = schema.Choice(
        title=u"Workspace",
        required=True,
        vocabulary="empower.next_workspaces",
        #defaultFactory=default_workspace,
        # default value prevents to save if value is same as default.
        #   see: https://github.com/plone/plone.restapi/blob/d8e65b1d2d96c1ea2c79c6a9c0199e290fdb7efe/src/plone/restapi/deserializer/dxcontent.py#L98
        #        https://github.com/plone/plone.restapi/blob/d8e65b1d2d96c1ea2c79c6a9c0199e290fdb7efe/src/plone/restapi/deserializer/dxcontent.py#L98
    )
Esempio n. 3
0
class IClientAndExpertpoolAssignmentBehavior(model.Schema):

    client = schema.Tuple(
        title=_(u"Client"),
        value_type=schema.TextLine(),
        required=False,
        missing_value=(),
    )
    widget(
        "client",
        AjaxSelectFieldWidget,
        vocabulary="plone.app.vocabularies.Users",
        pattern_options={"placeholder": _(u"Type and select client.")},
    )
    write_permission(client="bda.empower.ModifyClient")

    coordinators = schema.Tuple(
        title=_(u"Coordinators"),
        value_type=schema.TextLine(),
        required=False,
        missing_value=(),
    )
    widget(
        "coordinators",
        AjaxSelectFieldWidget,
        vocabulary="plone.app.vocabularies.Users",
        pattern_options={"placeholder": _(u"Type and select coordinator.")},
    )
    write_permission(expert_pool="bda.empower.ModifyExpertPool")

    expert_pool = schema.Tuple(
        title=_(u"Expert Pool"),
        value_type=schema.TextLine(),
        required=False,
        missing_value=(),
    )
    widget(
        "expert_pool",
        AjaxSelectFieldWidget,
        vocabulary="plone.app.vocabularies.Users",
        pattern_options={"placeholder": _(u"Type and select expert.")},
    )
    write_permission(expert_pool="bda.empower.ModifyExpertPool")
Esempio n. 4
0
# -*- coding: utf-8 -*-
from bda.empower.i18n import _
from collections import OrderedDict

WORKSPACE_LIST = ['case', 'analysis', 'strategy', 'action', 'evaluation']

WORKSPACE_DEFINITION = OrderedDict()

WORKSPACE_DEFINITION["case"] = {
    "title": _("case", default=u"Case"),
    "next": ["analysis"],
    "no-parent": True,
}

WORKSPACE_DEFINITION["analysis"] = {
    "title": _("analysis", default=u"Analysis"),
    "next": ["strategy"],
    "no-parent": False,
}

WORKSPACE_DEFINITION["strategy"] = {
    "title": _("strategy", default=u"Strategy"),
    "next": ["action"],
    "no-parent": False,
}

WORKSPACE_DEFINITION["action"] = {
    "title": _("action", default=u"Action"),
    "next": ["evaluation"],
    "no-parent": True,
}
Esempio n. 5
0
class IBasicwWithoutDescription(model.Schema):

    # default fieldset
    title = schema.TextLine(title=_(u"Subject"), required=True)