class IImagePortlet(IPortletDataProvider): """ Define image portlet fields. """ image = NamedImage( title=_(u"Default Image"), description=_(u"Default image displayed in the portlet"), required=False, ) headingText = schema.Text(title=_(u"Heading"), description=_(u"Text on top of the default image"), required=False, default=u"") image2 = NamedImage( title=_(u"Rollover Image"), description=_(u"Image displayed when hovering over the portlet"), required=False, default=None) text = schema.Text(title=_(u"Rollover text"), description=_(u"Text displayed when hovering over the portlet"), required=False, default=u"") link = schema.TextLine(title=_(u"Link"), description=_(u"Absolute or site root relative link target"), required=False, default=None) css = schema.TextLine(title=_(u"HTML styling"), description=_(u"Extra CSS classes"), required=False)
class IProposta(model.Schema): """Modelagem do tipo de conteúdo Proposta: campos e widgets.""" justificativa = schema.Text(title=u'Justificativa da proposta', ) imagem = NamedImage( title=(u"Insira uma imagem relativa à proposta"), required=True, ) endereco = schema.TextLine(title=u'Endereço', required=False, max_length=500) bairro = schema.TextLine(title=(u'Bairro'), description=(u'Informe o bairro.'), max_length=50, required=False) cep = schema.TextLine(title=(u'CEP'), description=(u'Informe o CEP (apenas números)'), max_length=8, min_length=8, required=False, constraint=validateCep)
class IPerson(model.Schema, IContactContent): """Interface for Person content type""" is_created = Attribute(u"Marker to know if the object is already created") lastname = schema.TextLine( title=_("Lastname"), required=True ) firstname = schema.TextLine( title=_("Firstname"), required=False, ) gender = schema.Choice( title=_("Gender"), vocabulary="Genders", required=False, ) form.widget(gender=RadioFieldWidget) person_title = schema.TextLine( title=_("Person title"), required=False, ) photo = NamedImage( title=_("Photo"), required=False, ) def get_held_positions(self): """Returns held positions of this person
class IDestaqueTile(IListTile): uuids = schema.Dict( title=_(u'Elements'), key_type=schema.TextLine(), value_type=schema.Dict( key_type=schema.TextLine(), value_type=schema.TextLine(), ), required=False, ) title = schema.List( title=_(u'Title'), required=False, readonly=True, ) description = schema.Text( title=_(u'Description'), required=False, readonly=True, ) image = NamedImage( title=_(u'Image'), required=False, readonly=True, )
class ILinkTile(IPersistentCoverTile): title = schema.TextLine( title=_(u'Title'), required=False, ) description = schema.Text( title=_(u'Description'), required=False, ) image = NamedImage( title=_(u'Image'), required=False, ) remote_url = schema.TextLine( title=_(u'URL'), required=False, ) uuid = schema.TextLine( title=_(u'UUID'), required=False, readonly=True, # the field can not be edited or configured )
class IListTile(IPersistentCoverTile): uuids = schema.List( title=_(u'Elements'), value_type=schema.TextLine(), required=False, ) title = schema.TextLine( title=_(u'Title'), required=False, readonly=True, ) description = schema.Text( title=_(u'Description'), required=False, readonly=True, ) image = NamedImage( title=_(u'Image'), required=False, readonly=True, )
class IListTile(IPersistentCoverTile): uuids = schema.List(title=u'Item uuids', value_type=schema.TextLine(), readonly=True) title = schema.TextLine(title=_(u'Title'), required=False, readonly=True) description = schema.Text(title=_(u'Description'), required=False, readonly=True) image = NamedImage(title=_(u'Image'), required=False, readonly=True) def results(): """ This method return a list of the objects in uuids """ def populate_with_object(obj): """ This method will take a CT and will append its uid to uuids """ def delete(): """ This method removes the persistent data created for this tile """ def accepted_ct(): """
class ICollectionTile(IPersistentCoverTile, form.Schema): title = schema.TextLine(title=u'Title') form.omitted(ICoverTileEditView, 'description') description = schema.Text( title=u'Description', required=False, ) form.omitted(ICoverTileEditView, 'date') date = schema.Datetime( title=u'Date', required=False, ) form.omitted(ICoverTileEditView, 'image') image = NamedImage( title=u'Image', required=False, ) form.omitted(ICoverTileEditView, 'number_to_show') number_to_show = schema.List( title=u'number of elements to show', value_type=schema.TextLine(), required=False, ) uuid = schema.TextLine(title=u'Collection uuid', readonly=True)
class ITeaserPortlet(IPortletDataProvider): """A portlet which can some given Infos """ teasertitle = schema.TextLine(title=_(u'Title'), description=u'', required=True) teaserdesc = schema.Text(title=_(u'Description'), description=u'', required=True) internal_target = schema.Choice(title=_(u"Internal Target"), description=_(u"Find an internal target \ for this image to link to"), required=False, source=UUIDSourceBinder({})) image = NamedImage(title=_(u'Image'), description=u'', required=True) imagetitle = schema.TextLine( title=_( u'label_imagetitle', default=u'Image Title', ), description=_( u'help_imagetitle', default=u'The provided image title will be used as alt-text.', ), required=True, )
class IHeldPosition(model.Schema, IContactContent): """Interface for HeldPosition content type""" position = ContactChoice( title=_("Organization/Position"), source=ContactSourceBinder(portal_type=("organization", "position")), required=True, ) label = schema.TextLine(title=_("Additional label"), description=_("Additional label with information that does not appear on position label"), required=False) start_date = schema.Date( title=_("Start date"), required=False, ) end_date = schema.Date( title=_("End date"), required=False, ) photo = NamedImage( title=_("Photo"), required=False, readonly=True, ) def get_person(): """Returns the person who holds the position """ def get_position(): """Returns the position (if position field is a position) """ def get_organization(): """Returns the first organization related to HeldPosition
class IBannerRotativoTile(IListTile): """ """ form.omitted('header') form.no_omit(IDefaultConfigureForm, 'header') header = schema.TextLine( title=_(u'Header'), required=False, readonly=True, ) form.omitted('title') form.no_omit(IDefaultConfigureForm, 'title') title = schema.TextLine( title=_(u'Title'), required=False, readonly=True, ) form.omitted('description') form.no_omit(IDefaultConfigureForm, 'description') description = schema.Text( title=_(u'Description'), required=False, readonly=True, ) form.omitted('date') form.no_omit(IDefaultConfigureForm, 'date') date = schema.Datetime( title=_(u'Date'), required=False, readonly=True, ) form.omitted('image') form.no_omit(IDefaultConfigureForm, 'image') image = NamedImage( title=_(u'Image'), required=False, readonly=True, ) layout = schema.Choice( title=u'Layout', values=(u'Banner', u'Chamada de foto', u'Texto sobreposto'), default=u'Banner', required=True, ) form.omitted('uuids') form.no_omit(IDefaultConfigureForm, 'uuids') uuids = schema.List( title=_(u'Elements'), value_type=schema.TextLine(), required=False, readonly=True, )
class IBasicTile(IPersistentCoverTile): title = schema.TextLine( title=_(u'Title'), required=False, ) description = schema.Text( title=_(u'Description'), required=False, ) image = NamedImage( title=_(u'Image'), required=False, ) form.no_omit('image_description') form.omitted(IDefaultConfigureForm, 'image_description') image_description = schema.TextLine( title=_(u'ALT'), required=False, ) form.omitted('date') form.no_omit(IDefaultConfigureForm, 'date') date = schema.Datetime( title=_(u'Date'), required=False, readonly=False, ) form.omitted('subjects') form.no_omit(IDefaultConfigureForm, 'subjects') form.widget(subjects='z3c.form.browser.textarea.TextAreaFieldWidget') subjects = schema.Tuple( title=_(u'label_categories', default=u'Categories'), required=False, value_type=schema.TextLine(), missing_value=(), ) uuid = schema.TextLine( title=_(u'UUID'), required=False, readonly=True, ) form.no_omit('variacao_titulo') form.omitted(IDefaultConfigureForm, 'variacao_titulo') variacao_titulo = schema.Choice( title=_b(u'Title Change'), values=(u'Normal', u'Grande', u'Gigante'), default=u'Normal', required=True, )
class IFileTile(IPersistentCoverTile): title = schema.TextLine( title=_(u'Title'), required=False, ) description = schema.Text( title=_(u'Description'), required=False, ) image = NamedImage( title=_(u'Image'), required=False, ) download = schema.TextLine( title=_(u'Download link'), required=False, readonly=True, # the field can not be edited or configured ) uuid = schema.TextLine( title=_(u'UUID'), required=False, readonly=True, ) def get_title(): """ Returns the title stored in the tile. """ def get_description(): """ Returns the description stored in the tile. """ def get_image(): """ Returns the image stored in the tile. """ def download_widget(): """ Returns a download link for the file associated with the tile. """ def get_date(): """ Returns the date of the file associated with the tile. """ def populate_with_object(obj): """ Takes a File object as parameter, and it will store the content of its fields into the tile. """ def delete(): """ Removes the persistent data created for the tile.
class ICollectionTile(IPersistentCoverTile, form.Schema): title = schema.TextLine(title=u'Title') form.omitted(ICoverTileEditView, 'description') description = schema.Text( title=u'Description', required=False, ) form.omitted(ICoverTileEditView, 'date') date = schema.Datetime( title=u'Date', required=False, ) form.omitted(ICoverTileEditView, 'image') image = NamedImage( title=u'Image', required=False, ) form.omitted(ICoverTileEditView, 'number_to_show') number_to_show = schema.List( title=u'number of elements to show', value_type=schema.TextLine(), required=False, ) uuid = schema.TextLine(title=u'Collection uuid', readonly=True) def results(): """ This method return a list og A method to return the rich text stored in the tile """ def populate_with_object(obj): """ This method will take a CT Collection as parameter, and it will store a reference to it. """ def delete(): """ This method removes the persistent data created for this tile """ def accepted_ct(): """ Return a list of supported content types. """ def has_data(): """
class IPaneSchema(Schema): title = schema.TextLine( title=_PMF(u'label_title', default=u'Title'), required=True ) show_title = schema.Bool( title=_(u'label_show_title', default=u'Show title'), required=False, default=False, missing_value=False, ) text = RichText( title=_(u'label_text', default=u'Text'), description=_(u'help_text', default=u''), required=False, ) model.primary('image') image = NamedImage( title=_(u'label_image', default='Image'), required=True, ) image_alt_text = schema.TextLine( title=_(u'label_image_alt_text', default=u'Image alt text'), required=False ) form.widget(link=ReferenceWidgetFactory) link = schema.TextLine( title=_(u'label_link', default=u'Link'), description=_(u'help_link', default=u''), required=False, ) external_url = schema.URI( title=_(u'label_external_url', default=u'External URL'), required=False, ) @invariant def validate_links(data): """ It is not allowed to add a link and an external url at the same time. """ if data.link and data.external_url: raise Invalid(_( u'error_message_links', default=u'It\'s not possible to add a link and an ' u'external url at the same time') )
class ICollectionTile(IPersistentCoverTile, form.Schema): header = schema.TextLine( title=_(u'Header'), required=False, ) form.omitted('title') form.no_omit(IDefaultConfigureForm, 'title') title = schema.TextLine( title=_(u'Title'), required=False, ) form.omitted('description') form.no_omit(IDefaultConfigureForm, 'description') description = schema.Text( title=_(u'Description'), required=False, ) form.omitted('date') form.no_omit(IDefaultConfigureForm, 'date') date = schema.Datetime( title=_(u'Date'), required=False, ) form.omitted('image') form.no_omit(IDefaultConfigureForm, 'image') image = NamedImage( title=_(u'Image'), required=False, ) # FIXME: this field should be named 'count' form.omitted('number_to_show') form.no_omit(IDefaultConfigureForm, 'number_to_show') number_to_show = schema.List( title=_(u'Number of items to display'), value_type=schema.TextLine(), required=False, ) footer = schema.TextLine( title=_(u'Footer'), required=False, ) uuid = schema.TextLine( title=_(u'UUID'), readonly=True, )
class IOrganizationImages(model.Schema): fieldset( 'images', label=_(u'Images'), fields=['image1', 'image2'], ) image1 = NamedImage( title=_('Image 1'), description=_(u'This image is shown on directory view.'), required=False, ) image2 = NamedImage( title=_('Image 2'), description=_( u'This image is shown on directory view when mouse hovers the card.' ), # noqa required=False, )
class IDonorQuote(model.Schema, IImageScaleTraversable): """ A quote from a donor about why they donated """ image = NamedImage( title=u"Photo", description=u"(optional) Upload a photo to show with your quote.", required=False, ) key = schema.TextLine( title=u"Donation Secret Key", description=u"The key used to authenticate to views on the Donation.") model.load("models/donor_quote.xml")
class ICommittee(form.Schema, IImageScaleTraversable): """ TBFAC Committee 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/committee.xml to define the content type # and add directives here as necessary. #form.model("models/committee.xml") title = schema.TextLine( title=_(u"Name"), ) category = schema.Choice( title=_(u'Award Category'), values=[_(u'Visual Arts'), _(u'Performing Arts'), _(u'Uncatrgorized')], required=True, ) group = schema.List( title=_(u"Group"), value_type=schema.Choice( values=[_(u"NominatorGroup"), _(u"ObserverGroup"), _(u"Jury"), _(u"Committee"), _(u"FinalReviewer"), _(u"RecommendGroup")] ) ) year = schema.TextLine( title=_(u"Year"), ) description = schema.Text( title=_(u"Description"), required=False, ) form.primary('bio') bio = RichText( title=_(u"Bio"), required=False, ) form.primary('photo') photo = NamedImage( title=_(u"Photo"), description=_(u"Upload Photo"), required=False, )
class IBasicTile(IPersistentCoverTile): title = schema.TextLine( title=_(u'Title'), required=False, ) description = schema.Text( title=_(u'Description'), required=False, ) image = NamedImage( title=_(u'Image'), required=False, ) form.omitted(IDefaultConfigureForm, 'alt_text') alt_text = schema.TextLine( title=_( u'label_alt_text', default=u'Alternative Text'), description=_( u'help_alt_text', default=u'Provides a textual alternative to non-text content in web pages.'), # noqa E501 required=False, ) form.omitted('date') form.no_omit(IDefaultConfigureForm, 'date') date = schema.Datetime( title=_(u'Date'), required=False, readonly=False, ) form.omitted('subjects') form.no_omit(IDefaultConfigureForm, 'subjects') form.widget(subjects='z3c.form.browser.textarea.TextAreaFieldWidget') subjects = schema.Tuple( title=_(u'label_categories', default=u'Categories'), required=False, value_type=schema.TextLine(), missing_value=(), ) uuid = schema.TextLine( title=_(u'UUID'), required=False, readonly=True, )
class ILogoTile(model.Schema): """ """ form.widget(picture='plone.app.imagetile.imagewidget.ImageFieldWidget') picture = NamedImage( title=_('Select an image'), required=True, ) title = TextLine( title=_('Image title.'), required=False, )
class ICKTemplate(model.Schema, IDocument): """ Schema for CKEditor template """ custom_icon = NamedImage( title=_(u'Template Icon'), description=_( u"Icon displayed before the title in the list of templates"), required=False) content = RichText( title=_(u'Template content'), description=_( u"The content that will be pasted when the template is used"), required=True)
class IOrganization(model.Schema, IContactContent): """Interface for Organization content type""" activity = RichText( title=_("Activity"), required=False, ) organization_type = schema.Choice( title=_("Type or level"), vocabulary="OrganizationTypesOrLevels", ) logo = NamedImage( title=_("Logo"), required=False, ) def get_organizations_chain(self): """Returns the list of organizations and sub-organizations in this organization e.g. for HR service in Division Bar in Organization Foo : [OrganizationFoo, DivisionBar, HRService] """ def get_root_organization(self): """Returns the first organization in the chain e.g. the company or the institution """ def get_organizations_titles(self): """Returns the list of titles of the organizations and sub-organizations in this organization e.g. for HR service in Division Bar in Organization Foo : ["Organization Foo", "Division Bar", "HR service"] """ def get_full_title(self): """Returns the full title of the organization It is constituted by the list of the names of the organizations and sub-organizations in this organization separated by slashes e.g. for HR service in Division Bar in Organization Foo : u"Organization Foo / Division Bar / HR service" """ def get_positions(self): """Returns the positions""" def get_held_positions(self): """Returns the held positions
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 IDXItemSchema(Schema): bool_field = schema.Bool(title=u'Bool Field', default=False) choice_field = schema.Choice(title=u'Choice Field', vocabulary=COLORS) date_field = schema.Date(title=u'Date Field') datetime_field = schema.Datetime(title=u'Datetime Field') decimal_field = schema.Decimal(title=u'Float Field') dottedname_field = schema.URI(title=u'DottedName Field') file_field = NamedFile(title=u'File Field') float_field = schema.Float(title=u'Float Field') image_field = NamedImage(title=u'Image Field') list_field = schema.List(title=u'List Field') richtext_field = RichText(title=u'Rich Text Field') text_field = schema.Text(title=u'Text Field') time_field = schema.Time(title=u'Time Field') timedelta_field = schema.Timedelta(title=u'Timedelta Field') uri_field = schema.URI(title=u'URI Field')
class ISitterQualification(model.Schema): """ Description of the Example Type """ title = schema.TextLine( title=_('Name'), required=True, ) beschreibung = schema.TextLine( title=_('Beschreibung'), required=True, ) picture = NamedImage( title=_('Bildbeschreibung'), required=False, )
class IVideoGalleryTile(IListTile): """A droppable tile that shows a gallery of videos with descriptions and links. """ tile_title = schema.TextLine( title=_(u'Header'), required=False, ) form.omitted('title') form.no_omit(IDefaultConfigureForm, 'title') title = schema.TextLine( title=_(u'Title'), required=False, readonly=True, ) subtitle = schema.TextLine( title=_(u'Subtitle'), required=False, readonly=False, ) footer_text = schema.TextLine( title=_(u'Footer Link'), required=False, readonly=False, ) form.omitted('image') form.no_omit(IDefaultConfigureForm, 'image') image = NamedImage( title=_(u'Image'), required=False, readonly=True, ) form.omitted('uuids') form.no_omit(IDefaultConfigureForm, 'uuids') uuids = schema.List( title=_(u'Videos'), value_type=schema.TextLine(), required=False, )
class IVideoGalleryTile(IListTile, form.Schema): """ """ header = schema.TextLine( title=_(u'Header'), required=False, ) form.omitted('title') form.no_omit(IDefaultConfigureForm, 'title') title = schema.TextLine( title=_(u'Title'), required=False, readonly=True, ) subtitle = schema.TextLine( title=_(u'Subtitle'), required=False, readonly=False, ) footer_text = schema.TextLine( title=_(u'Footer Link'), required=False, readonly=False, ) form.omitted('image') form.no_omit(IDefaultConfigureForm, 'image') image = NamedImage( title=_(u'Image'), required=False, readonly=True, ) form.omitted('uuids') form.no_omit(IDefaultConfigureForm, 'uuids') uuids = schema.List( title=_(u'Videos'), value_type=schema.TextLine(), required=False, )
class ICarrosselAutomaticoTile(IPersistentCoverTile): form.omitted('image') form.no_omit(IDefaultConfigureForm, 'image') image = NamedImage( title=_(u'Image'), required=False, ) # FIXME: this field should be named 'count' form.omitted('number_to_show') form.no_omit(IDefaultConfigureForm, 'number_to_show') number_to_show = schema.List( title=_(u'Number of items to display'), value_type=schema.TextLine(), required=False, ) form.omitted('offset') form.no_omit(IDefaultConfigureForm, 'offset') offset = schema.Int( title=_(u'Start at item'), required=False, default=0, ) form.omitted(IDefaultConfigureForm, 'random') random = schema.Bool( title=_(u"Select random items"), required=False, default=False ) autoplay = schema.Bool( title=_(u'Auto play'), required=False, default=True, ) uuid = schema.TextLine( title=_(u'UUID'), required=False, readonly=True, )
class IListTile(IPersistentCoverTile, form.Schema): header = schema.TextLine( title=_(u'Header'), required=False, ) form.omitted('title') form.no_omit(IDefaultConfigureForm, 'title') title = schema.TextLine( title=_(u'Title'), required=False, ) form.omitted('description') form.no_omit(IDefaultConfigureForm, 'description') description = schema.Text( title=_(u'Description'), required=False, ) form.omitted('date') form.no_omit(IDefaultConfigureForm, 'date') date = schema.Datetime( title=_(u'Date'), required=False, ) form.omitted('image') form.no_omit(IDefaultConfigureForm, 'image') image = NamedImage( title=_(u'Image'), required=False, ) form.omitted('uuids') form.no_omit(IDefaultConfigureForm, 'uuids') uuids = schema.List( title=_(u'Elements'), value_type=schema.TextLine(), required=False, )