예제 #1
0
class IRemoteNewsFolder(form.Schema, IImageScaleTraversable):
    """
    A folder displaying news from remote API
    """

    languageindependent('endpoint')
    endpoint = schema.TextLine(title=_(u'API Endpoint'),
                               default=u'http://www.oikoumene.org/api')

    languageindependent('q_category')
    q_category = schema.TextLine(
        title=_(u'Category'),
        description=_(u"Category (subject) tag to query for. Leave blank to "
                      u"query for all news"),
        required=False)

    languageindependent('q_activity')
    form.widget(
        q_activity='plone.formwidget.autocomplete.AutocompleteFieldWidget')
    q_activity = schema.Choice(title=_(u'Activity'),
                               description=_(u'Activity to query news from'),
                               required=False,
                               vocabulary='wcc.remotenews.remoteactivities')

    q_language = schema.TextLine(
        title=_(u'Language code'),
        description=
        u'Language code to import the news from. Leave blank to use current language',
        default=u'',
        required=False)
class INewsMediaHomepage(form.Schema, IImageScaleTraversable):
    """
    
    """

    dexteritytextindexer.searchable('text')
    form.widget(text="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    text = schema.Text(
        title=_(u'label_body_text', u"Body Text"),
        description=u'',
        required=False,
    )

    languageindependent('news_source')
    news_source = RelationChoice(
        title=u'Source collection for news listing',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False)

    languageindependent('more_news_target')
    more_news_target = RelationChoice(
        title=u'Target for "More News" link',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False,
    )
예제 #3
0
class IHomepage3(form.Schema, IBaseHomepage, IImageScaleTraversable):
    """
    
    """
    languageindependent('slider_items')
    slider_items = RelationList(
        title=u'Slider items',
        value_type=RelationChoice(source=ObjPathSourceBinder(
            object_provides=ICarouselImageEnabled.__identifier__)),
        required=True)

    languageindependent('news_source')
    news_source = RelationChoice(
        title=u'Source collection for news listing',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False)

    languageindependent('more_news_target')
    more_news_target = RelationChoice(
        title=u'Target for "More News" link',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False,
    )

    form.widget(
        third_column_text="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    third_column_text = schema.Text(
        title=u"Third Column Text",
        description=u'',
        required=False,
    )
예제 #4
0
class ITaula(form.Schema):

    directives.languageindependent('temes')
    temes = RelationList(
        title=u"Temes",
        default=[],
        value_type=RelationChoice(
            title=_(u"Temes als que pertany la taula de símbols"),
            source=ObjPathSourceBinder(object_provides=ITema.__identifier__)),
        required=False,
    )

    directives.languageindependent('taula')
    taula = schema.Text(
        title=_(u"Taula de símbols"),
        description=_(u"Escriu la taula de símbols en Tex"),
        required=True,
    )

    directives.languageindependent('audio')
    audio = NamedFile(
        title=_(u"Audio"),
        description=_(u"Arxiu d\'audio que conta la locució"),
        required=False,
    )
class ILyrisNewsletterFolder(form.Schema, IImageScaleTraversable):
    """
    Description of the Example Type
    """

    pam.languageindependent('mlid')
    mlid = schema.TextLine(title=_(u'Lyris Mailing list ID'))
    
    pam.languageindependent('siteid')
    siteid = schema.TextLine(title=_(u'Lyris Site ID'))

    form.widget(newsletter_types='collective.z3cform.datagridfield.DataGridFieldFactory')

    pam.languageindependent('newsletter_types')
    newsletter_types = schema.List(
            title=_(u'Newsletter types'), required=False,
            description=_(u'Available newsletter types'),
            value_type=DictRow(schema=INewsletterTypeSchema), default=[])

    form.widget(subscribed_message="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    subscribed_message = schema.Text(
        title=_(u'Message to new subscribers'),
        description=_(u'Text to display to new subscribers')
    )

    form.widget(unsubscribed_message="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    unsubscribed_message = schema.Text(
        title=_(u'Message to unsubscribed user'),
        description=_(u'Text to display to user who just unsubscribed')
    )
예제 #6
0
class ILocationTags(form.Schema):

    languageindependent('countries')
    countries = schema.List(
        title=_(u"Related Countries"),
        value_type=schema.Choice(vocabulary="wcc.vocabulary.country"),
        required=False)
예제 #7
0
class IFocalPoint(IOrganisationBase):

    model.fieldset(
        'about_fop',
        label=_(u'About your Focal Point'),
        fields=[
            'title',
            'organisation_type',
            'description',
            'street',
            'address_extra',
            'city',
            'zip_code',
            'country',
            'email',
            'phone',
            'fax',
            'url',
            'campaign_url',
            'logo',
            'mission_statement',
            'campaign_pledge',
            'ceo_image',
            'key_name',
            'key_email',
            'key_phone',
        ],
    )

    formdirectives.no_omit(IAddForm, 'campaign_pledge')
    formdirectives.no_omit(IAddForm, 'mission_statement')
    formdirectives.no_omit(IEditForm, 'mission_statement')
    formdirectives.no_omit(IEditForm, 'campaign_pledge')
    formdirectives.no_omit(IAddForm, 'logo')
    formdirectives.no_omit(IAddForm, 'ceo_image')
    formdirectives.no_omit(IEditForm, 'ceo_image')

    description = schema.Text(title=_(u'Description'), )
    directives.languageindependent('description')

    organisation_type = schema.Choice(
        title=_(u"Organisation type"),
        vocabulary=vocabularies.fop_organisation_types,
    )
    directives.languageindependent('organisation_type')
예제 #8
0
class IHomepage(form.Schema, IBaseHomepage, IImageScaleTraversable):
    """
    Description of the Example Type
    """

    languageindependent('slider_items')
    slider_items = RelationList(
        title=u'Slider items',
        value_type=RelationChoice(source=ObjPathSourceBinder(
            object_provides=ICarouselImageEnabled.__identifier__)),
        required=True)

    languageindependent('news_source')
    news_source = RelationChoice(
        title=u'Source collection for news listing',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False)

    languageindependent('more_news_target')
    more_news_target = RelationChoice(
        title=u'Target for "More News" link',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False,
    )

    languageindependent('events_source')
    events_source = RelationChoice(
        title=u'Source collection for events listing',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False)

    languageindependent('slider_type')
    slider_type = schema.Choice(
        title=_(u'Slider type'),
        default='normal',
        values=['normal', 'full-width'],
        required=True,
        description=_(u'Normal slider requires 510x330px images, Full ' +
                      u'Width slider requires 782x330px images'))
예제 #9
0
class IHomepage(form.Schema, IImageScaleTraversable):
    """
    
    """

    languageindependent('slider_items')
    slider_items = RelationList(
        title=u'Slider items',
        value_type=RelationChoice(source=ObjPathSourceBinder(
            object_provides=ICarouselImageEnabled.__identifier__)),
        required=True)

    languageindependent('news_source')
    news_source = RelationChoice(
        title=u'Source collection for news listing',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False)

    languageindependent('more_news_target')
    more_news_target = RelationChoice(
        title=u'Target for "More News" link',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False,
    )

    languageindependent('video_source')
    video_source = RelationChoice(
        title=u'Source collection for latest video',
        source=ObjPathSourceBinder(object_provides=[
            IATTopic.__identifier__, ICollection.__identifier__
        ]),
        required=False)

    languageindependent('embed_html')
    embed_html = schema.Text(
        title=u'Embed HTML',
        description=u'If set, this will replace the slider/youtube video',
        required=False)
예제 #10
0
class IChurchFamily(form.Schema, IImageScaleTraversable):
    """
    Church Family
    """

    languageindependent('websites')
    websites = schema.List(
        title=_(u'label_websites', u'Websites'),
        value_type=schema.TextLine(),
        required=False,
    )
예제 #11
0
class IFormula(form.Schema):

    directives.languageindependent('temes')
    temes = RelationList(
        title=u"Temes",
        default=[],
        value_type=RelationChoice(
            title=_(u"Temes a les que pertany la formula"),
            source=ObjPathSourceBinder(object_provides=ITema.__identifier__)),
        required=False,
    )

    form.widget(formula=MathJaxFieldWidget)
    directives.languageindependent('formula')
    formula = schema.Text(
        title=_(u"Formula matemàtica"),
        description=_(u"Escriu la formula matemàtica en Tex"),
        required=True)

    searchable(IBasic, 'title')
    searchable(IBasic, 'description')
예제 #12
0
class ISectionImage(form.Schema):
    """Marker / Form interface for adding section image(s)"""

    model.fieldset('settings', label=u"Settings", fields=['section_image'])

    section_image = RelationList(
        title=u"Section images",
        description=u"Pick one or more existing images",
        required=False,
        value_type=RelationChoice(
            title=u"Browse for images in the site",
            required=False,
            source=ObjPathSourceBinder(portal_type='Image'),
        ),
    )

    form.widget(section_image=MultiContentTreeFieldWidget)
    directives.languageindependent('section_image')
예제 #13
0
class ISeeAlso(model.Schema):
    """Marker / Form interface for internal references"""

    model.fieldset('settings', label=u"Settings", fields=['see_also'])

    see_also = RelationList(
        title=_(u"See also"),
        description=u"Pick existing items",
        required=False,
        value_type=RelationChoice(
            title=u"Select an existing item",
            required=False,
            source=ObjPathSourceBinder(),
        ),
    )

    form.widget(see_also=MultiContentTreeFieldWidget)
    directives.languageindependent('see_also')
예제 #14
0
class IHomepage2(form.Schema, IBaseHomepage, IImageScaleTraversable):
    """
    
    """

    languageindependent('slider_items')
    slider_items = RelationList(
        title=u'Slider items',
        value_type=RelationChoice(source=ObjPathSourceBinder(
            object_provides=ICarouselImageEnabled.__identifier__)),
        required=True)

    dexteritytextindexer.searchable('text')
    form.widget(text="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    text = schema.Text(
        title=_(u'label_body_text', u"Body Text"),
        description=u'',
        required=False,
    )
예제 #15
0
class IProgramme(form.Schema, IImageScaleTraversable,
                 IFeatureImageViewletDisabled):
    """
    
    """

    languageindependent('code')
    code = schema.TextLine(title=_(u'Code'), required=False)

    languageindependent('date')
    date = schema.Date(title=_(u'Date'))

    languageindependent('startTime')
    startTime = schema.Choice(
        title=_(u'Start Time'),
        vocabulary='wcc.programmeplanner.programme_times')

    languageindependent('endTime')
    endTime = schema.Choice(title=_(u'End Time'),
                            vocabulary='wcc.programmeplanner.programme_times')

    languageindependent('event_type')
    event_type = schema.Choice(title=_(u'Event Type'),
                               vocabulary='wcc.programmeplanner.event_type')

    languageindependent('focus_group')
    focus_group = schema.List(
        title=_(u'Focus Group'),
        value_type=schema.Choice(
            vocabulary='wcc.programmeplanner.focus_group'))

    dexteritytextindexer.searchable('text')
    form.widget(text="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    text = schema.Text(
        title=_(u"Body Text"),
        description=u'',
        required=False,
    )
예제 #16
0
class IResourceAllocationDefaults(form.Schema):

    directives.languageindependent('quota')
    quota = schema.Int(
        title=_(u'Quota'),
        description=_(
            u'Number of times an allocation may be reserved at the same time. '
            u'e.g. 3 spots in a daycare center, 2 available cars, '
            u'1 meeting room. '),
        default=1)

    directives.languageindependent('reservation_quota_limit')
    reservation_quota_limit = schema.Int(
        title=_(u'Reservation Quota Limit'),
        description=_(
            u'The maximum quota a single reservation may occupy at once. '
            u'There is no limit if set to zero.'),
        default=1)

    directives.languageindependent('approve_manually')
    approve_manually = schema.Bool(
        title=_(u'Manually approve reservation requests'),
        description=_(
            u'If checked a reservation manager must decide if a reservation '
            u'can be approved. Until then users are added to a waitinglist. '
            u'Reservations are automatically approved if this is not checked. '
        ),
        default=False)

    directives.languageindependent('partly_available')
    partly_available = schema.Bool(
        title=_(u'Partly available'),
        description=_(
            u'If the allocation is partly available users may reserve '
            u'only a part of it (e.g. half of it). If not the allocation '
            u'Must be reserved as a whole or not at all'),
        default=False)

    directives.languageindependent('raster')
    raster = schema.Choice(
        title=_(u'Raster'),
        description=_(
            u'Defines the minimum length of any given reservation as well '
            u'as the alignment of the start / end of the allocation. E.g. a '
            u'raster of 30 minutes means that the allocation can only start '
            u'at xx:00 and xx:30 respectively'),
        values=VALID_RASTER_VALUES,
        default=15)

    @invariant
    def isValidQuota(Allocation):
        if not (1 <= Allocation.quota and Allocation.quota <= 1000):
            raise Invalid(_(u'Quota must be between 1 and 1000'))

    @invariant
    def isValidQuotaLimit(Allocation):
        if Allocation.reservation_quota_limit < 0:
            raise Invalid(
                _(u'Reservation quota limit must zero or a positive number'))

    ######### deprecated #########
    approve = schema.Bool(title=_(u'DEPRECATED: Approve reservation requests'),
                          default=True)
예제 #17
0
class IChurchMember(form.Schema, IImageScaleTraversable):
    """
    Church Member
    """

    languageindependent('church_image')
    church_image = NamedBlobImage(
        title=_(u'Image'),
        required=False,
    )

    languageindependent('church_family')
    church_family = RelationChoice(
        title=_(u'Church Family'),
        source=ObjectProvidesPathSourceBinder(
            object_provides='wcc.churches.churchfamily.IChurchFamily'),
        required=False)

    languageindependent('based_in')
    based_in = schema.Choice(
        title=_(u'Based in'),
        vocabulary='wcc.vocabulary.country',
        description=_(u''),
        required=False,
    )

    languageindependent('present_in')
    present_in = schema.List(
        title=_(u'Present in'),
        value_type=schema.Choice(vocabulary='wcc.vocabulary.country'),
        description=_(u''),
        required=False,
    )

    languageindependent('membership')
    membership = schema.Int(
        title=_(u'Membership'),
        description=_(u''),
        required=False,
    )

    languageindependent('pastors')
    pastors = schema.Int(title=_(u'Pastors'),
                         description=_(u''),
                         required=False)

    languageindependent('congregations')
    congregations = schema.Int(title=_(u'Congregations'),
                               description=_(u''),
                               required=False)

    languageindependent('member_of')
    member_of = RelationList(
        title=_(u'label_member_of', u"Member Of"),
        default=[],
        value_type=RelationChoice(source=ObjectProvidesPathSourceBinder(
            object_provides='wcc.churches.churchbody.IChurchBody')),
        required=False)

    languageindependent('assoc_member_of')
    assoc_member_of = RelationList(
        title=_(u'label_assoc_member_of', u'Associate Member Of'),
        default=[],
        value_type=RelationChoice(source=ObjectProvidesPathSourceBinder(
            object_provides='wcc.churches.churchbody.IChurchBody'), ),
        required=False)

    languageindependent('wcc_member_since')
    wcc_member_since = schema.Date(title=u'WCC Member Since',
                                   min=date(1900, 1, 1),
                                   max=date.today(),
                                   required=False)

    languageindependent('remoteUrl')
    remoteUrl = schema.TextLine(
        title=_(u"Website"),
        default=u'http://',
        description=u"",
        required=False,
    )
예제 #18
0
class IChurchBody(form.Schema, IBasic, IImageScaleTraversable):
    """
    Church Body
    """

    # If you want a schema-defined interface, delete the form.model
    # line below and delete the matching file in the models sub-directory.
    # If you want a model-based interface, edit
    # models/churchbody.xml to define the content type
    # and add directives here as necessary.

    title = schema.TextLine(
        title = _(u'label_short_title', default=u'Short Name / Abbreviation'),
        required = True
    )

    full_title = schema.TextLine(
        title=_(u'label_full_title', u'Full Name'),
        required=True
    )

    dexteritytextindexer.searchable('text')
    form.widget(text="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    text = schema.Text(
        title=_(u'label_body_text', u"Body Text"),
        description=u'',
        required=False,
    )

    languageindependent('member_of')
    member_of = RelationChoice(
            title=_(u'label_member_of', u"Member Of"),
            source=ObjectProvidesPathSourceBinder(object_provides=[
                'wcc.churches.churchfamily.IChurchFamily',
                'wcc.churches.churchbody.IChurchBody'
            ]),
            required=False
    )

    languageindependent('assoc_member_of')
    assoc_member_of = RelationChoice(
            title=_(u'label_assoc_member_of', u'Associate Member Of'),
            source=ObjectProvidesPathSourceBinder(
                object_provides=[
                    'wcc.churches.churchfamily.IChurchFamily',
                    'wcc.churches.churchbody.IChurchBody',
                ]
            ),
            required=False
    )

    languageindependent('other_members')
    form.widget(other_members="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    other_members = schema.Text(
        title=_(u'label_other_members', u'Other Members'),
        required=False
    )

    languageindependent('other_assoc_members')
    form.widget(other_assoc_members="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    other_assoc_members = schema.Text(
        title=_(u'label_other_assoc_members', u'Other Associate Members'),
        required=False
    )

    languageindependent('remoteUrl')
    remoteUrl = schema.TextLine(
        title=_(u"Website"),
        default=u'http://',
        description=u"",
        required=False,
    )

    form.order_before(full_title = '*')
    form.order_before(title = '*')
예제 #19
0
class IHomepage5(form.Schema, IBaseHomepage, IImageScaleTraversable):
    """
    Description of the Example Type
    """

    languageindependent('slider_items')
    slider_items = RelationList(
        title=u'Slider items',
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                object_provides=ISliderFieldsEnabled.__identifier__
            )
        ),
        required=True
    )

    languageindependent('source1')
    source1 = RelationChoice(
        title=u'Source collection row1',
        source=ObjPathSourceBinder(
            object_provides=[IATTopic.__identifier__,
                            ICollection.__identifier__]
        ),
        required=False
    )

    source1_text = RichText(
        title=_(u'Text for row1'),
        description=_(u''),
        required=False
    )


    languageindependent('source2')
    source2 = RelationChoice(
        title=u'Source collection for row2',
        source=ObjPathSourceBinder(
            object_provides=[IATTopic.__identifier__,
                            ICollection.__identifier__]
        ),
        required=False
    )

    source2_text = RichText(
        title=_(u'Text for row2'),
        description=_(u''),
        required=False
    )


    languageindependent('blog_section_title')
    blog_section_title = schema.TextLine(
        title=_(u'Blog section title'),
        default=_(u'On the blog'),
        required=True,
    )


    languageindependent('blog_source')
    blog_source = RelationChoice(
        title=u'Source collection for blog section',
        source=ObjPathSourceBinder(
            object_provides=[IATTopic.__identifier__,
                            ICollection.__identifier__]
        ),
        required=False
    )



    languageindependent('slider_type')
    slider_type = schema.Choice(
        title=_(u'Slider type'),
        default='normal',
        values=['normal','full-width'],
        required=True,
        description=_(u'Normal slider requires 510x330px images, Full ' +
                    u'Width slider requires 782x330px images')
    )
예제 #20
0
class IMediaPartner(IOrganisationBase):

    model.fieldset(
        'about_fop',
        label=_(u'About your publication'),
        fields=[
            'title',
            'logo',
            'country',
            'mission_statement',
            'publication_type',
            'readership',
            'key_name',
            'key_position',
            'key_email',
            'editor_in_chief',
            'url',
            'social_media',
            'street',
            'address_extra',
            'city',
            'zip_code',
            'phone',
            'privacy_policy_text',
            'privacy_policy',
        ],
    )

    formdirectives.no_omit(IAddForm, 'logo')
    formdirectives.no_omit(IAddForm, 'mission_statement')
    formdirectives.no_omit(IEditForm, 'mission_statement')
    formdirectives.no_omit(IAddForm, 'street')
    formdirectives.no_omit(IEditForm, 'street')
    formdirectives.omitted('fax')
    formdirectives.omitted('campaign_url')
    formdirectives.omitted('email')
    formdirectives.omitted('key_phone')
    formdirectives.omitted('organisation_type')

    form.widget(publication_type=CheckBoxFieldWidget)
    publication_type = schema.List(
        title=_(u"Type of publication"),
        description=_(u"Multiple selections are possible"),
        value_type=schema.Choice(vocabulary=vocabularies.media_types, ))
    directives.languageindependent('publication_type')

    form.widget(readership=CheckBoxFieldWidget)
    readership = schema.List(
        title=_(u"Readership"),
        description=_(u"Multiple selections are possible"),
        value_type=schema.Choice(vocabulary=vocabularies.media_readership, ))
    directives.languageindependent('publication_type')

    key_position = schema.TextLine(
        title=_(u"Position of the main contact person"), )
    directives.languageindependent('key_position')

    editor_in_chief = schema.TextLine(title=_(u"Editor in Chief"), )
    directives.languageindependent('editor_in_chief')

    social_media = schema.List(
        title=_(u"Social media profiles"),
        required=False,
        value_type=DictRow(
            title=u"tablerow",
            required=False,
            schema=ITableRowSchema,
        ),
    )
    form.widget(social_media=CustomTableWidgetFactory)

    privacy_policy_text = RichText(
        title=u"",
        required=False,
    )
    formdirectives.omitted('privacy_policy_text')
    formdirectives.no_omit(IAddForm, 'privacy_policy_text')

    privacy_policy = schema.Bool(
        title=_(
            u"label_accept_privacy",
            default=
            u"I confirm that I have read and accept the terms of privacy "
            u"conditions and I authorise the treatment of my personal data."),
        required=True,
        constraint=isTicked,
    )
    formdirectives.omitted('privacy_policy')
    formdirectives.no_omit(IAddForm, 'privacy_policy')
예제 #21
0
class IOrganisationExtra(model.Schema):

    phase_1_intro = RichText(
        title=_(""),
        required=False,
    )
    formdirectives.omitted('phase_1_intro')
    formdirectives.no_omit(IAddForm, 'phase_1_intro')

    privacy_policy_text = RichText(
        title=u"",
        required=False,
    )
    formdirectives.omitted('privacy_policy_text')
    formdirectives.no_omit(IAddForm, 'privacy_policy_text')

    privacy_policy = schema.Bool(
        title=_(
            u"label_accept_privacy",
            default=
            u"I confirm that I have read and accept the terms of privacy "
            u"conditions and I authorise the treatment of my personal data."),
        required=True,
        constraint=isTicked,
    )
    formdirectives.omitted('privacy_policy')
    formdirectives.no_omit(IAddForm, 'privacy_policy')

    countries = schema.List(
        title=_(u"Countries of activity"),
        description=_(
            u"Please indicate at least 3 countries in which your company is "
            u"represented through branches / representative offices / "
            u"network members"),
        value_type=schema.Choice(vocabulary=vocabularies.countries, ),
        required=True,
        constraint=isActiveInMultipleCountries,
    )
    directives.languageindependent('countries')

    additional_countries = schema.Text(
        title=_(u"Other countries"),
        description=_(
            u"Other countries in which you organisation is represented (enter "
            "names)"),
        required=False,
    )
    directives.languageindependent('additional_countries')

    business_sector = schema.TextLine(
        title=_(u"Business sector"),
        description=_(u"Business sector in which you operate"),
    )
    directives.languageindependent('business_sector')

    social_dialogue = schema.Choice(
        title=_(u"Social Dialogue Partner?"),
        description=_(
            u"Are you a Social Partner within the framework of the European "
            "Social Dialogue?"),
        vocabulary=vocabularies.yes_no,
    )

    why_partner = schema.Text(
        title=_(u"1. Why do you want to be an official partner of the Healthy "
                u"Workplaces Campaign 2014-15 on ‘Healthy workplaces manage "
                u"stress’?"),
        description=_(u"Please explain briefly"),
    )
    directives.languageindependent('why_partner')

    promotion_electronic = schema.Text(
        title=_(
            u"2. How do you plan to promote and support the Campaign via your "
            "corporate website and in any other electronic means (intranet, "
            "newsletter, social media, etc.)?"),
        description=_(u"Please describe"),
        required=False,
    )
    directives.languageindependent('promotion_electronic')

    conferences_check = schema.Bool(
        title=_(u"Conferences, seminars or workshops exclusively or partly "
                "dedicated to the topic of the Campaign"),
        required=False,
    )
    directives.languageindependent('conferences_check')

    conferences_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on topic, main objectives, "
            "profile of participants, etc."),
        required=False,
    )
    directives.languageindependent('conferences_description')

    training_check = schema.Bool(
        title=_(u'Training sessions'),
        required=False,
    )
    directives.languageindependent('training_check')

    training_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on topic, main objectives, "
            "profile of participants, etc."),
        required=False,
    )
    directives.languageindependent('training_description')

    partnerships_check = schema.Bool(
        title=_(
            u"Partnerships with other organisations and schools / colleges / "
            "training centres"),
        required=False,
    )
    directives.languageindependent('partnerships_check')

    partnerships_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on planned activities"),
        required=False,
    )
    directives.languageindependent('partnerships_description')

    promotion_check = schema.Bool(
        title=_(u"Promotion in the media (press release, press conference, "
                "advertorials, etc )"),
        required=False,
    )
    directives.languageindependent('promotion_check')

    promotion_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on planned activities"),
        required=False,
    )
    directives.languageindependent('promotion_description')

    bestpractice_check = schema.Bool(
        title=_(u"Best Practice competition / activities"),
        required=False,
    )
    directives.languageindependent('bestpractice_check')

    bestpractice_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on planned activities"),
        required=False,
    )
    directives.languageindependent('bestpractice_description')

    otheractivities_check = schema.Bool(
        title=_(u"Other activities"),
        required=False,
    )
    directives.languageindependent('otheractivities_check')

    otheractivities_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on planned activities"),
        required=False,
    )
    directives.languageindependent('otheractivities_description')

    phase_2_intro = RichText(
        title=_(""),
        required=False,
    )
    formdirectives.omitted('phase_2_intro')
    formdirectives.no_omit(IEditForm, 'phase_2_intro')

    ceo_name = schema.TextLine(
        title=_(u"CEO"),
        description=_(
            u"Name / surname of your CEO, President, General Director or "
            "other"),
    )
    directives.languageindependent('ceo_name')
    formdirectives.omitted('ceo_name')
    formdirectives.no_omit(IEditForm, 'ceo_name')

    ceo_position = schema.TextLine(
        title=_(u"Position identifier"),
        description=_(
            u"Please indicate the actual position, such as President, General "
            "Director, CEO, Chairman, etc"),
        default=u"CEO",
    )
    directives.languageindependent('ceo_position')
    formdirectives.omitted('ceo_position')
    formdirectives.no_omit(IEditForm, 'ceo_position')

    description = schema.Text(title=_(
        u'His / her quote on the Healthy Workplaces Campaign 2014-15 on '
        '"Healthy workplaces manage stress"'), )
    directives.languageindependent('description')
    formdirectives.omitted('description')
    formdirectives.no_omit(IEditForm, 'description')

    key_position = schema.TextLine(
        title=_(u"Position of the main contact person."), )
    directives.languageindependent('key_position')

    representative_name = schema.TextLine(
        required=False,
        title=_(
            u"Name of your organisation's health and safety representative"),
    )
    directives.languageindependent('representative_name')
    formdirectives.omitted('representative_name')
    formdirectives.no_omit(IEditForm, 'representative_name')

    representative_email = schema.TextLine(
        required=False,
        title=_(u"Email address of your organisation's health and safety "
                "representative"),
        constraint=isEmail,
    )
    directives.languageindependent('representative_email')
    formdirectives.omitted('representative_email')
    formdirectives.no_omit(IEditForm, 'representative_email')

    representative_phone = schema.TextLine(
        required=False,
        title=_(u"Telephone number of your organisation's health and safety "
                "representative"),
    )
    directives.languageindependent('representative_phone')
    formdirectives.omitted('representative_phone')
    formdirectives.no_omit(IEditForm, 'representative_phone')
예제 #22
0
class IOrganisationBase(model.Schema):

    title = schema.TextLine(title=_(u"Company / Organisation name"))

    organisation_type = schema.Choice(
        title=_(u"Organisation type"),
        vocabulary=vocabularies.organisation_types,
    )
    directives.languageindependent('organisation_type')
    formdirectives.widget('organisation_type', NonMissingSelectWidget)

    street = schema.TextLine(title=_(u"Address"),
                             description=_(u"Street or PO-box"))
    directives.languageindependent('street')

    address_extra = schema.TextLine(
        title=_(u"Address extra"),
        required=False,
    )
    directives.languageindependent('address_extra')

    city = schema.TextLine(title=_(u"City"), )
    directives.languageindependent('city')

    zip_code = schema.TextLine(title=_(u"Zip code"), )
    directives.languageindependent('zip_code')

    country = schema.Choice(
        title=_(u"Country"),
        vocabulary=vocabularies.countries,
    )
    directives.languageindependent('country')

    email = schema.TextLine(
        title=_(u"General email address"),
        constraint=isEmail,
    )
    directives.languageindependent('email')

    phone = schema.TextLine(title=_(u"General telephone number"), )
    directives.languageindependent('phone')

    fax = schema.TextLine(
        required=False,
        title=_(u"General fax number"),
    )
    directives.languageindependent('fax')

    # Organisation's contact person

    key_name = schema.TextLine(
        description=_(u"Name/Surname of main contact person for the Campaign"),
        title=_(u"Contact person"),
    )
    directives.languageindependent('key_name')

    key_email = schema.TextLine(
        title=_(u"Email address of main contact person."),
        constraint=isEmailAvailable,
    )
    directives.languageindependent('key_email')

    key_phone = schema.TextLine(
        title=_(u"Telephone number of main contact person."),
        required=False,
    )
    directives.languageindependent('key_phone')

    # Organisation's website

    url = schema.URI(
        title=_(u"Home page"),
        description=_("Organisation's website"),
        constraint=isNonEmptyURI,
    )
    directives.languageindependent('url')

    campaign_url = schema.URI(
        title=_(u"Dedicated Campaign Website"),
        description=_(
            u'Special web section dealing with issues related to occupational '
            'health and safety'),
        constraint=isNonEmptyURI,
        required=False,
    )
    directives.languageindependent('campaign_url')

    campaign_pledge = RichText(
        title=_(
            u"How does your organisation plan to contribute to making this "
            u"Campaign a joint success? (your Campaign pledge)"),
        description=_(
            u"Please summarise briefly the support that you will provide "
            u"described under STEP 2 of this application form (max. 150 "
            u"words)."),
    )
    directives.languageindependent('campaign_pledge')
    formdirectives.omitted('campaign_pledge')

    mission_statement = schema.Text(
        title=_(u"Your mission statement"),
        description=_(u"Briefly outline the mission of your company"),
    )
    directives.languageindependent('mission_statement')
    formdirectives.omitted('mission_statement')

    logo = NamedBlobImage(
        title=_(u"Company / Organisation logo"),
        description=_(
            u"Please add an image with the company / organisation logo. "
            u"Please use a format suited for web display if possible (JPEG, "
            u"PNG or GIF)."),
        constraint=isImage,
    )
    directives.languageindependent('logo')
    formdirectives.omitted('logo')
    formdirectives.no_omit(IEditForm, 'logo')

    ceo_image = NamedBlobImage(
        title=_(u"Photo of your CEO, President, General Director or other"),
        constraint=isImage,
    )
    directives.languageindependent('ceo_image')
    formdirectives.omitted('ceo_image')
예제 #23
0
class IResourceBase(IResourceAllocationDefaults):
    """ A resource displaying a calendar. """

    title = schema.TextLine(title=_(u'Name'))

    description = schema.Text(title=_(u'Description'), required=False)

    directives.languageindependent('first_hour')
    first_hour = schema.Int(
        title=_(u'First hour of the day'),
        description=_(u'Everything before this hour is not shown in the '
                      u'calendar, making the calendar display more compact. '
                      u'Should be set to an hour before which there cannot '
                      u'be any reservations.'),
        default=7)

    directives.languageindependent('last_hour')
    last_hour = schema.Int(
        title=_(u'Last hour of the day'),
        description=_(u'Everything after this hour is not shown in the '
                      u'calendar, making the calendar display more compact. '
                      u'Should be set to an hour after which there cannot '
                      u'be any reservations.'),
        default=23)

    directives.languageindependent('available_views')
    available_views = schema.List(
        title=_(u'Available Views'),
        description=_(u'Views available to the user on the calendar.'),
        value_type=schema.Choice(source=calendar_views),
        default=default_views,
        constraint=select_at_least_one)

    form.widget(available_views=CheckBoxFieldWidget)

    directives.languageindependent('selected_view')
    selected_view = schema.Choice(
        title=_(u'Selected View'),
        description=_(u'Selected view when opening the calendar.'),
        source=calendar_views,
        default=default_selected_view)

    form.widget(selected_view=RadioFieldWidget)

    directives.languageindependent('selected_date')
    selected_date = schema.Choice(
        title=_(u'Selected Date'),
        description=_(u'Calendar date shown when opening the calendar.'),
        source=calendar_dates,
        default='current')

    form.widget(selected_date=RadioFieldWidget)

    directives.languageindependent('specific_date')
    specific_date = schema.Date(title=_(u'Specific Date'), required=False)

    form.fieldset('defaults',
                  label=_(u'Default Allocation Values'),
                  fields=('quota', 'partly_available', 'raster',
                          'approve_manually', 'reservation_quota_limit'))

    directives.languageindependent('formsets')
    formsets = schema.List(
        title=_(u'Formsets'),
        description=_(
            u'Subforms that need to be filled out to make a reservation. '
            u'Forms can currently only be created by a site-administrator.'),
        value_type=schema.Choice(source=form_interfaces, ),
        required=False)

    form.widget(formsets=CheckBoxFieldWidget)

    @invariant
    def isValidFirstLastHour(Resource):
        in_valid_range = lambda h: 0 <= h and h <= 24
        first_hour, last_hour = Resource.first_hour, Resource.last_hour

        if not in_valid_range(first_hour):
            raise Invalid(_(u'Invalid first hour'))

        if not in_valid_range(last_hour):
            raise Invalid(_(u'Invalid last hour'))

        if last_hour <= first_hour:
            raise Invalid(_(u'First hour must be smaller than last hour'))

    @invariant
    def isValidCalendarDate(Resource):
        if Resource.selected_date == 'specific' and not Resource.specific_date:
            raise Invalid(
                _(u"You chose to 'Always show a specific date' but you did "
                  u"not specify a specific date"))

    @invariant
    def isValidSelectedView(Resource):
        if Resource.selected_view not in Resource.available_views:
            raise Invalid(
                _(u'The selected view must be one of the available views.'))