class ITestForm(Interface): buddy = schema.Choice(title=u"Buddy object", description=u"Select one, please", source=PathSourceBinder(portal_type='Document')) friends = schema.List(title=u"Friend objects", description=u"Select as many as you want", value_type=schema.Choice( title=u"Selection", source=PathSourceBinder(portal_type='Document')))
class IBlogEntryCollectionPortlet(IPortletDataProvider): portlet_title = schema.TextLine(title=_(u'label_title', default=u'Title'), required=True) show_image = schema.Bool( title=_(u'label_show_image', default=u'Show lead images'), description=_( u'help_portlet_show_image', default=u'You can enable the leadimage in the configuration ' 'registry'), default=True) path = schema.List( title=_(u'Blogs'), description=_( u'help_portlet_blogs', default=u'Choose the blog of which the entries are listed. ' 'Defaults to all blogs.'), value_type=schema.Choice( source=PathSourceBinder(is_folderish=True, portal_type='Blog', navigation_tree_query=None), ), required=False, ) quantity = schema.Int(title=_(u'label_quantity', default=u'Quantity'), default=5) show_desc = schema.Bool(title=_(u'label_show_desc', default=u"Show Description"), default=True)
class IRelatedContainerSchema(IBaseTileSchema): form.widget(source_context=ContentTreeFieldWidget) source_context = schema.Choice( title=_(u"Folder or collection"), # description=_(u""), required=False, source=PathSourceBinder(portal_type=('Folder', 'Collection'))) form.widget(related_types=CheckBoxFieldWidget) related_types = schema.List( title=_(u"Types to list"), description=_(u'This may have no effect ' U'if you are linking collections.'), required=False, value_type=schema.Choice( title=u"Multiple", vocabulary='plone.app.vocabularies.UserFriendlyTypes')) limit = schema.Int( title=_(u'Limit'), default=10, required=True, ) subfolders = schema.Bool( title=_(u'Look into subfolders too?'), default=False, )
class IBandeauContent(Interface): """ Bandeau informations """ bannerLocalOnly = schema.Bool( title=_(u"label_bannerLocalOnly", default=(u"Local Banner")), description=_( u'help_bannerLocalOnly', default=u"Display the banner in the current folder only"), required=False, default=False, ) bannerStopAcquisition = schema.Bool( title=_(u"label_bannerStopAcquisition", default=(u"Stop Acquisition")), description=_( u'help_bannerStopAcquisition', default= u"Stop banners research to this folder and don't display banners in upper folders" ), required=False, default=True, ) bannerImageLink = schema.Choice( title=_(u"label_bannerImageLink", default=u"A link for the banner"), source=PathSourceBinder(portal_type=['Document', 'Folder']), required=False)
def test_js(self): widget = MultiContentSearchWidget(self.request) widget.context = self.obj widget.name = 'test' widget.field = List(value_type=Choice(title=u"Selection", source=PathSourceBinder(portal_type='Document'))) result = widget.js_extra() self.assertIn('$(\'#test-widgets-query\').each(function()', result)
class IEditLinkedDataHomepages(form.Schema): set_plonesite = schema.Bool( title=u"Designate the Plone site as Homepage", ) homepages = schema.List( title=u"Additional LinkedData Homepages inside this site", description=u"Select as many as you want", value_type=schema.Choice( title=u"Selection", source=PathSourceBinder(portal_type='Folder'))) directives.widget('homepages', MultiContentTreeFieldWidget) directives.widget('set_plonesite', SingleCheckBoxFieldWidget)
class IBackgroundContent(Interface): """ Bandeau informations """ bannerLocalOnly = schema.Bool( title=_(u"label_bannerLocalOnly", default=(u"Local Banner")), description=_( u'help_bannerLocalOnly', default=u"Display the banner in the current folder only"), required=False, default=False, ) bannerStopAcquisition = schema.Bool( title=_(u"label_bannerStopAcquisition", default=(u"Stop Acquisition")), description=_( u'help_bannerStopAcquisition', default= u"Stop banners research to this folder and don't display banners in upper folders" ), required=False, default=True, ) bannerImageLink = schema.Choice( title=_(u"label_bannerImageLink", default=u"A link for the banner"), source=PathSourceBinder(portal_type=['Document', 'Folder'])) backgroundRepeat = schema.Choice( title=_(u"label_backgroundRepeat", default=u"Repeat the background"), values=['no-repeat', 'repeat-x', 'repeat-y', 'repeat'], required=True, ) backgroundExtend = schema.Bool( title=_(u"label_backgroundExtend", default=u"Extend the background"), required=True, default=True, ) backgroundFixed = schema.Bool( title=_(u"label_backgroundFixed", default=u"Fix the background"), required=True, default=True, ) backgroundAlign = schema.Choice( title=_(u"label_backgroundAlign", default=u"Background alignment"), values=['left', 'center', 'right'], )
class IPaneSchema(Schema): text = RichText( title=_(u'label_text', default=u'Text'), description=_(u'help_text', default=u''), required=False, ) image = NamedImage( title=_(u'label_image', default='Image'), required=True, ) form.widget(link=ContentTreeFieldWidget) link = schema.Choice(title=_(u'label_link', default=u'Link'), description=_(u'help_link', default=u''), required=False, source=PathSourceBinder())
class ILink(Interface): group = schema.TextLine( title=u'Group.', description=u'The group you are adding to.' ) link = schema.Choice( title=u"Content Link", description=u"Find the piece of content which you'd like to link to.", required=True, source=PathSourceBinder(navigation_tree_query={ 'path': {'navtree': 0, 'query': u''}, 'portal_type': ['Document', 'Large Plone Folder', 'Event', 'File', 'Folder', 'Image', 'Link', 'News Item', 'Tab', 'Topic'], }) )