Ejemplo n.º 1
0
class IChurchBody(form.Schema, IImageScaleTraversable):
    """
    A Church Body
    """

    member_of = RelationChoice(
        title=_(u"Member Of"),
        source=ObjPathSourceBinder(
            object_provides='wcc.churchbody.churchbody.IChurchBody'),
        required=False)

    assoc_member_of = RelationChoice(
        title=_(u"Associate Member Of"),
        source=ObjPathSourceBinder(
            object_provides='wcc.churchbody.churchbody.IChurchBody'),
        required=False)

    form.widget(other_members=DataGridFieldFactory)
    other_members = schema.List(title=_(u'Other Members'),
                                value_type=DictRow(title=_(u'Member'),
                                                   schema=IOtherChurchSchema),
                                required=False)

    form.widget(other_assoc_members=DataGridFieldFactory)
    other_assoc_members = schema.List(title=_(u'Other Associate Members'),
                                      value_type=DictRow(
                                          title=_(u'Member'),
                                          schema=IOtherChurchSchema),
                                      required=False)
Ejemplo n.º 2
0
class IVideo(model.Schema, utils.IUserMixin, utils.IVotingMixin):

    title = schema.TextLine(
        title=u'Video name',
        required=True,
    )

    description = schema.Text(
        title=u'Video description',
        required=True,
    )

    url_youtube = schema.TextLine(
        title=u'Youtube URL',
        required=True,
    )

    video_in_step = RelationList(
        title=u'In pilgrimage steps',
        description=u'Select pilgrimage steps where this video will appear.',
        default=[],
        value_type=RelationChoice(source=ObjPathSourceBinder(
            path={'query': '/en/pilgrimage-steps'}, ), ),
        required=False,
    )

    featured_video_in_step = RelationList(
        title=u'As featured in pilgrimage steps',
        description=
        u'Select pilgrimage steps where this video will appear as a featured resource.',
        default=[],
        value_type=RelationChoice(source=ObjPathSourceBinder(
            path={'query': '/en/pilgrimage-steps'}, ), ),
        required=False,
    )
Ejemplo n.º 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,
    )
Ejemplo n.º 4
0
class ITAZAnalysis(model.Schema, IImageScaleTraversable):
    """
    TAZ Analysis of a LEAM Scenario
    """

    layer = RelationChoice(
        title=_(u"GIS layer"),
        source=ObjPathSourceBinder(object_provides=ISimMap.__identifier__),
    )

    baseyear = schema.TextLine(
        title=_(u"Year"),
        default=u"2010",
    )

    years = schema.TextLine(
        title=_(u"Target Years"),
        description=_(u"comma seperated list of target years"),
        default=_(u"2020,2025,2030,2035,2040"),
    )

    scenario = RelationChoice(
        title = _(u"LEAM Scenario"),
        description = _(u"Select specific scenarios for a onetime run"),
        source = ObjPathSourceBinder(object_provides= \
                                     ILUCScenario.__identifier__),
        required = False,
        )

    #form.omitted('runstatus')
    runstatus = schema.TextLine(
        title=_(u"Job Status"),
        default=u"pending",
    )
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,
    )
Ejemplo n.º 6
0
class IJobTimeTransaction(Interface):

    title = schema.TextLine(
        title=_(u"Title"),
        required=True,
    )

    from_user = RelationChoice(
        title=_(u"From user"),
        source=ObjPathSourceBinder(),
        required=True,
    )

    to_user = RelationChoice(
        title=_(u"To user"),
        source=ObjPathSourceBinder(),
        required=True,
    )

    job = RelationChoice(
        title=_(u"Job"),
        source=ObjPathSourceBinder(object_provides=IJobTime),
        required=True,
    )

    minutes_amount = schema.Int(
        title=_(u"Amount"),
        default=0,
    )
Ejemplo n.º 7
0
class ISound(model.Schema, utils.IUserMixin, utils.IVotingMixin):

    title = schema.TextLine(
        title=u'Sound name',
        required=True,
    )

    description = schema.Text(
        title=u'Sound description',
        required=True,
    )

    soundcloud_id = schema.TextLine(
        title=u'Soundcloud ID',
        required=True,
    )

    sound_in_step = RelationList(
        title=u'In pilgrimage steps',
        description=u'Select pilgrimage steps where this sound will appear.',
        default=[],
        value_type=RelationChoice(source=ObjPathSourceBinder(
            path={'query': '/en/pilgrimage-steps'}, ), ),
        required=False,
    )

    featured_sound_in_step = RelationList(
        title=u'As featured in pilgrimage steps',
        description=
        u'Select pilgrimage steps where this sound will appear as a featured resource.',
        default=[],
        value_type=RelationChoice(source=ObjPathSourceBinder(
            path={'query': '/en/pilgrimage-steps'}, ), ),
        required=False,
    )
Ejemplo n.º 8
0
class IRelatedContacts(model.Schema):
    model.fieldset(
        'related_contacts',
        label=_(u'Related contacts'),
        fields=('aboveContentContact', 'aboveVisbileFields',
                'belowContentContact', 'belowVisbileFields', 'see_map',
                'see_logo_in_popup'),
    )

    aboveContentContact = RelationList(
        title=u'Above content related contact',
        default=[],
        value_type=RelationChoice(
            title=_(u'Related'),
            source=ObjPathSourceBinder(portal_type=('person', 'organization',
                                                    'held_position'))),
        required=False,
    )

    form.widget(aboveVisbileFields=OrderedSelectFieldWidget)
    aboveVisbileFields = schema.Tuple(
        title=_(u'Visible fields for above viewlet'),
        description=_(u'Please select which fields should be visible.'),
        required=False,
        default=('street', 'number', 'zip_code', 'city', 'phone', 'cell_phone',
                 'fax', 'email', 'website', 'activity'),
        value_type=schema.Choice(
            vocabulary=u'cpskin.core.vocabularies.contact_fields'))

    belowContentContact = RelationList(
        title=u'Below content related contact',
        default=[],
        value_type=RelationChoice(
            title=_(u'Related'),
            source=ObjPathSourceBinder(portal_type=('person', 'organization',
                                                    'held_position'))),
        required=False,
    )

    form.widget(belowVisbileFields=OrderedSelectFieldWidget)
    belowVisbileFields = schema.Tuple(
        title=_(u'Visible fields for below viewlet'),
        description=_(u'Please select which fields should be visible.'),
        required=False,
        default=('title', ),
        value_type=schema.Choice(
            vocabulary=u'cpskin.core.vocabularies.contact_fields'))

    see_map = schema.Bool(
        title=_(u'See map'),
        description=_(u'Do you want to map with links of contacts ?'),
        required=False,
        default=True)

    see_logo_in_popup = schema.Bool(
        title=_(u'See logo on map popup'),
        description=_(u'Do you want to logo of contact on the popup on map ?'),
        required=False,
        default=True)
Ejemplo n.º 9
0
class IResourceUpload(model.Schema):

    name = schema.TextLine(
        title=u'Name',
        required=True,
    )

    email = schema.TextLine(
        title=u'E-mail',
        required=False,
    )

    church = schema.TextLine(
        title=u'Your church',
        required=False,
    )

    message = schema.Text(
        title=u'Message',
        required=True,
    )

    video = RelationList(
        title=u'Video',
        default=[],
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                path={'query': '/en/resources/videos'}
            ),
        ),
        required=False
    )

    sound = RelationList(
        title=u'Sound',
        default=[],
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                path={'query': '/en/resources/sounds'}
            ),
        ),
        required=False
    )

    document = RelationList(
        title=u'Document',
        default=[],
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                path={'query': '/en/resources/documents'}
            ),
        ),
        required=False
    )
Ejemplo n.º 10
0
class IQuarterly(form.Schema, IImageScaleTraversable):
    """
    TBFAC Quarterly Type
    """
    
    # 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/quarterly.xml to define the content type
    # and add directives here as necessary.
    
    #form.model("models/quarterly.xml")

    title = schema.TextLine(
        title=_(u"Title"),
    )

    info = RelationChoice(
        title=_(u"Info"),
        source=ObjPathSourceBinder(object_provides=IInfo.__identifier__),
        required=False,
    )

    text = RichText(
        title=_(u"Body"),
        required=False,
    )
Ejemplo n.º 11
0
class IAlias(model.Schema):
    """Schema interface. Note that the alias will also appear to provide the
    schema of the aliased object.
    """

    _aliasTarget = RelationChoice(
        title=_(u"Aliased object"),
        description=_(u"Choose an object to alias"),
        required=True,
        source=ObjPathSourceBinder(),
    )

    _aliasTitle = schema.TextLine(
        title=_(u"Title override"),
        description=_(u"If you want your alias to have a different title "
                      "than the aliased object, enter a title here."),
        required=False,
    )

    _aliasTraversal = schema.Bool(
        title=_(u"Allow traversal"),
        description=_(u"If selected, children of the aliased object will "
                      "appear as children of the alias. Note that they "
                      "will not be indexed in the catalog, and probably "
                      "won't show up in folder listings. This option "
                      "may be useful for e.g. Collections, where some "
                      "information is stored in child objects."),
        required=True,
        default=False,
    )
Ejemplo n.º 12
0
class IHautpflegemittel(form.Schema, IImageScaleTraversable):
    """
    Schema eines Hautpflegemittels
    """

    title = schema.TextLine(title=u"Produktname")

    anwendungsbereich = schema.List(
        title=u"Anwendungsbereich",
        value_type=schema.Choice(vocabulary=anwendungVocabulary),
        required=False,
    )

    inhaltsstoffe = schema.List(title=u"Inhaltsstoffe",
                                value_type=schema.TextLine(),
                                required=False)

    konservierungsmittel = schema.List(title=u"Konservierungsmittel",
                                       value_type=schema.TextLine(),
                                       required=False)

    duftstoffe = schema.List(title=u"Duftstoffe",
                             value_type=schema.TextLine(),
                             required=False)

    bemerkungen = schema.Text(title=u"Bemerkungen", required=False)

    bild = NamedBlobImage(title=u"Produktbild", required=False)

    hersteller = RelationChoice(
        title=u"Hersteller oder Lieferant",
        source=ObjPathSourceBinder(),
        required=False,
    )
Ejemplo n.º 13
0
class ICommentFile(form.Schema, IImageScaleTraversable):
    """
    Review comment attached file
    """

    reviewer = RelationChoice(
        title=_('Reviewer'),
        source=ObjPathSourceBinder(Type="Profile", groups="ExternalReviewer"),
        required=True,
    )

    acceptOrReject = schema.Choice(
        title=_(u'Result of Review'),
        vocabulary=AcceptOrReject,
        default=None,
        required=False,
    )

    externalReviewerComment = schema.Text(
        title=_(u'External reviewer comment'),
        required=False,
    )

    reviewCommentAttached = NamedBlobFile(
        title=_(u'External reviewer comment attached file'),
        required=False,
    )
Ejemplo n.º 14
0
class IProduktOrdner(form.Schema, IImageScaleTraversable):
    """
    Tabelle bzw. Ordner fuer Produktdatenblaetter
    """
    bemerkungen = RichText(
        title=_(u"Bemerkungen"),
        description=
        _(u"Hier können Bemerkungen eingefügt werden, die im Kopfbereich der Produktordner\
                                          angezeigt werden."),
        required=False,
    )

    titelbilder = RelationList(
        title=u"Titelbilder",
        description=
        u"Hier können Sie Titelbilder für die Anzeige im Kopf der Seite auswählen",
        default=[],
        value_type=RelationChoice(title=_(u"Titelbilder"),
                                  source=ObjPathSourceBinder()),
        required=False,
    )

    anzeige = schema.Bool(
        title=u"Anzeige des Titelbildes im Ordner.",
        default=True,
        required=False,
    )

    spalte = schema.Bool(
        title=u"Anzeige des Titelbildes in der Zweispaltenansicht.",
        default=True,
        required=False,
    )
Ejemplo n.º 15
0
class ISession(model.Schema):
    """A conference session. Sessions are managed inside Programs.
    """

    title = schema.TextLine(
        title=_(u"Title"),
        description=_(u"Session title"),
    )

    description = schema.Text(
        title=_(u"Session summary"),
    )

    model.primary('details')
    details = RichText(
        title=_(u"Session details"),
        required=False
    )

    # use an autocomplete selection widget instead of the default content tree
    form.widget(presenter=AutocompleteFieldWidget)
    presenter = RelationChoice(
        title=_(u"Presenter"),
        source=ObjPathSourceBinder(
            object_provides=IPresenter.__identifier__),
        required=False,
    )

    dexterity.write_permission(track='example.conference.ModifyTrack')
    track = schema.Choice(
        title=_(u"Track"),
        source=possibleTracks,
        required=False,
    )
Ejemplo n.º 16
0
class ISnippet(form.Schema):
    """ A snippet is a short (a few paragraphs) prose text, usually part of a storyline
    """

    title = schema.TextLine(title=_(u"Title"), )

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

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

    timetag = schema.Datetime(
        title=_(u"Timetag"),
        description=_("The approximate time at which the events that this "
                      "snippet describes take place"),
        required=False,
    )

    locationtag = RelationChoice(
        title=_(u"Locationtag"),
        source=ObjPathSourceBinder(object_provides=ILocation.__identifier__),
        required=False,
    )
Ejemplo n.º 17
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,
    )
Ejemplo n.º 18
0
class IStory(model.Schema):

    text = schema.Text(title=_(u"Text"), required=False)

    form.widget('estimate',
                TimeFieldWidget,
                show_min=False,
                hour_free_input=True)
    estimate = schema.Decimal(title=_(u"Estimate (man hours)"),
                              default=Decimal('0.00'))

    assigned_to = Select2MultiField(
        title=_(u"Assignees"),
        description=_(u"The user IDs of the people "
                      u"that are responsible to act on this story"),
        # value_type=schema.TextLine(),
        value_type=schema.Choice(
            title=_(u"User ID"),
            source="collective.simplemanagement.resources"),
        required=False,
        search_view=lambda x: '{}/select2-users-search'.format(x))

    epic = RelationChoice(title=_(u"Epic"),
                          description=_(u"The epic the story belongs to"),
                          source=ObjPathSourceBinder(object_provides=[
                              IEpic.__identifier__,
                          ]),
                          required=False)

    milestone = schema.Choice(title=_(u"Milestone"),
                              required=False,
                              source="collective.simplemanagement.milestones")
class ILinkedResource(model.Schema):
    model.fieldset('linked-resources',
                   label=u"Linked resources",
                   fields=[
                       'remote_url',
                       'related_resources',
                       'related_resources_cta',
                   ])

    remote_url = schema.TextLine(
        title=_(u'Link'),
        description=_(u'Insert a link to an external resource, '
                      u'or relate an internal resource '
                      u'using "Linked resource" below.'),
        required=False,  # we can use also relatedItems
    )

    # form.widget(related_resource=ContentTreeFieldWidget)
    related_resources = RelationList(title=_(u"Linked resources"),
                                     required=False,
                                     value_type=RelationChoice(
                                         title=u"Multiple",
                                         source=ObjPathSourceBinder()))
    related_resources_cta = schema.Text(
        title=_(u'Resources CTA'),
        description=_(u'Insert related resource call to actions options. '
                      u'Each line match a linked resource. '
                      u'You can provide them in the form '
                      u'`option:value, option2:value`.'
                      u'Valid options are: `label`, `css_class`., '),
        required=False,  # we can use also relatedItems
        default=u'')
Ejemplo n.º 20
0
class INomination(form.Schema):
    """
    TBFAC Nomination Type
    """

    title = schema.TextLine(
        title=_(u'Title'),
        required=False,
    )

    category = schema.List(
        title=_(u'Award Category'),
        value_type=schema.Choice(values=[
            _(u'Visual Arts'),
            _(u'Performing Arts'),
            _(u'Uncatrgorized')
        ]),
        required=False,
    )

    info = RelationList(
        title=_(u'Nominated Info'),
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                object_provides=IInfo.__identifier__,
                #navigation_tree_query={
                #    'path': {'query': '/taishin/event/info'}
                #},
            ), ),
    )

    text = RichText(
        title=_(u'Body'),
        required=False,
    )
Ejemplo n.º 21
0
class IHerstellerOrdner(form.Schema, IImageScaleTraversable):
    """
    Ordner bzw. Tabelle Produkthersteller
    """
    titelbilder = RelationList(
        title=u"Titelbilder",
        description=
        u"Hier können Sie Titelbilder für die Anzeige im Kopf der Seite auswählen",
        default=[],
        value_type=RelationChoice(title=_(u"Titelbilder"),
                                  source=ObjPathSourceBinder()),
        required=False,
    )

    anzeige = schema.Bool(
        title=u"Anzeige des Titelbildes im Ordner.",
        default=True,
        required=False,
    )

    spalte = schema.Bool(
        title=u"Anzeige des Titelbildes in der Zweispaltenansicht.",
        default=True,
        required=False,
    )
Ejemplo n.º 22
0
class IMassChangePortletsSchema(interface.Interface):
    """Define masschange form fields"""

    if not HAS_W:
        selected_obj_paths = RelationList(
            title=
            u"Objects to change (leave empty for all Folders and Documents)",
            required=False,
            default=[],
            value_type=RelationChoice(title=u"Related",
                                      source=ObjPathSourceBinder()))
    else:
        directives.widget('selected_obj_paths', RelatedItemsWidget)

        selected_obj_paths = RelationList(
            title=
            u"Objects to change tags (leave empty for all Folders and Documents)",
            required=False,
            default=[],
            value_type=RelationChoice(
                title=u"Related", vocabulary="plone.app.vocabularies.Catalog"))

    text_replace_fields = zope.schema.Tuple(
        title=u"Fields to update",
        required=False,
        description=u"Select fields where you want to apply the text replace",
        default=('text', ),
        value_type=zope.schema.Choice(vocabulary=make_vocabulary(
            (u'text', u"Text body (text)"),
            (u'header', u"Portlet header"),
            (u'footer', u"Portlet footer"),
        )))
    directives.widget(text_replace_fields=CheckBoxFieldWidget)

    text_replace_mode = zope.schema.Choice(
        title=u"Text replacement mode",
        required=False,
        description=u"Select fields where you want to apply the text replace",
        default=u'plain',
        vocabulary=make_vocabulary(
            (u'plain', u"Replace plain text by another one"),
            (u'regexp', u"Replace pattern using regular expression."),
            (u'empty', u"Set text on all empty fields."),
        ))
    directives.widget(text_replace_mode=RadioFieldWidget)

    text_replace_source = zope.schema.TextLine(
        title=u"Text / pattern to replace",
        description=
        u"Set the plain text or regular expression to replace. If you choose 'set text on all empty fields', leave this field empty.",
        required=False,
    )

    text_replace_destination = zope.schema.TextLine(
        title=u"Replacement text / pattern",
        required=False,
        description=
        u"In regular expression mode, you can use \\1, \\2, etc. here to get pattern groups",
    )
Ejemplo n.º 23
0
class IStaticDocument(model.Schema, utils.IUserMixin, utils.IVotingMixin):

    title = schema.TextLine(
        title=u'Document name',
        required=True,
    )

    description = schema.Text(
        title=u'Document description',
        required=True,
    )

    file = NamedBlobFile(
        title=u'File',
        required=True,
    )

    file_thumb = NamedBlobFile(
        title=u'File thumb',
        description=u'Thumbnail of the file (if PDF) - will be generated automatically.',
        required=False,
    )

    doc_in_step = RelationList(
        title=u'In pilgrimage steps',
        description=u'Select pilgrimage steps where this document will appear.',
        default=[],
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                path={'query': '/en/pilgrimage-steps'},
            ),
        ),
        required=False,
    )

    featured_doc_in_step = RelationList(
        title=u'As featured in pilgrimage steps',
        description=u'Select pilgrimage steps where this document will appear as a featured resource.',
        default=[],
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                path={'query': '/en/pilgrimage-steps'},
            ),
        ),
        required=False,
    )
Ejemplo n.º 24
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'))
Ejemplo n.º 25
0
class IActionLink(ISymlink):
    symbolic_link = RelationChoice(
        title=_(u"Symbolic link"),
        source=ObjPathSourceBinder(
            navigation_tree_query={"portal_type": ("pstaction", )},
            portal_type=("pstaction", ),
            symlink_status=("void", "source")),
        required=True,
    )
Ejemplo n.º 26
0
class ISelectTranslation(Interface):
    target = RelationChoice(
        title=_(u"Item"),
        description=_(u"Select the item that is a translation."),
        required=True,
        source=ObjPathSourceBinder(navigation_tree_query={
            'object_provides': interface_name,
        }),
    )
Ejemplo n.º 27
0
    def _constructField(self, attributes):
        portal_type = attributes.get('portal_type') \
            or attributes.get('portal_types') \
            or []
        if 'portal_type' in attributes:
            del attributes['portal_type']

        if HAS_CONTENTTREE and not HAS_WIDGETS and not portal_type:
            attributes['source'] = ObjPathSourceBinder()
        elif HAS_CONTENTTREE and not HAS_WIDGETS:
            attributes['source'] = ObjPathSourceBinder(portal_type=portal_type)
        elif not portal_type:
            attributes['source'] = CatalogSource()
        else:
            attributes['source'] = CatalogSource(portal_type=portal_type)

        return super(RelationChoiceBaseHandler,
                     self)._constructField(attributes)
Ejemplo n.º 28
0
class IRelatedItemsSchema(IBaseTileSchema):

    related_items = RelationList(
        title=_(u'label_related_items', default=u'Related Items'),
        default=[],
        value_type=RelationChoice(title=u"Related",
                                  source=ObjPathSourceBinder()),
        required=False,
    )
Ejemplo n.º 29
0
class ITestForm(Interface):
    multiple = RelationList(
        title=u"Multiple (Relations field)",
        required=False,
        value_type=RelationChoice(
            title=u"Multiple",
            vocabulary="plone.formwidget.relations.cmfcontentsearch"))
    single = RelationChoice(title=u"Single",
                            required=False,
                            source=ObjPathSourceBinder())
Ejemplo n.º 30
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)