Beispiel #1
0
class IVeeTemplate(model.Schema):

    title = schema.TextLine(title=u'Template title')

    authors = schema.TextLine(title=u'Template Authors')

    purpose = schema.Text(title=u'Template Purpose')

    left_column_width = schema.Int(title=u'Width of left column in pixels',
                                   default=400)

    vee_width = schema.Int(title=u'Width of left column in pixels',
                           default=160)

    right_column_width = schema.Int(title=u'Width of left column in pixels',
                                    default=400)

    form.fieldset(
        "fonts",
        label=u"Font sizes for contents of...",
        fields=['top_font', 'top2_font', 'top3_font', 'sections_font'])
    top_font = schema.Choice(title=u'Top font',
                             vocabulary=FONT_SIZES,
                             default='large')
    top2_font = schema.Choice(title=u'Top2 font',
                              vocabulary=FONT_SIZES,
                              default='normal')
    top3_font = schema.Choice(title=u'Top3 font',
                              vocabulary=FONT_SIZES,
                              default='normal')
    sections_font = schema.Choice(title=u'All other sections font size',
                                  vocabulary=FONT_SIZES,
                                  default='normal')

    form.fieldset('assessmentsetup',
                  label='Assessment setup',
                  fields=[
                      'min_allowable_score', 'max_allowable_score',
                      'assessment_schema'
                  ])
    min_allowable_score = schema.Int(title=u'Min allowable score', default=0)
    max_allowable_score = schema.Int(title=u'Max allowable score', default=10)
    general_help = RichText(
        title=u'General help for authors',
        description=u'General help for authors (adjust to highlight specific '
        u'learning goals for writing in this ResearchVee')
    assessment_schema = RichText(title=u'Assessment schema for authors',
                                 description=u'adjust as needed')

    form.widget(main_content_table=DataGridFieldFactory)
    main_content_table = schema.List(title=u'Main content table',
                                     default=[],
                                     value_type=DictRow(title=u"Field",
                                                        schema=IVeeContent))
Beispiel #2
0
class IPlotlySettings(form.Schema):
    """Adds settings to medialog.controlpanel
    """

    form.fieldset(
        'plotly',
        label=_(u'Plotly'),
        fields=[
             'plotly_username',
             'plotly_api_key'
        ],
     )
    
    plotly_username = schema.TextLine(
        title = _("label_plotly_username", default=u"Plotly Username"),
        description = _("help_plotly",
                      default="Your Plotly ID"),

    )

    plotly_api_key = schema.TextLine(
        title = _("label_plotly_api_key", default=u"Plotly API key"),
        description = _("help_plotly_api",
                      default="Your Plotly API key"),

    )
Beispiel #3
0
class IOGMail(form.Schema):
    """Opengever specific behavior,
    which add a title Field to the form.
    """

    form.fieldset(
        u'common',
        label=base_mf(u'fieldset_common', u'Common'),
        fields=[u'title', 'original_message', 'message_source'])

    form.order_before(title='message')
    dexteritytextindexer.searchable('title')
    title = schema.TextLine(
        title=dossier_mf(u'label_title', default=u'Title'),
        required=False,
    )

    form.mode(original_message=DISPLAY_MODE)
    form.read_permission(original_message='cmf.ManagePortal')
    form.write_permission(original_message='cmf.ManagePortal')
    original_message = field.NamedBlobFile(
        title=_(u'label_original_message',
                default=u'Raw *.msg message before conversion'),
        required=False,
    )

    form.mode(message_source=DISPLAY_MODE)
    form.read_permission(message_source='cmf.ManagePortal')
    form.write_permission(message_source='cmf.ManagePortal')
    message_source = schema.Choice(
        title=_('label_message_source',
                default='Message source'),
        vocabulary=get_message_source_vocabulary(),
        required=False,
    )
Beispiel #4
0
class IDocumentSchema(form.Schema):
    """Document Schema Interface."""

    form.fieldset(
        u'common',
        label=_(u'fieldset_common', u'Common'),
        fields=[
            u'title',
            u'file',
        ],
    )

    dexteritytextindexer.searchable('title')
    form_directives.order_before(title='IDocumentMetadata.description')
    title = schema.TextLine(title=_(u'label_title', default=u'Title'),
                            required=False)

    form.primary('file')
    form_directives.order_after(file='IDocumentMetadata.document_author')
    file = field.NamedBlobFile(
        title=_(u'label_file', default='File'),
        description=_(u'help_file', default=''),
        required=False,
    )

    @invariant
    def title_or_file_required(data):
        if not data.title and not data.file:
            raise Invalid(
                _(u'error_title_or_file_required',
                  default=u'Either the title or the file is '
                  'required.'))
class ISliderImage(form.Schema, ISliderFieldsEnabled):
    """
       Marker/Form interface for Slider Image
    """
    form.fieldset('settings',
        label=_pad('Settings'),
        fields=['slider_image', 'slider_title', 'slider_description']
    )

    slider_image = namedfile.NamedBlobImage(
        title=_(u'slider_image_label', default=u'Slider Image'),
        description=_(
            u'slider_image_description', 
            default=u'Upload slider image'),
        required=False
    )

    slider_title = schema.TextLine(
        title=_(u'slider_title_label', default=u'Slider Title'),
        description=_(u'slider_title_description', 
            default=(u'If set, the slider will use this title instead'
                    ' of the content title')
        ),
        required=False
    )

    slider_description = schema.TextLine(
        title=_(u'slider_description_label', default=u'Slider Description'),
        description=_(u'slider_description_description',
            default=(u'If set, the slider will use this description instead'
                    ' of the content description'),
        ),
        required=False
    )
class IDXCustomIcon(model.Schema, ICustomIcon):
    """Dexterity behavior for custom icons
    """

    iconimage = namedfile.NamedBlobImage(
        title=_(u"Icon Image"),

        description=_(u"You can upload an icon image. This image will be"
                    u" used as the icon for the content."),

        required=False,
    )

    iconpool = schema.Choice(
        title=_(u"Icon Pool"),

        description=_(u"You can select an icon from the pool. This image"
                    u" will be used as the icon for the content."),

        vocabulary=u"customicons.vocabulary",

        required=False,

    )
    form.fieldset('settings', fields=['iconimage', 'iconpool'])
class FrontpageSlideSchema(form.Schema):
    form.fieldset(
        "default",
        label=u"Item Description",
        fields=[
            "title",
            "long_description",
            "category",
            "read_more_link",
        ],
    )

    title = TextLine(title=(u"Title"),
                     description=u"Item Name (250 character limit)",
                     required=True)

    long_description = RichText(
        title=(u"Description"),
        description=u"Provide a description of the "
        u"item.(5,000 character limit)",
        required=True,
    )

    category = TextLine(
        title=(u"Category"),
        description=u"Slider thumbnail title. "
        u"Keep it short (25 character limit)",
        required=True,
    )

    read_more_link = TextLine(title=u"Read more link", required=False)
Beispiel #8
0
class INamedDataSequence(form.Schema, IDataSeries, ISeriesDisplay):
    """Named category seqeuence with embedded data stored as content"""

    form.fieldset(
        'display',
        label=u"Display settings",
        fields=[
            'color',
            'show_trend',
            'trend_width',
            'trend_color',
            'display_precision',
            'point_labels',
        ],
    )

    input = schema.Text(
        title=_(u'Data input'),
        description=_(u'Comma-separated records, one per line '
                      u'(name, numeric value, [note], [URL]). '
                      u'Note and URL are optional.'),
        default=u'',
        required=False,
    )

    # data field to store CSV source:
    form.omitted('data')
    data = schema.List(
        title=_(u'Data'),
        description=_(u'Data points for series: name, value; values are '
                      u'either whole/integer or decimal numbers.'),
        value_type=schema.Object(schema=INamedDataPoint, ),
        readonly=True,
    )
class INewsitemviewSettings(form.Schema):
    """Adds settings to medialog.controlpanel
    """

    form.fieldset(
        'newsitemview',
        label=_(u'Newsitemview Settings'),
        fields=[
            'default_folderimagesize',
            'default_newsitemsize',
            'default_hideimages',
        ],
    )

    default_folderimagesize = schema.Choice(
        title=_(u"default_folderimagesize",
                default=u"Default Folderimage Size"),
        vocabulary='medialog.newsitemview.ImageSizeVocabulary',
        required=True,
        description=_(u"help_default_folderimagesize",
                      default=u"Set default size for Folderimage"))

    default_newsitemsize = schema.Choice(
        required=True,
        vocabulary='medialog.newsitemview.ImageSizeVocabulary',
        title=_(u"default_newsimagesize", default=u"Default Newsimage Size"),
        description=_(u"help_default_newsimagesize",
                      default=u"Set default size for Newsimage"))

    default_hideimages = schema.Bool(
        title=_(u"default_hideimages",
                default=u"Hide images in folder view by default"),
        description=_(u"help_default_hideimages",
                      default=u"Set if images should be hidden folder view"))
Beispiel #10
0
class IRelatedDocuments(form.Schema):
    """The relatedDocument behvavior is a opengever.document
    specific relateditems behavior. Only allows opengever.documents
    """

    relatedItems = RelationList(
        title=_(u'label_related_documents', default=u'Related Documents'),
        default=[],
        value_type=RelationChoice(
            title=u"Related",
            source=RepositoryPathSourceBinder(
                portal_type=("opengever.document.document", "ftw.mail.mail"),
                navigation_tree_query={
                    'object_provides': [
                        'opengever.repository.repositoryroot.IRepositoryRoot',
                        'opengever.repository.repositoryfolder.' +
                        'IRepositoryFolderSchema',
                        'opengever.dossier.behaviors.dossier.IDossierMarker',
                        'opengever.document.document.IDocumentSchema',
                        'ftw.mail.mail.IMail',
                    ]
                }),
        ),
        required=False,
    )

    form.fieldset(
        u'common',
        label=_(u'fieldset_common', default=u'Common'),
        fields=[
            u'relatedItems',
        ],
    )
Beispiel #11
0
class IProvidePasswords(form.Schema):
    """Add password fields"""

    # Putting this in a separate fieldset for the moment:
    form.fieldset('membership', label=_(u"Membership"),
                  fields=['password', 'confirm_password'])

    # Note that the passwords fields are not required; this means we
    # can add members without having to add passwords at that time.
    # The password reset tool should hopefully be able to deal with
    # that.
    password = schema.Password(
        title=_(u"Password"),
        required=False,
    )

    confirm_password = schema.Password(
        title=_(u"Confirm Password"),
        required=False,
    )

    @invariant
    def password_matches_confirmation(data):
        """password field must match confirm_password field.
        """
        password = getattr(data, 'password', None)
        confirm_password = getattr(data, 'confirm_password', None)
        if (password or confirm_password) and (password != confirm_password):
            raise Invalid(_(u"The password and confirmation do not match."))

    form.omitted('password', 'confirm_password')
    form.no_omit(IAddForm, 'password', 'confirm_password')
Beispiel #12
0
class IPriced(form.Schema):
    """ Add a price list to a content object
    """

    form.fieldset(
            'pricing',
            label=u'Pricing',
            fields=('enabled', 'price', 'pricelist'),
        )
    enabled = schema.Bool(
        title=u'Enabled',
        description=u'Enable pricing for this item',
        default=False,
        required=False,
    )
    form.widget(pricelist=DataGridFieldFactory)
    pricelist = PriceListField(
        title=u"Price list",
        value_type=schema.Object(title=u"Price", schema=INamedPriceSchema),
        missing_value=NO_PRICELIST,
    )

    @zif.invariant
    def priceMustBeSetIfEnabled(data):
        if data.enabled and not data.pricelist:
            raise zif.Invalid(
                _(u"At least one price must be set in order for pricing to be enabled."))
Beispiel #13
0
class ICollectiveMultiThemeSettings(form.Schema):
    """Adds settings to medialog.controlpanel"""

    form.fieldset('Multitheme',
                  label=_(u'Multitheme'),
                  fields=[
                      'style', 'rules', 'fullwidth', 'load_css', 'color1',
                      'color2', 'color3'
                  ])

    style = schema.Choice(
        title=_(u'Style'),
        values=[
            'blue', 'booster', 'dutchblue', 'ploneconf', 'red', 'scheme1',
            'spot', 'greyish'
        ],
        required=True,
    )

    rules = schema.Choice(
        title=_(u"Layout Rules"),
        values=['default', 'spot', 'head'],
        required=True,
    )

    fullwidth = schema.Bool(
        title=_(u"Mosaic Full width?"),
        required=False,
    )

    load_css = schema.Bool(
        title=_(u"Load CSS? Put it in your theme and disable it here"),
        required=False,
        default=True,
    )

    color1 = schema.TextLine(
        title=_("color1", default=u"Custom Color 1"),
        required=True,
        description=_("help_color", default="Choose Color"),
    )

    color2 = schema.TextLine(
        title=_("color2", default=u"Custom Color 2"),
        required=True,
        description=_("help_color", default="Choose Color"),
    )

    color3 = schema.TextLine(
        title=_("color3", default=u"Custom Color 3"),
        required=True,
        description=_("help_color", default="Choose Color"),
    )

    form.widget(
        color1=ColorPickerFieldWidget,
        color2=ColorPickerFieldWidget,
        color3=ColorPickerFieldWidget,
    )
class IProvidePasswords(IProvidePasswordsSchema):
    """Add password fields"""

    # Putting this in a separate fieldset for the moment:
    form.fieldset('membership', label=_(u"Membership"),
                  fields=['password', 'confirm_password'])

    form.omitted('password', 'confirm_password')
    form.no_omit(IAddForm, 'password', 'confirm_password')
class IHTMLImageCacheableFromContent(model.Schema,
                                     interfaces.IHTMLImageCacheable):

    form.fieldset(
        'image-caching',
        label=_(u'Image caching'),
        fields=('save_images_locally', ),
    )

    form.omitted('html')
Beispiel #16
0
class IExhibicion(form.Schema):
    """A conference program. Programs can contain Sessions.
    """
    form.fieldset(
        'responsables',
        u"Responsables",
        fields=['curador', 'integrantes'],
    )
    cuerpo = RichText(
        title=_(u"Texto principal"),
        required=False,
    )
    bgCabezalHome = NamedBlobImage(
        title=_(u"Imagen Home"),
        description=
        u"Imagen de fondo que se utiliza en la home. Para componerla utilice los ejemplos del banco de imagenes",
        required=False,
    )
    bgCabezalVista = NamedBlobImage(
        title=_(u"Imagen de la vista"),
        description=
        u"Imagen de fondo que se utiliza en la pagina de la exhibición propiamente dicha. Si desea componer una nueva, utilice los ejemplos del banco de imagenes",
        required=False,
    )
    bgCabezalLista = NamedBlobImage(
        title=_(u"Imagen para el listado exhibiciones"),
        description=
        u"Imagen de fondo que se utiliza en el listado de exhibiciones. Si desea componer una nueva, utilice los ejemplos del banco de imagenes",
        required=False,
    )
    baner = NamedBlobImage(
        title=_(u"Imagen para baner"),
        description=
        u"Imagen completa del baner que se muestra en la vista de coleccion. Si desea componer uno nuevo, puede utilizar los ejemplos del banco de imágenes",
        required=False,
    )

    curador = schema.List(title=_(u"Curadores"),
                          value_type=schema.Choice(source=grupoPot),
                          required=False)

    integrantes = schema.List(
        title=_(u"Integrantes"),
        description=u"Listado de personas que colaboran con esta exhibición",
        value_type=schema.Choice(source=grupoPot),
        required=False)
    directives.widget(coleccionR=AutocompleteFieldWidget)
    coleccionR = RelationChoice(
        title=u"Colección Relacionada",
        description=u"Colección a la que pertenece esta exhibicón",
        source=ObjPathSourceBinder(portal_type="arcas.coleccion"),
        required=False,
    )
Beispiel #17
0
class ICoreHumanRightsInstruments(form.Schema):
    """
       Marker/Form interface for Core Human Rights Instruments
    """

    # -*- Your Zope schema definitions here ... -*-
    form.fieldset('categorization', fields=['pardocs_core_hr'])
    pardocs_core_hr = schema.List(
        title=_(u'Core International Human Rights Instruments'),
        value_type=schema.Choice(
            vocabulary='ploneun.vocabulary.core_human_rights', ),
        required=False,
    )
Beispiel #18
0
class IFrenchRisk(IRisk, IFrenchEvaluation):
    form.fieldset("evaluation",
                  label=_("header_evaluation", default=u"Evaluation"),
                  description=_(
                      "intro_evaluation",
                      default=u"You can specify how the risks priority is "
                      u"evaluated. For more details see the online "
                      u"manual."),
                  fields=[
                      "type", "risk_always_present", "evaluation_method",
                      "fixed_priority", "default_priority", "default_severity",
                      "default_frequency"
                  ])
Beispiel #19
0
class ISocial(form.Schema):

    form.fieldset(
            'social',
            label=u'Social',
            fields=('lanyrd',),
        )

    lanyrd = schema.URI(
            title=u"Lanyrd-link",
            description=u"Add URL",
            required=False,
        )
Beispiel #20
0
class IFilingNumber(form.Schema):

    form.fieldset(
        u'filing',
        label=_(u'fieldset_filing', default=u'Filing'),
        fields=['filing_no'],
    )

    form.omitted('filing_no')
    filing_no = schema.TextLine(
        title=_(u'filing_no', default="Filing number"),
        required=False,
    )
Beispiel #21
0
class IPayPal(form.Schema):

    form.fieldset('paypal',
                  label=_(u'Paypal'),
                  fields=[
                      'paypal_type', 'paypal_email', 'paypal_currency',
                      'paypal_itemname', 'paypal_itemnumber', 'paypal_amount',
                      'paypal_shipping', 'paypal_tax'
                  ])

    paypal_type = schema.Choice(
        title=_(u'Button Type'),
        values=['donation', 'buynow'],
        required=False,
    )

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

    paypal_currency = schema.Choice(title=_(u'Currency'),
                                    values=CURRENCIES,
                                    required=False,
                                    default='USD')

    paypal_itemname = schema.TextLine(title=_(u'Item Name / Organization'),
                                      required=False)

    paypal_itemnumber = schema.TextLine(title=_(u'Item Number / Donation ID'),
                                        required=False)

    paypal_amount = schema.Float(
        title=_(u'Amount'),
        description=
        _(u'Enter the amount. Set to -1 to allow user to enter their own amount'
          ),
        required=False,
        default=0.0)

    paypal_shipping = schema.Float(
        title=_(u'Shipping'),
        description=_(u'Enter the shipping amount. Not needed for donation'),
        required=False,
        default=0.0)

    paypal_tax = schema.Float(
        title=_(u'Tax'),
        description=_(u'Enter the tax rate in %. Not needed for donation'),
        required=False,
        default=0.0)
Beispiel #22
0
class ICategories(form.Schema):
    """
       Marker/Form interface for Categories
    """

    # -*- Your Zope schema definitions here ... -*-
    form.fieldset('categorization', fields=['pardocs_categories'])
    pardocs_categories = schema.List(
            title = _(u'Categories'),
            value_type = schema.Choice(
                vocabulary = "sinar.pardocs.categories",
                ),
            required=False,
            )
class IResponsibleOrgUnit(form.Schema):

    form.fieldset(
        u'common',
        label=_(u'fieldset_common', default=u'Common'),
        fields=['responsible_org_unit'],
    )

    responsible_org_unit = schema.TextLine(
        title=_(u'responsible_org_unit',
                default=u'Responsible organisation unit'),
        description=u'',
        max_length=UNIT_ID_LENGTH,
        required=False,
    )
Beispiel #24
0
class IColecGroupName(form.Schema):
    """Add tags to content
    """
    form.fieldset(
        'responsables',
        u"Responsables",
        fields=['groupName'],
    )
    groupName = schema.TextLine(
        title=_(u"Nombre del grupo"),
        description=
        _(u"La coleccion tiene asociado un grupo de usuarios, este campo define el nombre de dicho grupo"
          ),
        required=False,
        default=u"sinNombre")
Beispiel #25
0
class IInbox(form.Schema, ITabbedviewUploadable):
    """ Inbox for OpenGever
    """

    form.fieldset(
        u'common',
        label=_(u'fieldset_common', default=u'Common'),
        fields=[u'inbox_group', ],
    )

    inbox_group = schema.TextLine(
        title=_(u'label_inbox_group', default=u'Inbox Group'),
        description=_(u'help_inbox_group', default=u''),
        required=False,
    )
Beispiel #26
0
class IReferenceNumberPrefix(form.Schema):

    form.fieldset(
        u'common',
        label=_(u'fieldset_common', default=u'Common'),
        fields=[
            u'reference_number_prefix',
        ],
    )

    reference_number_prefix = schema.TextLine(
        title=_(u'label_reference_number_prefix', default=u'Reference Prefix'),
        required=False,
        defaultFactory=reference_number_prefix_default,
    )
class IDossierTemplateSchema(form.Schema):
    """Schema interface for dossier template types.

    Use this type of dossier to create a reusable template structures.
    """

    form.fieldset(
        u'common',
        label=base_mf(u'fieldset_common', default=u'Common'),
        fields=[
            u'title_help',
            u'predefined_keywords',
            u'restrict_keywords',
        ],
    )

    title_help = schema.TextLine(
        title=_(u'label_title_help', default=u'Title help'),
        description=_(u'help_title_help',
                      default=u'Recommendation for the title. Will be '
                      u'displayed as a help text if you create '
                      u'a dossier from template'),
        required=False,
    )

    form.order_after(predefined_keywords='IDossierTemplate.keywords')
    predefined_keywords = schema.Bool(
        title=_(u'label_predefined_keywords', default=u'Predefined Keywords'),
        description=_(u'description_predefined_keywords',
                      default=u'The defined keywords will be preselected for '
                      u'new dossies from template.'),
        required=False,
        missing_value=True,
        default=True,
    )

    form.order_after(restrict_keywords='predefined_keywords')
    restrict_keywords = schema.Bool(
        title=_(u'label_restrict_keywords', default=u'Restrict Keywords'),
        description=_(
            u'description_restrict_keywords',
            default=u'The user can choose only from the defined keywords '
            u'in a new dossier from template. It also prevents '
            u'the user for creating new keywords'),
        required=False,
        missing_value=False,
        default=False,
    )
Beispiel #28
0
class IAttendee(model.Schema):
    """A conference attendee.
    """

    title = schema.TextLine(
        title=_(u"Full name"),
    )

    # Simple choice based on uuid.
    form.widget(program=ContentTreeFieldWidget)
    program = schema.Choice(
        title=_(u"Chosen Program"),
        source=UUIDSourceBinder(portal_type='example.conference.program'),
        required=False,
        )

    # Multiple choice.
    form.widget(sessions=MultiContentTreeFieldWidget)
    sessions = schema.List(
        title=_(u"Sessions you wish to attend"),
        value_type=schema.Choice(
            title=_(u"Selection"),
            source=UUIDSourceBinder(portal_type='example.conference.session')),
        required=False,
        )

    # Data grid
    if DataGridFieldFactory is not None:
        form.widget(presenters=DataGridFieldFactory)
    presenters = schema.List(
        title=_(u'Questions for presenters'),
        description=_(u"Write down a question for a presenter."),
        value_type=DictRow(title=_(u'Presenters'), schema=IPresenterInfo),
        required=False,
       )

    # Another data grid, this time we will put it in a fieldset.
    form.fieldset('remarks', label=_(u"Remarks"), fields=['remarkables'])
    if DataGridFieldFactory is not None:
        form.widget(remarkables=DataGridFieldFactory)
    remarkables = schema.List(
        title=_(u'Remarkable content'),
        description=_(u"Select a remarkable piece of content on this site "
                      u"and add a remark about it. Fine for reporting "
                      u"typos as well."),
        value_type=DictRow(title=_(u'Remarkable'), schema=IRemarkable),
        required=False,
        )
Beispiel #29
0
class ITags(form.Schema):
    """Add tags to content
    """

    form.fieldset(
        'categorization',
        label=_(u'Categorization'),
        fields=('tags', ),
    )

    tags = Tags(
        title=_(u"Tags"),
        description=_(u"Applicable tags"),
        required=False,
        allow_uncommon=True,
    )
Beispiel #30
0
class IMustRead(form.Schema):
    """MustRead schema
    """

    form.fieldset(
        'settings',
        label=_(u'Settings'),
        fields=('mustread', ),
    )

    mustread = Bool(
        title=_(u"Must read"),
        description=_(u"""Mark the content as "Must read" for all users."""),
        default=False,
        required=False,
    )