Пример #1
0
class IThemePlugin(Interface):
    """Register a named utility providing this interface to create a theme
    plugin.

    The various lifecycle methods will be called with the relevant theme
    name and a dictionary called ``settings`` which reflects any settings for
    this plugin stored in the theme's manifest.

    Plugin settings are found in a section called ``[theme:pluginname]``.

    Plugins may have dependencies. Dependent plugins are invoked after their
    dependencies. The settings of dependencies are passed to lifecycle methods
    in the variable ``dependencySetings``, which is a dictionary of
    dictionaries. The keys are plugin names, and the values equivalent to
    the ``settings`` variable for the corresponding plugin.

    If a given plugin can't be the found, an exception will be thrown during
    activation.
    """

    dependencies = schema.Tuple(
        title=_(u"Dependencies"),
        description=_(u"Plugins on which this plugin depends"),
        value_type=schema.ASCIILine(),
    )

    def onDiscovery(theme, settings, dependenciesSettings):
        """Called when the theme is discovered at startup time. This is
        not applicable for through-the-web/zip-file imported themes!
        """

    def onCreated(theme, settings, dependenciesSettings):
        """Called when the theme is created through the web (or imported
        from a zip file)
        """

    def onEnabled(theme, settings, dependenciesSettings):
        """Called when the theme is enabled through the control panel, either
        because the global "enabled" flag was switched, or because the theme
        was changed.
        """

    def onDisabled(theme, settings, dependenciesSettings):
        """Called when the given theme is disabled through the control panel,
        either because the global "enabled" flag was switched, or because the
        theme was changed.
        """

    def onRequest(request, theme, settings, dependenciesSettings):
        """Called upon traversal into the site when a theme is enabled
Пример #2
0
class IShortName(model.Schema):

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

    id = schema.ASCIILine(
        title=_(u'Short name'),
        description=_(u'This name will be displayed in the URL.'),
        required=False,
    )
    directives.write_permission(id='cmf.AddPortalContent')
Пример #3
0
class IDisclaimerSettings(model.Schema):
    """Schema for the control panel form."""

    enabled = schema.Bool(
        title=_(u'title_enabled', default=u'Enable disclaimer?'),
        description=_(
            u'help_enabled',
            default=
            u'If selected, a disclaimer will be shown the first time a user visits the site.'
        ),  # noqa: E501
        default=False,
    )

    title = schema.TextLine(
        title=_(u'title_title', default=u'Title'),
        description=_(u'help_title', default=u'A title for the disclaimer.'),
        required=False,
        defaultFactory=default_title,
    )

    # XXX: we must use Text instead of RichText as we can only store
    #      primitive Python data types in plone.app.registry
    #      see: https://community.plone.org/t/1240
    if IS_BBB:
        # BBB: remove on deprecation of Plone 4.3
        from plone.app.z3cform.wysiwyg import WysiwygFieldWidget
        form.widget('text', WysiwygFieldWidget)
    else:
        form.widget('text', klass='pat-tinymce')
    text = schema.Text(
        title=_(u'title_text', default=u'Body text'),
        description=_(u'help_text', default=u'The text of the disclaimer.'),
        required=True,
        defaultFactory=default_text,
    )

    last_modified = schema.ASCIILine(
        title=u'Last modified',
        description=u'The timestamp of last time the disclaimer was modified.',
        readonly=True,
    )

    @invariant
    def set_last_modified(data):
        """Store current timestamp on last_modified registry record.
        This invariant is used as a hook to update the timestamp, as
        its code is only executed when the form is saved.
        """
        name = IDisclaimerSettings.__identifier__ + '.last_modified'
        api.portal.set_registry_record(name, value=str(time()))
Пример #4
0
class ISugarCRMSchema(interface.Interface):
    """Combined schema for the adapter lookup.
    """

    soap_url = schema.ASCIILine(
        title=_(u'label_soap_url', default=u'SugarCRM SOAP URL'),
        description=_(
            u'help_soap_url',
            default=(u"Your SugarCRM SOAP v2 url:"
                     u"http://mysugardomain.com/service/v2/soap.php")),
        required=True,
    )

    soap_username = schema.ASCIILine(
        title=_(u'label_soap_userid', default=u"SOAP user login"),
        description=_(
            u'help_soap_username',
            default=(u"it will be used to authenticate the portal actions done"
                     u"with ISugarCRM component")),
        required=True,
    )

    soap_password = schema.Password(title=_(u'label_soap_pass',
                                            default=u'SugarCRM SOAP password'),
                                    required=False)

    activate_service = schema.Bool(title=_(u'label_activate_service',
                                           default=u'Activate WebService'),
                                   default=False,
                                   required=False)

    activate_pasplugin = schema.Bool(title=_(
        u'label_activate_pasplugin',
        default=(u'Activate PAS Plugin (Authentication,'
                 'User properties)')),
                                     default=False,
                                     required=False)
Пример #5
0
class IPloneThemingVocabularies(model.Schema):
    """Plone Theming Vocabularies."""

    available_header_options = schema.Set(
        title=_(u'Available Header Options'),
        required=False,
        default=set(),
        value_type=schema.ASCIILine(title=_(u'Option')),
    )

    available_footer_options = schema.Set(
        title=_(u'Available Footer Options'),
        required=False,
        default=set(),
        value_type=schema.ASCIILine(title=_(u'Option')),
    )

    available_color_options = schema.Set(
        title=_(u'Available Color Options'),
        required=False,
        default=set(),
        value_type=schema.ASCIILine(title=_(u'Option')),
    )

    available_pattern_options = schema.Set(
        title=_(u'Available Pattern Options'),
        required=False,
        default=set(),
        value_type=schema.ASCIILine(title=_(u'Option')),
    )

    available_layout_options = schema.Set(
        title=_(u'Available Layout Options'),
        required=False,
        default=set(),
        value_type=schema.ASCIILine(title=_(u'Option')),
    )
Пример #6
0
class ISearchResult(Interface):
    """Defines a common API for search results."""

    title = schema.TextLine(title=_(u'The title of this search result'))

    description = schema.TextLine(
        title=_(u'The description of this search result'))

    contact_email = schema.TextLine(
        title=_(u'A contact email address for this search result'))

    contact_telephone = schema.TextLine(
        title=_(u'The description of this search result'))

    portal_type = schema.TextLine(
        title=_(u'The portal type of this search result'))

    friendly_type_name = schema.TextLine(
        title=_(u'The friendly label for the type of search result'))

    highlighted_summary = schema.Text(
        title=_(u'A highlighted summary of this search result'))

    preview_image_path = schema.ASCIILine(
        title=_(u'The relative path to a preview image'
                u'representing this search result'))

    preview_image_url = schema.ASCIILine(
        title=_(u'The absolute URL for a preview image '
                u'representing search result'))

    path = schema.ASCIILine(
        title=_(u'The relative path to the content for this search result'))

    url = schema.ASCIILine(
        title=_(u'The absolute URL to the content for this search result '
                u'based on the path and the host in the current request'))
Пример #7
0
class IBundleRegistry(zope.interface.Interface):

    jscompilation = schema.ASCIILine(
        title=_(u"URL of the last js compilation"), required=False)

    csscompilation = schema.ASCIILine(
        title=_(u"URL of the last css compilation"), required=False)

    last_compilation = schema.Datetime(
        title=_(u"Last compiled date"),
        description=_(u"Date time of the last compilation of this bundle"),
        required=False)

    expression = schema.ASCIILine(
        title=_(u"Expression to render"),
        description=_(
            u"In case its a bundle we can have a condition to render it"),
        required=False)

    conditionalcomment = schema.ASCIILine(
        title=_(u"Conditional comment"),
        description=_(
            u"In case you want to render this resource on conditional comment"
        ),
        required=False)

    resources = schema.List(
        title=_(u"Loaded resources"),
        description=_(
            u"The resources that is going to be loaded on this bundle in order"
        ),
        value_type=schema.ASCIILine(title=_(u"Resource name")),
        required=False)

    enabled = schema.Bool(title=_(u"It's enabled?"),
                          default=True,
                          required=False)

    compile = schema.Bool(
        title=_(u"Does your bundle contains any RequireJS or LESS file?"),
        description=
        _(u"If its true and you modify this bundle you need to build it before production"
          ),
        default=True,
        required=False)

    depends = schema.ASCIILine(
        title=_(u"Depends on another bundle"),
        description=
        _(u"In case you want to be the last: *, in case its the first should be empty"
          ),
        required=False)

    develop_javascript = schema.Bool(title=_(u'Develop JavaScript'),
                                     default=False)

    develop_css = schema.Bool(title=_(u'Develop CSS'), default=False)
Пример #8
0
class IWorkGroup(IGroup, IMembraneGroupProperties, form.Schema):
    """The core group schema.

    Most of the plone intranet UI relies on these fields.
    """

    dexteritytextindexer.searchable('id')
    id = schema.TextLine(
        title=_(u"ID"),
        required=True,
        missing_value=u'',
    )
    canonical = schema.TextLine(
        title=_(u"Canonical Group ID (may contain spaces)"),
        required=False,
        default=u'',
        missing_value=u'',
    )
    dexteritytextindexer.searchable('title')
    title = schema.TextLine(
        title=_(u"Title"),
        required=False,
        default=u'',
        missing_value=u'',
    )
    dexteritytextindexer.searchable('description')
    description = schema.TextLine(
        title=_(u"Description"),
        required=False,
        default=u'',
        missing_value=u'',
    )
    dexteritytextindexer.searchable('mail')
    mail = schema.TextLine(
        title=_(u"Email"),
        required=False,
        default=u'',
        missing_value=u'',
    )
    members = schema.List(
        value_type=schema.ASCIILine(title=_(u'label_member_id',
                                            u'ID of a member'),
                                    required=True,
                                    default=''),
        title=_(u"Members"),
        required=False,
        default=[],
        missing_value=[],
    )
Пример #9
0
class ICoverSettings(model.Schema):
    """ Interface for the control panel form.
    """

    layouts = schema.Dict(
        title=_(u'Layouts'),
        required=True,
        key_type=schema.TextLine(title=_(u'Name')),
        value_type=schema.TextLine(title=_(u'Layout')),
        readonly=True,  # FIXME: we have no widget for this field yet
    )

    available_tiles = schema.List(
        title=_(u'Available tiles'),
        description=_(u'This tiles will be available for layout creation.'),
        required=True,
        default=DEFAULT_AVAILABLE_TILES,
        value_type=schema.Choice(vocabulary='collective.cover.EnabledTiles'),
    )

    searchable_content_types = schema.List(
        title=_(u'Searchable Content Types'),
        description=_(u'Only objects of these content types will be searched '
                      u'on the content chooser.'),
        required=False,
        default=DEFAULT_SEARCHABLE_CONTENT_TYPES,
        # we are going to list only the main content types in the widget
        value_type=schema.Choice(
            vocabulary='collective.cover.AvailableContentTypes'),
    )

    form.widget(styles='z3c.form.browser.textlines.TextLinesFieldWidget')
    styles = schema.Set(
        title=_(u'Styles'),
        description=_(
            u'Enter a list of styles to appear in the style pulldown. '
            u'Format is title|className, one per line.'),
        required=False,
        default=set(),
        value_type=schema.ASCIILine(title=_(u'CSS Classes')),
    )

    grid_system = schema.Choice(
        title=_(u'Grid System'),
        description=_(u'Choose a grid system'),
        required=True,
        default=DEFAULT_GRID_SYSTEM,
        vocabulary='collective.cover.GridSystems',
    )
Пример #10
0
class IAliasPortlet(IPortletDataProvider):
    """A portlet

    It inherits from IPortletDataProvider because for this portlet, the
    data that is being rendered and the portlet assignment itself are the
    same.
    """

    # TODO: Add any zope.schema fields here to capture portlet configuration
    # information. Alternatively, if there are no settings, leave this as an
    # empty interface - see also notes around the add form and edit form
    # below.

    path = schema.ASCIILine(title=_(u"Path"),
                                  description=_(u"Site root relative path where the other portlet is assigned. E.g. /front-page"),
                                  required=True)

    provider = schema.ASCIILine(title=_(u"Provider"),
                                  description=_(u"Portlet provider id. E.g. plone.leftcolumn or plone.rightcolumn"),
                                  required=True)

    assignmentId = schema.ASCIILine(title=_(u"Assignment name"),
                                  description=_(u"What's the portlet id of the assignment. Use @@portlet-info view to show out"),
                                  required=True)
Пример #11
0
class IDatabaseSettings(Interface):
    """ Settings to access the RDBMS """
    drivername = schema.ASCIILine(title=_(u"Driver name"),
                   description=_(u"The database driver name"),
                   default='mysql',
                   required=True)
    hostname = schema.ASCIILine(title=_(u"Host name"),
                   description=_(u"The database host name"),
                   default='localhost',
                   required=True)

    port = schema.Int(title=_(u"Port number"),
                   description=_(u"The database port number. "
                                   "Leave blank to use the default."),
                   required=False)
    username = schema.ASCIILine(title=_(u"User name"),
                   description=_(u"The database user name"),
                   required=True)
    password = schema.Password(title=_(u"Password"),
                   description=_(u"The database password"),
                   required=False)
    database = schema.ASCIILine(title=_(u"Database name"),
                   description=_(u"The name of the database on this server"),
                   required=True)
Пример #12
0
class IRandomQuote(IPortletDataProvider):
    """ Interface for random quote portlet """
    header = schema.TextLine(title=_("Portlet header"),
                             description=_("Title of the rendered portlet"),
                             required=True)

    footer = schema.TextLine(title=_("Portlet footer"),
                             description=_("Text to be shown in the footer"),
                             required=False)

    more_url = schema.ASCIILine(title=_("Details link"),
                                description=_(
                                    "If given, the header and footer "
                                    "will link to this URL."),
                                required=False)
Пример #13
0
class IIterateSettings(Interface):

    enable_checkout_workflow = schema.Bool(
        title=_(u'Enable checkout workflow'),
        description=u'',
        default=False,
        required=False
    )

    checkout_workflow_policy = schema.ASCIILine(
        title=_(u'Checkout workflow policy'),
        description=u'',
        default='checkout_workflow_policy',
        required=True
    )
Пример #14
0
class ILazySizesSettings(model.Schema):

    """Schema for the control panel form."""

    form.widget('css_class_blacklist', cols=25, rows=10)
    css_class_blacklist = schema.Set(
        title=_(u'CSS class blacklist'),
        description=_(
            u'A list of CSS class identifiers that will not be processed for lazy loading. '
            u'<img> and <iframe> elements with that class directly applied to them, or to a parent element, will be skipped.'
        ),
        required=False,
        default=set([]),
        value_type=schema.ASCIILine(title=_(u'CSS class')),
    )
Пример #15
0
class IOEmbedSettings(interface.Interface):
    """Client server side is named consumer"""

    embedly_apikey = schema.ASCIILine(title=_(u'embedlykey'), required=False)

    activate_jqueryoembed_integration = schema.Bool(
        title=i18n.jqueryoembed_integration,
        description=i18n.jqueryoembed_integration_desc,
        default=True)

    #configuration for jquery.oembed javascript
    embedMethod = schema.Choice(title=_(u'embedMethod'),
                                description=_(u'embedMethod_description'),
                                vocabulary=vocabulary.embedMethods,
                                default=u'replace')

    defaultOEmbedProvider = schema.ASCIILine(title=_(u'defaultOEmbedProvider'),
                                             default="plone")

    allowedProviders = schema.List(
        title=_(u'allowedProviders'),
        value_type=schema.ASCIILine(title=_(u'provider')),
        default=[],
        required=False)

    disallowedProviders = schema.List(
        title=_(u'disallowedProviders'),
        value_type=schema.ASCIILine(title=_(u'provider')),
        default=[],
        required=False)

    customProviders = schema.List(
        title=_(u'customProviders'),
        value_type=schema.ASCIILine(title=_(u'provider')),
        default=[],
        required=False)
Пример #16
0
class IInterfaceAwareRecord(Interface):
    """A record will be marked with this interface if it knows which
    interface its field came from.
    """

    interfaceName = schema.DottedName(title=u"Dotted name to interface")

    interface = schema.Object(
        title=u"Interface that provided the record",
        description=u"May be None if the interface is no longer available",
        schema=IInterface,
        readonly=True)

    fieldName = schema.ASCIILine(
        title=u"Name of the field in the original interface")
class ITypeSettings(Interface):
    """ Define the fields for the content type add form
    """
    title = schema.TextLine(
        title=_(u'Type Name'),
    )

    id = schema.ASCIILine(
        title=_(u'Short Name'),
        description=_(u'Used for programmatic access to the type.'),
        required=True,
        constraint=isValidId,
    )

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

    container = schema.Bool(
        title=_(u'Container'),
        description=_(
            u'Items of this type will be able to contain other items.'),
        required=True,
        default=False,
    )

    filter_content_types = schema.Choice(
        title=_(u'Filter Contained Types'),
        description=_(
            'label_filter_contained_types',
            default=(
                u'Items of this type can act as a folder containing other '
                u' items. What content types should be allowed inside?')
        ),
        values=('none', 'all', 'some'),
        default='none',
        required=True
    )

    allowed_content_types = schema.Set(
        title=_(u'Allowed Content Types'),
        required=False,
        value_type=schema.Choice(
            vocabulary='plone.app.vocabularies.ReallyUserFriendlyTypes',
            required=False
        )
    )
Пример #18
0
class IAdvancedSearchPortlet(search.ISearchPortlet):
    """ A portlet displaying a (live) search box
    """

    searchTitle = schema.ASCIILine(
        title=_(u"Search Title"),
        description=_(u"Sets the title of the search box."),
        required=True,
        default="Search")

    objectToSearch = schema.Choice(
        title=_(u"Target area to search"),
        description=_(
            u"Find the content item in which you only want to search in"),
        required=True,
        source=SearchableTextSourceBinder({}, default_query='path:'))
Пример #19
0
class IUserDataSchema(Interface):
    """
    """

    fullname = schema.TextLine(
        title=_(u'label_full_name', default=u'Full Name'),
        description=_(u'help_full_name_creation',
                      default=u"Enter full name, e.g. John Smith."),
        required=False)

    email = schema.ASCIILine(title=_(u'label_email', default=u'E-mail'),
                             description=u'',
                             required=True,
                             constraint=checkEmailAddress)

    home_page = schema.TextLine(
        title=_(u'label_homepage', default=u'Home page'),
        description=_(u'help_homepage',
                      default=u"The URL for your external home page, "
                      "if you have one."),
        required=False)

    description = schema.Text(
        title=_(u'label_biography', default=u'Biography'),
        description=_(u'help_biography',
                      default=u"A short overview of who you are and what you "
                      "do. Will be displayed on your author page, linked "
                      "from the items you create."),
        required=False)

    location = schema.TextLine(title=_(u'label_location', default=u'Location'),
                               description=_(
                                   u'help_location',
                                   default=u"Your location - either city and "
                                   "country - or in a company setting, where "
                                   "your office is located."),
                               required=False)

    portrait = NamedBlobImage(
        title=_(u'label_portrait', default=u'Portrait'),
        description=_(
            u'help_portrait',
            default=u'To add or change the portrait: click the "Browse" '
            u'button; select a picture of yourself. Recommended '
            u'image size is 75 pixels wide by 100 pixels tall.'),
        required=False)
    form.widget(portrait='plone.app.users.schema.PortraitFieldWidget')
Пример #20
0
class ICommonFileOperations(Interface):
    """Common file operations used by IRawReadFile and IRawWriteFile
    """

    mimeType = schema.ASCIILine(
        title=u"File MIME type",
        description=u"Provided if it makes sense for this file data" +
        u"May be set prior to writing data to a file that " +
        u"is writeable. It is an error to set this on a " +
        u"file that is not writable.",
        readonly=True,
    )

    encoding = schema.Bool(
        title=u"The encoding that this file uses",
        description=u"Provided if it makes sense for this file data" +
        u"May be set prior to writing data to a file that " +
        u"is writeable. It is an error to set this on a " +
        u"file that is not writable.",
        required=False,
    )

    closed = schema.Bool(
        title=u"Is the file closed?",
        required=True,
    )

    name = schema.TextLine(
        title=u"A representative file name",
        description=u"Provided if it makes sense for this file data" +
        u"May be set prior to writing data to a file that " +
        u"is writeable. It is an error to set this on a " +
        u"file that is not writable.",
        required=False,
    )

    def seek(offset, whence=None):
        """Seek the file. See Python documentation for ``file`` for
        details.
        """

    def tell():
        """Return the file's current position.
        """

    def close():
        """Close the file. See Python documentation for ``file`` for
Пример #21
0
class IIndexesValueField(Interface):
    index_title = schema.ASCIILine(
        title=_("sitesearch_index_title", default=u"Index title"),
        description=_(
            "sitesearch_index_title_help",
            default=u"Insert a title for this search filter. You can provide translations for this title with a proper translation file for rer.sitesearch domain.",
        ),
        required=True,
    )
    index = schema.Choice(
        title=_(
            "sitesearch_allowable", default=u"Allowable indexes in catalog"
        ),
        description=_("sitesearch_allowable_help", default=u'Select an index.'),
        required=True,
        vocabulary=u"rer.sitesearch.vocabularies.IndexesVocabulary",
    )
Пример #22
0
class IBanner(form.Schema):
    """A content type representing a banner."""

    image = NamedBlobImage(
        title=_(u'Image'),
        description=_(u''),
        required=True,
    )

    remote_url = schema.ASCIILine(
        title=_(u'URL'),
        description=_(
            u'Must be an absolute URL. Valid schemes are http and https only.'
        ),
        required=True,
        constraint=is_valid_url,
    )
Пример #23
0
class ILoggerAction(Interface):
    """Interface for the configurable aspects of a logger action.

    This is also used to create add and edit forms, below.
    """

    targetLogger = schema.ASCIILine(title=_(u'Logger name'),
                                    default='Plone')

    loggingLevel = schema.Int(title=_(u'Logging level'),
                              default=20) # INFO

    message = schema.TextLine(title=_(u"Message"),
                              description=_('help_contentrules_logger_message',
                                            default=u"&e = the triggering event, &c = the context, &u = the user"),
                              default=_('text_contentrules_logger_message',
                                        default=u"Caught &e at &c by &u"))
Пример #24
0
class IConfirmPhoneForm(Interface):

    email = schema.ASCIILine(
        title=u'E-mail',
        description=u'',
        required=True,
        constraint=checkEmailAddress)

    phone_number = schema.TextLine(
        title=u'Phone number',
        description=u'Change number and click re-send to use a different number',
        constraint=check_phone_number)

    phone_number_code = schema.TextLine(
        title=u'Code',
        description=u'Code that was texted to your phone',
        required=False)
Пример #25
0
class IPersistentField(IField):
    """A field that can be persistent along with a record.

    We provide our own implementation of the basic field types that are
    supported by the registry.

    A persistent field may track which interface and field it originally
    was constructed from. This is done by the registerInterface() method
    on the IRegistry, for example. Only the interface/field names are stored,
    not actual object references.
    """

    interfaceName = schema.DottedName(
        title=u"Dotted name to an interface the field was constructed from",
        required=False)
    fieldName = schema.ASCIILine(
        title=u"Name of the field in the original interface, if any",
        required=False)
Пример #26
0
class ITabsValueField(Interface):
    tab_title = schema.ASCIILine(
        title=_("sitesearch_tab_title", default=u"Tab title"),
        description=_(
            "sitesearch_tab_title_help",
            default=u"Insert a title for this tab. You can provide translations for this title with a proper translation file for rer.sitesearch domain.",
        ),
        required=True,
    )
    portal_types = schema.Tuple(
        title=_("sitesearch_tab_portal_types", default=u"Portal types"),
        description=_(
            "sitesearch_tab_portal_types_help",
            default=u'Select which portal_types shows on this tab.',
        ),
        required=True,
        value_type=FOLDER_TYPES_VALUESTYPE,
    )
Пример #27
0
class IContact(model.Schema):
    name = schema.TextLine(title=_("label_your_name", default="Your name"),
                           required=True)
    directives.widget(name="plonetheme.nuplone.browser.contact.TextSpan7")

    email = schema.ASCIILine(title=_("label_email", default="Email address"),
                             required=True)
    directives.widget(email="plonetheme.nuplone.browser.contact.TextSpan7")

    subject = schema.TextLine(title=_("label_subject", default="Subject"),
                              required=True)
    directives.widget(subject="plonetheme.nuplone.browser.contact.TextSpan7")

    message = schema.Text(title=_("label_contact_text",
                                  default="Your message"),
                          required=True)
    directives.widget(
        message="plonetheme.nuplone.browser.contact.TextLines4Rows")
Пример #28
0
class IVLibrasNews(model.Schema):
    """VLibras News behavior. Read-only field to store the address of
    the video containing the LIBRAS translation of an item. A `None`
    value indicates content that was present before the installation
    of the feature; this content has no translation available. An empty
    string indicates content being processed.
    """

    translation_url = schema.ASCIILine(
        title=_(u'Video URL'),
        description=
        _(u'The URL of the video containing the LIBRAS translation for this item.'
          ),
        required=False,
        readonly=True,
        default='',  # translation being processed
        missing_value=None,  # no translation available
    )
class IExternalLogin(form.Schema):

    disable_external_login_url = schema.Bool(
        title=_(u'Embed external login on the default login page'),
        description=_(u'If enabled, then all external login will be embed '
                      u'on the login form page.'),
        required=True,
        default=False,
    )

    external_login_urls = schema.List(
        title=_(u'List external login urls'),
        description=_(u'If external login is not disable then the first '
                      u'external login url will be used.'),
        required=False,
        default=[u'authomatic-handler'],
        missing_value=[],
        value_type=schema.ASCIILine())
Пример #30
0
class RegisterFormSchema(register_information.RegisterInformationFormSchema):
    """Form used by user to register."""
    directives.order_after(
        login='******',
        password='******',
        password_confirm='password',
    )
    login = schema.ASCIILine(
        title=_(u'Login')
    )
    directives.widget('password', PasswordFieldWidget)
    password = schema.TextLine(
        title=_(u'Password')
    )
    directives.widget('password_confirm', PasswordFieldWidget)
    password_confirm = schema.TextLine(
        title=_(u'Confirm the password')
    )