예제 #1
0
class IMeeting(Interface):
    """ Meeting """
    text = RichText(
        title=_(u"Body text"),
        required=True,
    )

    meeting_type = schema.Choice(
        title=_(u"Meeting type"),
        vocabulary=meeting_types,
        required=True,
    )

    allow_register = schema.Bool(
        title=_(u"Allow users to register for the meeting"),
        required=True,
    )

    allow_register_above_max = schema.Bool(
        title=_(u"Continue to allow registration when maximum number of"
                " participants is reached"),
        required=True,
    )

    allow_register_start = schema.Datetime(
        title=_(u"From"),
        description=_(u"Allow registration starting with this datetime."),
        required=False,
        min=datetime.datetime(2018, 1, 1),
        max=datetime.datetime(datetime.datetime.now().year + 10, 12, 31)
    )

    allow_register_end = schema.Datetime(
        title=_(u"To"),
        description=_(u"Allow registration until this datetime."),
        required=False,
        min=datetime.datetime(2018, 1, 1),
        max=datetime.datetime(datetime.datetime.now().year + 10, 12, 31)
    )

    need_e_pass = schema.Bool(
        title=_(u"E-pass is required"),
        required=True,
    )

    is_unlisted = schema.Bool(
        title=_(u"Make this event unlisted"),
        required=True,
    )

    restrict_content_access = schema.Bool(
        title=_(u"Hide the content of Additional materials table for not "
                "registered users"),
        required=True
    )

    auto_approve = schema.Bool(
        title=_(u"Automatically approve registrations"),
        required=True,
    )

    max_participants = schema.Int(
        title=_(u"Maximum number of subscribers"),
        required=True,
    )

    hosting_organisation = schema.TextLine(
        title=_(u"Supporting organisations"),
        required=True,
        default=None,
    )

    contact_name = schema.TextLine(
        title=_(u"Contact name"),
        required=True,
    )

    contact_email = schema.TextLine(
        title=_(u"Contact email"),
        required=True,
        constraint=validate_email
    )

    location = schema.TextLine(
        title=_(
            u'label_event_location',
            default=u'Event location'
        ),
        description=_(
            u'help_event_location',
            default=u'Location of the event.'
        ),
        required=False,
        default=None
    )

    agenda = NamedBlobFile(
        title=_(u"Event agenda"),
        description=_(u"Upload your agenda file."),
        required=False,
    )

    event_timezone = schema.TextLine(
        title=_(u"Event timezone info"),
        description=_(u"Human readable info about timezone for this event."),
        required=False,
        default=_(u"Time zone: Copenhagen, Denmark"),
    )

    @invariant
    def validate_location_required(data):
        if data.meeting_type != 'webinar' and data.location is None:
            raise Invalid(_(
                u"Event location input is missing." +
                " This field is not required only in " +
                "'Meeting type: webinar' case."))
예제 #2
0
class IHinweistext(model.Schema):
    """ Marker interface and Dexterity Python Schema for Hinweistext
    """
    hinweis = RichText(title=u"Hinweistext")
예제 #3
0
class IAccount(model.Schema):
    """
    Account Content Type
    """

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

    type = schema.Choice(
        title=_(u'Account Type'),
        vocabulary=ACCOUNT_TYPES,
        required=False,
        default=u'customer',
    )

    logo = NamedBlobImage(
        title=_(u'Company Logo'),
        description=_(u'Please upload an image'),
        required=False,
    )

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

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

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

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

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

    project_reference = schema.TextLine(
        title=_(u'Project Reference'),
        description=_(u'A link to a Trac or Redmine project.'),
        required=False,
    )

    # Address

    form.fieldset('address',
                  label=_(u'Address'),
                  fields=[
                      'address',
                      'zip',
                      'city',
                  ])

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

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

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

    # Billing

    form.fieldset('billing',
                  label=_(u'Billing'),
                  fields=[
                      'billing_email',
                      'billing_contact',
                  ])

    billing_email = schema.TextLine(
        title=_(u'Billing E-Mail'),
        required=False,
    )

    billing_contact = RelationChoice(
        title=_(u'Billing Contact'),
        source=CatalogSource(portal_type='Contact'),
        required=False,
    )

    # Notes

    form.fieldset('notes', label=_(u'Notes'), fields=[
        'text',
    ])

    text = RichText(
        title=_(u'Notes'),
        required=False,
    )
예제 #4
0
class IPlaylist(model.Schema):
    """ Marker interfce and Dexterity Python Schema for Playlist
    """

    copyright = RichText(title=_(u'Copyright'), default=u'', required=False)
예제 #5
0
class IOrganisationBase(model.Schema):

    title = schema.TextLine(title=_(u"Company / Organisation name"))

    organisation_type = schema.Choice(
        title=_(u"Organisation type"),
        vocabulary=vocabularies.organisation_types,
    )
    directives.languageindependent('organisation_type')
    formdirectives.widget('organisation_type', NonMissingSelectWidget)

    street = schema.TextLine(title=_(u"Address"),
                             description=_(u"Street or PO-box"))
    directives.languageindependent('street')

    address_extra = schema.TextLine(
        title=_(u"Address extra"),
        required=False,
    )
    directives.languageindependent('address_extra')

    city = schema.TextLine(title=_(u"City"), )
    directives.languageindependent('city')

    zip_code = schema.TextLine(title=_(u"Zip code"), )
    directives.languageindependent('zip_code')

    country = schema.Choice(
        title=_(u"Country"),
        vocabulary=vocabularies.countries,
    )
    directives.languageindependent('country')

    email = schema.TextLine(
        title=_(u"General email address"),
        constraint=isEmail,
    )
    directives.languageindependent('email')

    phone = schema.TextLine(title=_(u"General telephone number"), )
    directives.languageindependent('phone')

    fax = schema.TextLine(
        required=False,
        title=_(u"General fax number"),
    )
    directives.languageindependent('fax')

    # Organisation's contact person

    key_name = schema.TextLine(
        description=_(u"Name/Surname of main contact person for the Campaign"),
        title=_(u"Contact person"),
    )
    directives.languageindependent('key_name')

    key_email = schema.TextLine(
        title=_(u"Email address of main contact person."),
        constraint=isEmailAvailable,
    )
    directives.languageindependent('key_email')

    key_phone = schema.TextLine(
        title=_(u"Telephone number of main contact person."),
        required=False,
    )
    directives.languageindependent('key_phone')

    # Organisation's website

    url = schema.URI(
        title=_(u"Home page"),
        description=_("Organisation's website"),
        constraint=isNonEmptyURI,
    )
    directives.languageindependent('url')

    campaign_url = schema.URI(
        title=_(u"Dedicated Campaign Website"),
        description=_(
            u'Special web section dealing with issues related to occupational '
            'health and safety'),
        constraint=isNonEmptyURI,
        required=False,
    )
    directives.languageindependent('campaign_url')

    campaign_pledge = RichText(
        title=_(
            u"How does your organisation plan to contribute to making this "
            u"Campaign a joint success? (your Campaign pledge)"),
        description=_(
            u"Please summarise briefly the support that you will provide "
            u"described under STEP 2 of this application form (max. 150 "
            u"words)."),
    )
    directives.languageindependent('campaign_pledge')
    formdirectives.omitted('campaign_pledge')

    mission_statement = schema.Text(
        title=_(u"Your mission statement"),
        description=_(u"Briefly outline the mission of your company"),
    )
    directives.languageindependent('mission_statement')
    formdirectives.omitted('mission_statement')

    logo = NamedBlobImage(
        title=_(u"Company / Organisation logo"),
        description=_(
            u"Please add an image with the company / organisation logo. "
            u"Please use a format suited for web display if possible (JPEG, "
            u"PNG or GIF)."),
        constraint=isImage,
    )
    directives.languageindependent('logo')
    formdirectives.omitted('logo')
    formdirectives.no_omit(IEditForm, 'logo')

    ceo_image = NamedBlobImage(
        title=_(u"Photo of your CEO, President, General Director or other"),
        constraint=isImage,
    )
    directives.languageindependent('ceo_image')
    formdirectives.omitted('ceo_image')
class IConferenceSpeaker(model.Schema):
    """A conference speaker or leader of a workshop. Speaker can be added anywhere.
    """

    lastname = schema.TextLine(
        title=_(safe_unicode('Last name')),
        required=True,
    )

    firstname = schema.TextLine(
        title=_(safe_unicode('First name')),
        required=True,
    )

    street = schema.TextLine(
        title=_(safe_unicode('Street')),
        description=_(
            safe_unicode(
                'For those requiring visa, please add your full postal address details'
            )),
        required=False,
    )

    city = schema.TextLine(
        title=_(safe_unicode('City')),
        description=_(
            safe_unicode(
                'For those requiring visa, please add your full postal address details'
            )),
        required=False,
    )

    postalcode = schema.TextLine(
        title=_(safe_unicode('Postal Code')),
        description=_(
            safe_unicode(
                'For those requiring visa, please add your full postal address details'
            )),
        required=False,
    )

    country = schema.TextLine(
        title=_(safe_unicode('Country')),
        description=_(
            safe_unicode(
                'For those requiring visa, please add your full postal address details'
            )),
        required=False,
    )

    email = schema.ASCIILine(
        title=_(safe_unicode('Your email address')),
        constraint=validateEmail,
        required=True,
    )

    telephonenumber = schema.TextLine(
        title=_(safe_unicode('Telephone Number')),
        description=_(
            safe_unicode(
                'Please fill in your telephone number so that we could get in contact with you by phone if necessary.'
            )),
        constraint=validatePhoneNumber,
        required=False,
    )
    mobiletelepone = schema.TextLine(
        title=_(safe_unicode('Mobile Telephone Number')),
        description=_(
            safe_unicode(
                'Please fill in your mobile telephone number so that we could get in contact with you '
                'during the conference.')),
        constraint=validatePhoneNumber,
        required=True,
    )

    organisation = schema.TextLine(
        title=_(safe_unicode('Organisation')),
        required=False,
    )

    description = schema.Text(
        title=_(safe_unicode('A short bio')),
        required=True,
    )

    bio = RichText(
        title=_(safe_unicode('Bio')),
        required=False,
    )

    directives.mode(speakerpicture='display')
    speakerpicture = schema.TextLine(
        title=_(
            safe_unicode(
                'The following file extensions are allowed for the picture '
                'files (upper case and lower case and mix of both):')),
        defaultFactory=allowedconferenceimageextensions,
    )

    picture = NamedBlobImage(
        title=_(safe_unicode('Picture')),
        description=_(safe_unicode('Please upload an image')),
        constraint=validateimagefileextension,
        required=False,
    )
예제 #7
0
class IEGovServiceSchema(model.Schema):
    """ Marker interface and Dexterity Python Schema for EGovService
    """
    # Copy IBasic behavior to change description title to 'description'!
    title = schema.TextLine(
        title=DXMF(u'label_title', default=u'Title'),
        required=True
    )

    description = schema.Text(
        title=DXMF(u'label_description', default=u'Description'),
        description=DXMF(
            u'help_description',
            default=u'Used in item listings and search results.'
        ),
        required=False,
        missing_value=u'',
    )

    form.order_before(description='*')
    form.order_before(title='*')

    form.omitted('title', 'description')
    form.no_omit(IEditForm, 'title', 'description')
    form.no_omit(IAddForm, 'title', 'description')

    summary = RichText(
        title=_(u'summary', default=u'Summary'),
        required=False
    )

    generalinformation = RichText(
        title=_(u'generalinformation'),
        required=False
    )

    precondition = RichText(
        title=_(u'precondition'),
        required=False
    )

    procedure = RichText(
        title=_(u'procedure'),
        required=False
    )

    forms = RichText(
        title=_(u'forms'),
        required=False
    )

    requireddocuments = RichText(
        title=_(u'requireddocuments'),
        required=False
    )

    result = RichText(
        title=_(u'result'),
        required=False
    )

    cost = RichText(
        title=_(u'cost'),
        required=False
    )

    legalbases = RichText(
        title=_(u'legalbases'),
        required=False
    )

    additionalinformation = RichText(
        title=_(u'additionalinformation'),
        required=False
    )

    annotations = RichText(
        title=_(u'annotations'),
        required=False
    )

    address = RichText(
        title=_(u'address'),
        required=False,
    )

    form.widget(orgunit=ReferenceWidgetFactory)
    orgunit = RelationChoice(
        title=_(u'orgunit', default=u'OrgUnit'),
        required=False,
        source=ReferenceObjSourceBinder(
            selectable_class=FilterByPathSelectable),
        default=None,
    )
예제 #8
0
class IIncident(model.Schema, IImageScaleTraversable):
    """
    Incident Report
    """

    summary = RichText(title=_(u'Detailed Summary'),
                       description=_(u'Detailed Summary of the incident'),
                       required=True,
                       default=u'''
            <h3>Impact</h3>
            <p>
            Describe the impact of this incident
            </p>
            <h3>Solution</h3>
            <p>Solution or workaround to this issue</p>
            <h3>References</h3>
            <p>
            Additional links to other relevant information
            </p>
            <h3>Credit</h3>
            <p>Reported by whom?</p>
            ''')

    incident_date = schema.Date(title=_(u'Incident Date'), )

    violation_type = schema.Choice(
        title=_(u'Type of Violation'),
        values=['Censorship', 'Takedown'],
    )

    form.widget('media_type', SelectFieldWidget)
    media_type = schema.List(
        title=_(u'Media Type'),
        value_type=schema.Choice(
            values=['Article', 'News', 'Video', 'Audio', 'Photo'], ),
    )

    form.widget('offense_type', SelectFieldWidget)
    offense_type = schema.List(
        title=_(u'Type of Offence'),
        value_type=schema.Choice(values=[
            'Sedition',
            'National Security',
            'Fraud',
            'Copyright',
            'Defamation',
            'Gaming/Betting',
            'Threats to life/property',
            'Hacking',
        ]),
    )

    #Law
    form.widget('national_law', SelectFieldWidget)
    national_law = schema.List(
        title=_(u'National Laws'),
        value_type=schema.Choice(vocabulary='sinar.digimon.malaysian_acts', ),
    )

    form.widget('enforcement_agency', SelectFieldWidget)
    enforcement_agency = schema.List(
        title=_(u'Enforcement Agency'),
        value_type=schema.Choice(
            vocabulary='sinar.digimon.enforcement_agencies'),
    )

    form.widget('sector_type', SelectFieldWidget)
    sector_type = schema.List(
        title=_('Sector Type'),
        value_type=schema.Choice(values=[
            'Academia',
            'Media',
            'Private Sector',
            'Government',
            'Civil Society',
            'Public',
        ]),
    )
예제 #9
0
class IDXTestDocumentSchema(model.Schema):

    # zope.schema fields
    test_ascii_field = schema.ASCII(required=False)
    test_asciiline_field = schema.ASCIILine(required=False)
    test_bool_field = schema.Bool(required=False)
    test_bytes_field = schema.Bytes(required=False)
    test_bytesline_field = schema.BytesLine(required=False)
    test_choice_field = schema.Choice(values=[u"foo", u"bar"], required=False)
    test_choice_field_with_vocabulary = schema.Choice(
        vocabulary=SimpleVocabulary([
            SimpleTerm(u"value1", "token1", u"title1"),
            SimpleTerm(u"value2", "token2", u"title2"),
        ]),
        required=False,
    )

    test_choice_with_non_iterable_source = schema.Choice(
        required=False, source=my_non_iterable_source)
    test_choice_with_source = schema.Choice(required=False,
                                            source=my_iterable_source)
    test_choice_with_context_source = schema.Choice(
        required=False, source=my_context_source_binder)
    test_choice_with_querysource = schema.Choice(required=False,
                                                 source=my_querysource)
    test_choice_with_context_querysource = schema.Choice(
        required=False, source=my_context_querysource_binder)

    test_date_field = schema.Date(required=False)
    test_datetime_field = schema.Datetime(required=False)
    test_datetime_tz_field = schema.Datetime(
        required=False,
        defaultFactory=lambda: timezone("Europe/Zurich").localize(
            datetime(2017, 10, 31, 10, 0)),
    )
    test_decimal_field = schema.Decimal(required=False)
    test_dict_field = schema.Dict(required=False)
    test_float_field = schema.Float(required=False)
    test_frozenset_field = schema.FrozenSet(required=False)
    test_int_field = schema.Int(required=False)
    test_list_field = schema.List(required=False)
    test_list_field_with_choice_with_vocabulary = schema.List(
        value_type=schema.Choice(vocabulary=SimpleVocabulary([
            SimpleTerm(u"value1", "token1", u"title1"),
            SimpleTerm(u"value2", "token2", u"title2"),
            SimpleTerm(u"value3", "token3", u"title3"),
        ])),
        required=False,
    )
    test_set_field = schema.Set(required=False)
    test_set_field_with_choice_with_vocabulary = schema.Set(
        value_type=schema.Choice(vocabulary=SimpleVocabulary([
            SimpleTerm(u"value1", "token1", u"title1"),
            SimpleTerm(u"value2", "token2", u"title2"),
            SimpleTerm(u"value3", "token3", u"title3"),
        ])),
        required=False,
    )
    test_text_field = schema.Text(required=False)
    test_textline_field = schema.TextLine(required=False)
    test_time_field = schema.Time(required=False)
    test_timedelta_field = schema.Timedelta(required=False)
    test_tuple_field = schema.Tuple(required=False)
    test_nested_list_field = schema.List(required=False,
                                         value_type=schema.Tuple())
    test_nested_dict_field = schema.Dict(required=False,
                                         key_type=schema.ASCIILine(),
                                         value_type=schema.Tuple())
    test_list_choice_with_context_vocabulary_field = schema.List(
        title=u"Field",
        value_type=schema.Choice(
            vocabulary="plone.restapi.testing.context_vocabulary"),
        required=False,
    )

    # plone.app.textfield
    test_richtext_field = RichText(
        required=False, allowed_mime_types=["text/html", "text/plain"])

    # plone.namedfile fields
    test_namedfile_field = namedfile.NamedFile(required=False)
    test_namedimage_field = namedfile.NamedImage(required=False)
    test_namedblobfile_field = namedfile.NamedBlobFile(required=False)
    test_namedblobimage_field = namedfile.NamedBlobImage(required=False)

    primary('test_primary_namedfile_field')
    test_primary_namedfile_field = namedfile.NamedFile(required=False)

    # z3c.relationfield
    test_relationchoice_field = RelationChoice(
        required=False, source=CatalogSource(id=["doc1", "doc2"]))
    test_relationlist_field = RelationList(
        required=False,
        value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"),
    )

    # Test fields for validation
    test_required_field = schema.TextLine(required=True)
    test_readonly_field = schema.TextLine(required=False, readonly=True)
    test_maxlength_field = schema.TextLine(required=False, max_length=10)
    test_constraint_field = schema.TextLine(required=False,
                                            constraint=lambda x: u"00" in x)
    test_datetime_min_field = schema.Datetime(required=False,
                                              min=datetime(2000, 1, 1))
    test_time_min_field = schema.Time(required=False, min=time(1))
    test_timedelta_min_field = schema.Timedelta(required=False,
                                                min=timedelta(100))
    test_list_value_type_field = schema.List(required=False,
                                             value_type=schema.Int())
    test_dict_key_type_field = schema.Dict(required=False,
                                           key_type=schema.Int())

    read_permission(test_read_permission_field="cmf.ManagePortal")
    test_read_permission_field = schema.TextLine(required=False)
    write_permission(test_write_permission_field="cmf.ManagePortal")
    test_write_permission_field = schema.TextLine(required=False)

    read_permission(test_read_permission_field="cmf.ManagePortal")
    test_read_permission_field = schema.TextLine(required=False)

    test_invariant_field1 = schema.TextLine(required=False)
    test_invariant_field2 = schema.TextLine(required=False)

    test_missing_value_field = schema.TextLine(required=False,
                                               missing_value=u"missing",
                                               default=u"default")

    test_missing_value_required_field = schema.TextLine(
        required=True, missing_value=u"missing", default=u"some value")

    @invariant
    def validate_same_value(data):
        if data.test_invariant_field1 != data.test_invariant_field2:
            raise Invalid(u"Must have same values")

    # Test fields with default values
    test_default_value_field = schema.TextLine(required=True,
                                               default=u"Default")

    @provider(IContextAwareDefaultFactory)
    def default_factory(context):
        return u"DefaultFactory"

    test_default_factory_field = schema.TextLine(
        required=True, defaultFactory=default_factory)
예제 #10
0
class IColeccion(form.Schema):
    """Esquema básico de la colección. 
       En behaviors se implementan la customización de las columnas"""

    form.fieldset(
        'responsables',
        u"Responsables",
        fields=['coordinador', 'integrantes'],
    )
    form.fieldset(
        'imagenes',
        u"Ilustraciones",
        fields=[
            'imagenCabecera', 'textoAltCabecera', 'imagenHome', 'imagenLista'
        ],
    )

    tipoColeccion = schema.Choice(
        title=u"Categoría",
        description=
        u"Elija una categoría a la que responde esta Colección. Si la categoría no existe debe pedirle al administrador que genere una nueva.",
        source="arcas.Categorias",
    )
    cuerpo = RichText(
        title=_(u"Texto principal"),
        required=False,
    )

    directives.read_permission(coordinador='arcas.defineCurador')
    directives.write_permission(coordinador='arcas.defineCurador')
    coordinador = schema.List(
        title=_("Coordinador"),
        value_type=schema.Choice(source="arcas.CoorMembersVocab", ),
        required=False,
    )
    integrantes = schema.List(
        title=_("Integrantes"),
        value_type=schema.Choice(source="arcas.InvestMembersVocab", ),
        required=False,
    )
    imagenCabecera = NamedBlobImage(
        title=_(u"Imagen cabezal"),
        description=
        _(u"Esta imagen se usa como cabezal en la visualización de la coleccion"
          ),
        required=False,
    )
    textoAltCabecera = schema.TextLine(
        title=u"ALT Imagen cebecera",
        description=
        _(u"Si la imagen de cabecera posee información de copyright, debe escribirse en este campo. Se desplegará la información al pasar el puntero sobre la imagen."
          ),
        required=False,
    )
    imagenHome = NamedBlobImage(
        title=_(u"Imagen para la Portada"),
        description=_(u"Esta imagen se usa en la página principal"),
        required=False,
    )

    imagenLista = NamedBlobImage(
        title=_(u"Imagen listado"),
        description=_("Esta imagen se usa en el listado de colecciones"),
        required=False,
    )

    GS_ID = schema.TextLine(
        title=u"ID de la colección",
        description=
        _(u"Nombre de la colección en GS3. Se requiere para hacer las busquedas"
          ),
        required=True,
    )
    altNavegarFuente = schema.Text(
        title=_(u"Navegar Fuente"),
        description=
        _(u"Escriba aquì una descripción para el botón Navegar Fuente, que permita al usuario comprender mejor como está organizada la colección."
          ),
        required=False,
    )
예제 #11
0
class IMailer(IAction):
    """A form action adapter that will e-mail form input."""

    directives.write_permission(recipient_name=config.EDIT_ADDRESSING_PERMISSION)
    directives.read_permission(recipient_name=MODIFY_PORTAL_CONTENT)
    recipient_name = zope.schema.TextLine(
        title=_(
            u"label_formmailer_recipient_fullname", default=u"Recipient's full name"
        ),
        description=_(
            u"help_formmailer_recipient_fullname",
            default=u"The full name of the recipient of the mailed form.",
        ),
        default=u"",
        missing_value=u"",
        required=False,
    )

    directives.write_permission(recipient_email=config.EDIT_ADDRESSING_PERMISSION)
    directives.read_permission(recipient_email=MODIFY_PORTAL_CONTENT)
    recipient_email = Email(
        title=_(
            u"label_formmailer_recipient_email", default=u"Recipient's e-mail address"
        ),
        description=_(
            u"help_formmailer_recipient_email",
            default=u"The recipients e-mail address.",
        ),
        required=False,
    )
    fieldset(
        u"addressing",
        label=_("Addressing"),
        fields=["to_field", "cc_recipients", "bcc_recipients", "replyto_field"],
    )
    directives.write_permission(to_field=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(to_field=MODIFY_PORTAL_CONTENT)
    to_field = zope.schema.Choice(
        title=_(u"label_formmailer_to_extract", default=u"Extract Recipient From"),
        description=_(
            u"help_formmailer_to_extract",
            default=u"Choose a form field from which you wish to extract "
            u"input for the To header. If you choose anything other "
            u'than "None", this will override the "Recipient\'s " '
            u"e-mail address setting above. Be very cautious about "
            u"allowing unguarded user input for this purpose.",
        ),
        required=False,
        vocabulary="easyform.Fields",
    )

    directives.write_permission(cc_recipients=config.EDIT_ADDRESSING_PERMISSION)
    directives.read_permission(cc_recipients=MODIFY_PORTAL_CONTENT)
    cc_recipients = zope.schema.Text(
        title=_(u"label_formmailer_cc_recipients", default=u"CC Recipients"),
        description=_(
            u"help_formmailer_cc_recipients",
            default=u"E-mail addresses which receive a carbon copy.",
        ),
        default=u"",
        missing_value=u"",
        required=False,
    )

    directives.write_permission(bcc_recipients=config.EDIT_ADDRESSING_PERMISSION)
    directives.read_permission(bcc_recipients=MODIFY_PORTAL_CONTENT)
    bcc_recipients = zope.schema.Text(
        title=_(u"label_formmailer_bcc_recipients", default=u"BCC Recipients"),
        description=_(
            u"help_formmailer_bcc_recipients",
            default=u"E-mail addresses which receive a blind carbon copy.",
        ),
        default=u"",
        missing_value=u"",
        required=False,
    )

    directives.write_permission(replyto_field=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(replyto_field=MODIFY_PORTAL_CONTENT)
    replyto_field = zope.schema.Choice(
        title=_(u"label_formmailer_replyto_extract", default=u"Extract Reply-To From"),
        description=_(
            u"help_formmailer_replyto_extract",
            default=u"Choose a form field from which you wish to extract "
            u"input for the Reply-To header. NOTE: You should "
            u"activate e-mail address verification for the "
            u"designated field.",
        ),
        required=False,
        vocabulary="easyform.Fields",
    )
    fieldset(
        u"message",
        label=PMF("Message"),
        fields=[
            "msg_subject",
            "subject_field",
            "body_pre",
            "body_post",
            "body_footer",
            "showAll",
            "showFields",
            "includeEmpties",
            "sendCSV",
            "sendXML",
        ],
    )
    directives.read_permission(msg_subject=MODIFY_PORTAL_CONTENT)
    msg_subject = zope.schema.TextLine(
        title=_(u"label_formmailer_subject", default=u"Subject"),
        description=_(
            u"help_formmailer_subject",
            default=u""
            u"Subject line of message. This is used if you "
            u"do not specify a subject field or if the field "
            u"is empty.",
        ),
        default=u"Form Submission",
        missing_value=u"",
        required=False,
    )

    directives.write_permission(subject_field=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(subject_field=MODIFY_PORTAL_CONTENT)
    subject_field = zope.schema.Choice(
        title=_(u"label_formmailer_subject_extract", default=u"Extract Subject From"),
        description=_(
            u"help_formmailer_subject_extract",
            default=u""
            u"Choose a form field from which you wish to extract "
            u"input for the mail subject line.",
        ),
        required=False,
        vocabulary="easyform.Fields",
    )
    directives.read_permission(body_pre=MODIFY_PORTAL_CONTENT)
    directives.widget("body_pre", TextAreaWidget)

    body_pre = RichText(
        title=_(u"label_formmailer_body_pre", default=u"Body (prepended)"),
        description=_(
            u"help_formmailer_body_pre",
            default=u"Text prepended to fields listed in mail-body",
        ),
        default=u"",
        missing_value=u"",
        default_mime_type="text/x-web-intelligent",
        allowed_mime_types=("text/x-web-intelligent",),
        output_mime_type="text/x-html-safe",
        required=False,
    )
    directives.read_permission(body_post=MODIFY_PORTAL_CONTENT)
    directives.widget("body_post", TextAreaWidget)
    body_post = RichText(
        title=_(u"label_formmailer_body_post", default=u"Body (appended)"),
        description=_(
            u"help_formmailer_body_post",
            default=u"Text appended to fields listed in mail-body",
        ),
        default=u"",
        missing_value=u"",
        default_mime_type="text/x-web-intelligent",
        allowed_mime_types=("text/x-web-intelligent",),
        output_mime_type="text/x-html-safe",
        required=False,
    )
    directives.read_permission(body_footer=MODIFY_PORTAL_CONTENT)
    directives.widget("body_footer", TextAreaWidget)
    body_footer = RichText(
        title=_(u"label_formmailer_body_footer", default=u"Body (signature)"),
        description=_(
            u"help_formmailer_body_footer",
            default=u"Text used as the footer at "
            u"bottom, delimited from the body by a dashed line.",
        ),
        default=u"",
        missing_value=u"",
        default_mime_type="text/x-web-intelligent",
        allowed_mime_types=("text/x-web-intelligent",),
        output_mime_type="text/x-html-safe",
        required=False,
    )

    directives.read_permission(showAll=MODIFY_PORTAL_CONTENT)
    showAll = zope.schema.Bool(
        title=_(u"label_mailallfields_text", default=u"Include All Fields"),
        description=_(
            u"help_mailallfields_text",
            default=u""
            u"Check this to include input for all fields "
            u"(except label and file fields). If you check "
            u"this, the choices in the pick box below "
            u"will be ignored.",
        ),
        default=True,
        required=False,
    )

    directives.read_permission(showFields=MODIFY_PORTAL_CONTENT)
    showFields = zope.schema.List(
        title=_(u"label_mailfields_text", default=u"Show Responses"),
        description=_(
            u"help_mailfields_text",
            default=u"Pick the fields whose inputs you'd like to include in "
            u"the e-mail.",
        ),
        unique=True,
        required=False,
        value_type=zope.schema.Choice(vocabulary="easyform.Fields"),
    )

    directives.read_permission(includeEmpties=MODIFY_PORTAL_CONTENT)
    includeEmpties = zope.schema.Bool(
        title=_(u"label_mailEmpties_text", default=u"Include Empties"),
        description=_(
            u"help_mailEmpties_text",
            default=u""
            u"Check this to include titles "
            u"for fields that received no input. Uncheck "
            u"to leave fields with no input out of the e-mail.",
        ),
        default=True,
        required=False,
    )

    directives.read_permission(sendCSV=MODIFY_PORTAL_CONTENT)
    sendCSV = zope.schema.Bool(
        title=_(u"label_sendCSV_text", default=u"Send CSV data attachment"),
        description=_(
            u"help_sendCSV_text",
            default=u""
            u"Check this to send a CSV file "
            u"attachment containing the values "
            u"filled out in the form.",
        ),
        default=False,
        required=False,
    )

    directives.read_permission(sendXML=MODIFY_PORTAL_CONTENT)
    sendXML = zope.schema.Bool(
        title=_(u"label_sendXML_text", default=u"Send XML data attachment"),
        description=_(
            u"help_sendXML_text",
            default=u""
            u"Check this to send an XML file "
            u"attachment containing the values "
            u"filled out in the form.",
        ),
        default=False,
        required=False,
    )

    fieldset(u"template", label=PMF("Template"), fields=["body_pt", "body_type"])
    directives.write_permission(body_pt=config.EDIT_TALES_PERMISSION)
    directives.read_permission(body_pt=MODIFY_PORTAL_CONTENT)
    body_pt = zope.schema.Text(
        title=_(u"label_formmailer_body_pt", default=u"Mail-Body Template"),
        description=_(
            u"help_formmailer_body_pt",
            default=u"This is a Zope Page Template used for rendering of "
            u"the mail-body. You don't need to modify it, but if you "
            u"know TAL (Zope's Template Attribute Language) have "
            u"the full power to customize your outgoing mails.",
        ),
        defaultFactory=default_mail_body,
        missing_value=u"",
    )

    directives.write_permission(body_type=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(body_type=MODIFY_PORTAL_CONTENT)
    body_type = zope.schema.Choice(
        title=_(u"label_formmailer_body_type", default=u"Mail Format"),
        description=_(
            u"help_formmailer_body_type",
            default=u"Set the mime-type of the mail-body. Change this "
            u"setting only if you know exactly what you are doing. "
            u"Leave it blank for default behaviour.",
        ),
        default=u"html",
        vocabulary="easyform.MimeList",
    )
    fieldset(
        u"headers", label=_("Headers"), fields=["xinfo_headers", "additional_headers"]
    )
    directives.widget(xinfo_headers=CheckBoxFieldWidget)
    directives.write_permission(xinfo_headers=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(xinfo_headers=MODIFY_PORTAL_CONTENT)
    xinfo_headers = zope.schema.List(
        title=_(u"label_xinfo_headers_text", default=u"HTTP Headers"),
        description=_(
            u"help_xinfo_headers_text",
            default=u""
            u"Pick any items from the HTTP headers that "
            u"you'd like to insert as X- headers in the message.",
        ),
        unique=True,
        required=False,
        default=[u"HTTP_X_FORWARDED_FOR", u"REMOTE_ADDR", u"PATH_INFO"],
        missing_value=[u"HTTP_X_FORWARDED_FOR", u"REMOTE_ADDR", u"PATH_INFO"],
        value_type=zope.schema.Choice(vocabulary="easyform.XinfoHeaders"),
    )
    directives.write_permission(additional_headers=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(additional_headers=MODIFY_PORTAL_CONTENT)
    additional_headers = zope.schema.List(
        title=_(u"label_formmailer_additional_headers", default=u"Additional Headers"),
        description=_(
            u"help_formmailer_additional_headers",
            default=u"Additional e-mail-header lines. Only use "
            u"RFC822-compliant headers.",
        ),
        unique=True,
        required=False,
        value_type=zope.schema.TextLine(
            title=_(
                u"extra_header", default=u"${name} Header", mapping={u"name": u"HTTP"}
            )
        ),
    )

    fieldset(
        u"overrides",
        label=_("Overrides"),
        fields=[
            "subjectOverride",
            "senderOverride",
            "recipientOverride",
            "ccOverride",
            "bccOverride",
        ],
    )

    directives.write_permission(subjectOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(subjectOverride=MODIFY_PORTAL_CONTENT)
    subjectOverride = zope.schema.TextLine(
        title=_(u"label_subject_override_text", default=u"Subject Expression"),
        description=_(
            u"help_subject_override_text",
            default=u"A TALES expression that will be evaluated to override "
            u"any value otherwise entered for the e-mail subject "
            u"header. Leave empty if unneeded. Your expression "
            u"should evaluate as a string. PLEASE NOTE: errors in "
            u"the evaluation of this expression will cause an error "
            u"on form display.",
        ),
        required=False,
        default=u"",
        missing_value=u"",
        constraint=isTALES,
    )

    directives.write_permission(senderOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(senderOverride=MODIFY_PORTAL_CONTENT)
    senderOverride = zope.schema.TextLine(
        title=_(u"label_sender_override_text", default=u"Sender Expression"),
        description=_(
            u"help_sender_override_text",
            default=u"A TALES expression that will be evaluated to override "
            u'the "From" header. Leave empty if unneeded. '
            u"Your expression should evaluate as a string. "
            u"PLEASE NOTE: errors in the evaluation of this "
            u"expression will cause an error on form display.",
        ),
        required=False,
        default=u"",
        missing_value=u"",
        constraint=isTALES,
    )

    directives.write_permission(recipientOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(recipientOverride=MODIFY_PORTAL_CONTENT)
    recipientOverride = zope.schema.TextLine(
        title=_(u"label_recipient_override_text", default=u"Recipient Expression"),
        description=_(
            u"help_recipient_override_text",
            default=u"A TALES expression that will be evaluated to override "
            u"any value otherwise entered for the recipient "
            u"e-mail address. You are strongly cautioned against using"
            u"unvalidated data from the request for this purpose. "
            u"Leave empty if unneeded. Your expression should "
            u"evaluate as a string. PLEASE NOTE: errors in the "
            u"evaluation of this expression will cause "
            u"an error on form display.",
        ),
        required=False,
        default=u"",
        missing_value=u"",
        constraint=isTALES,
    )

    directives.write_permission(ccOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(ccOverride=MODIFY_PORTAL_CONTENT)
    ccOverride = zope.schema.TextLine(
        title=_(u"label_cc_override_text", default=u"CC Expression"),
        description=_(
            u"help_cc_override_text",
            default=u"A TALES expression that will be evaluated to override "
            u"any value otherwise entered for the CC list. You are "
            u"strongly cautioned against using unvalidated data from "
            u"the request for this purpose. Leave empty if unneeded. "
            u"Your expression should evaluate as a sequence of "
            u"strings. PLEASE NOTE: errors in the evaluation of this "
            u"expression will cause an error on form display.",
        ),
        required=False,
        default=u"",
        missing_value=u"",
        constraint=isTALES,
    )

    directives.write_permission(bccOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(bccOverride=MODIFY_PORTAL_CONTENT)
    bccOverride = zope.schema.TextLine(
        title=_(u"label_bcc_override_text", default=u"BCC Expression"),
        description=_(
            u"help_bcc_override_text",
            default=u"A TALES expression that will be evaluated to override "
            u"any value otherwise entered for the BCC list. "
            u"You are strongly cautioned against using "
            u"unvalidated data from the request for this purpose. "
            u"Leave empty if unneeded. Your expression should "
            u"evaluate as a sequence of strings. PLEASE NOTE: errors "
            u"in the evaluation of this expression will cause "
            u"an error on form display.",
        ),
        required=False,
        default=u"",
        missing_value=u"",
        constraint=isTALES,
    )
예제 #12
0
 class IMyDexterityItem(Interface):
     text = RichText(title=u'Text')
예제 #13
0
class IISAWPublication(form.Schema):
    short_title = TextLine(title=_(u'Short Title'))
    form.order_after(short_title='IBibliographicItem.title')

    tag_line = TextLine(title=_(u'Tag Line'), required=False)
    form.order_after(tag_line='IBibliographicItem.description')

    authors = Tuple(
        title=_(u'Authors'),
        description=_(u'Enter username or plain-text name, one per line'),
        value_type=TextLine(),
        required=False,
        missing_value=(),
    )
    form.order_before(authors='IBibliographicItem.citation_detail')

    editors = Tuple(
        title=_(u'Editors'),
        description=_(u'Enter username or plain-text name, one per line'),
        value_type=TextLine(),
        required=False,
        missing_value=(),
    )
    form.order_before(editors='IBibliographicItem.citation_detail')

    contributors = Tuple(
        title=_(u'Contributors'),
        description=_(u'Enter username or plain-text name, one per line'),
        value_type=TextLine(),
        required=False,
        missing_value=(),
    )
    form.order_before(contributors='IBibliographicItem.citation_detail')

    alt_bib_uri = URI(title=_(u'Alternate Bibliographic URI'), required=False)
    form.order_after(alt_bib_uri='IBibliographicItem.bibliographic_uri')

    publisher = TextLine(title=_(u'Publisher'), required=False)
    form.order_after(publisher='IBibliographicItem.alternate_uri')

    publisher_uri = URI(title=_(u'Publisher URI'), required=False)
    form.order_after(publisher_uri='publisher')

    review_uri = URI(title=_(u'Review URI'), required=False)
    form.order_after(review_uri='publisher_uri')

    isbn = TextLine(title=_(u'ISBN'), required=False)
    form.order_after(isbn='review_uri')

    issn = TextLine(title=_(u'ISSN'), required=False)
    form.order_after(issn='isbn')

    doi = TextLine(title=_(u'DOI'), required=False)
    form.order_after(doi='issn')

    text = RichText(
        title=_(u'Body'),
        default_mime_type='text/html',
        allowed_mime_types=('text/html', ),
        output_mime_type='text/x-safe-html',
        required=False,
    )
    form.order_after(text='doi')

    date_of_publication = TextLine(
        title=_(u'Publication Date'),
        description=_(u'Enter the date on which this publication was issued'),
        required=False)
    form.order_after(date_of_publication='text')

    loc_subjects = List(title=_(u'LOC Subjects'),
                        value_type=DictRow(title=u'Subject',
                                           schema=ILOCSubject),
                        required=False)
    form.widget(loc_subjects=DataGridFieldFactory)
    form.order_after(loc_subjects='*')
예제 #14
0
class ITask(model.Schema):

    body = RichText(title=_(u'Task content'))

    xml_body = XMLText(title=_(u'XML Content'), required=False)
예제 #15
0
class IContractingProcess(model.Schema):
    """ Marker interface and Dexterity Python Schema for ContractingProcess
    """
    # If you want, you can load a xml model created TTW here
    # and customize it in Python:

    # model.load('contracting_process.xml')

    # Infrastructure Project
    directives.widget('InfrastructureProject',
                      RelatedItemsFieldWidget,
                      pattern_options={
                          'basePath': '/',
                          'mode': 'auto',
                          'favourites': [],
                      })

    InfrastructureProject = RelationChoice(
        title=u'Infrasructure Project',
        description=_(u'''
            Infrastructure Project this contract is part of
            '''),
        source=CatalogSource(portal_type='Infrastructure Project'),
        required=False,
    )

    dexteritytextindexer.searchable('title')
    title = schema.TextLine(
        title=_(u'Title'),
        description=_(u'''
                The formal name of this contracting process. Once set,
                this should not normally by changed.
                '''),
        required=True,
    )
    dexteritytextindexer.searchable('description')
    description = schema.Text(
        title=_(u'Description'),
        description=_(u'''
                The description should summarise the purpose of this
                contract and the scope of work to be undertaken.
                '''),
        required=False,
    )

    ExternalReference = schema.TextLine(
        title=_(u'External Reference'),
        description=_(u'''
                If this contracting process is identified by some
                external reference number it may be recorded here.
                '''),
        required=False,
    )

    directives.widget(project_nature=SelectFieldWidget)
    project_nature = schema.List(
        title=_(u'Nature'),
        description=_(u'''
                Whether this contracting process relates to the design,
                construction and/or supervision of the project, from the
                contractNature codelist. More than one value may be
                provided if the contract is for both design and
                construction, or both design and supervision, etc.
                '''),
        default=[],
        value_type=schema.Choice(vocabulary='ocds.ContractNature'),
        required=False,
    )

    directives.widget(project_status=SelectFieldWidget)
    project_status = schema.Choice(
        title=_(u'Project Status'),
        description=_(u'''
        The current phase or status of this project
        '''),
        required=False,
        vocabulary='ocds.ProjectStatus',
    )

    # Tender Process

    directives.widget(procurementMethod=SelectFieldWidget)
    procurementMethod = schema.Choice(
        title=_(u'Procurement Method'),
        description=_(u'''
        '''),
        required=False,
        vocabulary='ocds.Method',
    )

    procurementMethodDetails = RichText(
        title=_(u'Procurement method details'),
        description=_(u'''
        Additional detail on the procurement method used. This field
        should be used to record an agreed list of procurement process
        types, such as: International Competitive Bidding, National
        Competitive Bidding, Donor Procurement Rules, Framework or
        Direct Award.
        '''),
        required=False,
    )

    costEstimate_amount = schema.Float(
        title=_(u'Cost estimate'),
        description=_(u'Amount as a number'),
        required=False,
    )

    directives.widget(costEstimate_currency=SelectFieldWidget)
    costEstimate_currency = schema.Choice(
        title=u'Cost Estimate Currency',
        description=u'Currency of the estimate amount',
        required=False,
        vocabulary='collective.vocabularies.iso.currencies',
    )

    numberOfTenderers = schema.Int(
        title=_(u'Number of tenderers'),
        required=False,
    )

    # procuringEntity
    directives.widget('procuringEntity',
                      RelatedItemsFieldWidget,
                      pattern_options={
                          'basePath': '/',
                          'mode': 'auto',
                          'favourites': [],
                      })

    procuringEntity = RelationChoice(
        title=u'Procuring Entity',
        description=_(u'''
            The entity managing the procurement. This can be different
            from the buyer who pays for, or uses, the items being
            procured.
            '''),
        source=CatalogSource(portal_type='Organization'),
        required=False,
    )

    # suppliers
    directives.widget('suppliers',
                      RelatedItemsFieldWidget,
                      pattern_options={
                          'basePath': '/',
                          'mode': 'auto',
                          'favourites': [],
                      })

    # administrativeEntity
    directives.widget('administrativeEntity',
                      RelatedItemsFieldWidget,
                      pattern_options={
                          'basePath': '/',
                          'mode': 'auto',
                          'favourites': [],
                      })

    administrativeEntity = RelationChoice(
        title=u'Administrative Entity',
        description=_(u'''
            The name and identifier of the entity responsible for
            contract administration if this is different from the
            procuring entity.administrativeEntity
            '''),
        source=CatalogSource(portal_type='Organization'),
        required=False,
    )

    # suppliers
    directives.widget('suppliers',
                      RelatedItemsFieldWidget,
                      pattern_options={
                          'basePath': '/',
                          'mode': 'auto',
                          'favourites': [],
                      })

    suppliers = RelationList(
        title=u'Suppliers',
        description=_(u'''
            Entities awarded or contracted to provide goods, works or
            services.
            '''),
        default=[],
        value_type=RelationChoice(
            source=CatalogSource(portal_type='Organization'), ),
        required=False,
    )

    contractValue_amount = schema.Float(
        title=_(u'Contract value'),
        description=_(u'The initial value of the contract'),
        required=False,
    )

    directives.widget(contractValue_currency=SelectFieldWidget)
    contractValue_currency = schema.Choice(
        title=u'Contract Value Currency',
        description=u'Currency of the contract amount',
        required=False,
        vocabulary='collective.vocabularies.iso.currencies',
    )

    # startDate
    contractPeriod_startDate = schema.Date(
        title=_(u'Start Date'),
        description=_(u'''
        The start date for the period. When known, a precise start date
        must always be provided.
        '''),
        required=False,
    )

    # endDate
    contractPeriod_endDate = schema.Date(
        title=_(u'End Date'),
        description=_(u'''
        The end date for the period. When known, a precise end date must
        always be provided.
        '''),
        required=False,
    )

    # period_maxExtentDate
    contractPeriod_maxExtentDate = schema.Date(
        title=_(u'Maximum extent'),
        description=_(u'''
            The period cannot be extended beyond this date. This field
            is optional, and can be used to express the maximum
            available data for extension or renewal of this period.
            '''),
        required=False,
    )

    finalValue_amount = schema.Float(
        title=_(u'Final value'),
        description=_(u'''
            This should be provided when the contracting process is
            complete. This may be derived from the sum of
            contract.implementation.transactions values in linked OCDS
            data where available. In other cases, it may need to be
            identified and entered manually based on other project
            documentation.
            '''),
        required=False,
    )

    directives.widget(finalValue_currency=SelectFieldWidget)
    finalValue_currency = schema.Choice(
        title=u'Final Contract Value Currency',
        description=u'Currency of the final contract amount',
        required=False,
        vocabulary='collective.vocabularies.iso.currencies',
    )
예제 #16
0
class INITF(model.Schema):
    """A News Article based on the News Industry Text Format specification."""

    # title = schema.TextLine()
    # nitf/head/title and nitf/body/body.head/hedline/hl1

    form.order_before(subtitle='IDublinCore.title')
    subtitle = schema.TextLine(
        # nitf/body/body.head/hedline/hl2
        title=_(u'Subtitle'),
        description=_(u'help_subtitle',
                      default=u'A subordinate headline for the article.'),
        default=u'',
        missing_value=u'',
        required=False,
    )

    byline = schema.TextLine(
        # nitf/body/body.head/byline/person
        title=_(u'Author'),
        default=u'',
        missing_value=u'',
        required=False,
    )

    location = schema.TextLine(
        # nitf/body/body.head/dateline/location
        title=_(u'Location'),
        description=_(
            u'help_location',
            default=u'Event location. Where an event took place '
            u'(as opposed to where the story was written).',
        ),
        default=u'',
        missing_value=u'',
        required=False,
    )

    text = RichText(
        # nitf/body/body.content
        title=_(u'Body text'),
        required=False,
    )

    model.fieldset('categorization', fields=['genre', 'urgency'])

    genre = schema.Choice(
        # nitf/head/tobject/tobject.property/@tobject.property.type
        title=_(u'Genre'),
        description=_(
            u'help_genre',
            default=u'Describes the nature, journalistic or '
            u'intellectual characteristic of a news '
            u'object, not specifically its content.',
        ),
        vocabulary=u'collective.nitf.AvailableGenres',
        defaultFactory=genre_default_value)

    urgency = schema.Choice(
        # nitf/head/docdata/urgency/@ed-urg
        title=_(u'Urgency'),
        description=_(u'help_urgency', default=u'News importance.'),
        vocabulary=u'collective.nitf.Urgencies',
        defaultFactory=urgency_default_value)
예제 #17
0
class IContactDetails(model.Schema):
    """Contact details behavior"""

    fieldset('contact_details',
             label=_(u'Contact details'),
             fields=(
                 'phone',
                 'cell_phone',
                 'fax',
                 'email',
                 'im_handle',
                 'website',
             ))
    fieldset('address',
             label=_(u'Address'),
             fields=(
                 'use_parent_address',
                 'parent_address',
                 'number',
                 'street',
                 'additional_address_details',
                 'zip_code',
                 'city',
                 'region',
                 'country',
             ))

    email = schema.TextLine(
        title=_(u"Email"),
        constraint=validateEmail,
        required=False,
    )

    phone = schema.TextLine(
        title=_(u"Phone"),
        required=False,
    )

    cell_phone = schema.TextLine(
        title=_(u"Cell phone"),
        required=False,
    )

    fax = schema.TextLine(
        title=_(u"Fax"),
        required=False,
    )

    website = schema.TextLine(
        title=_(u"Website"),
        required=False,
    )

    im_handle = schema.TextLine(
        title=_('Instant messenger handle'),
        required=False,
    )

    use_parent_address = MasterSelectBoolField(
        title=_("Use the belonging entity address"),
        slave_fields=(
            {
                'masterID':
                'form-widgets-IContactDetails-use_parent_address-0',
                'name': 'country',
                'action': 'show',
                'hide_values': 0,
                'siblings': True,
            },
            {
                'masterID':
                'form-widgets-IContactDetails-use_parent_address-0',
                'name': 'region',
                'action': 'show',
                'hide_values': 0,
                'siblings': True,
            },
            {
                'masterID':
                'form-widgets-IContactDetails-use_parent_address-0',
                'name': 'zip_code',
                'action': 'show',
                'hide_values': 0,
                'siblings': True,
            },
            {
                'masterID':
                'form-widgets-IContactDetails-use_parent_address-0',
                'name': 'city',
                'action': 'show',
                'hide_values': 0,
                'siblings': True,
            },
            {
                'masterID':
                'form-widgets-IContactDetails-use_parent_address-0',
                'name': 'number',
                'action': 'show',
                'hide_values': 0,
                'siblings': True,
            },
            {
                'masterID':
                'form-widgets-IContactDetails-use_parent_address-0',
                'name': 'street',
                'action': 'show',
                'hide_values': 0,
                'siblings': True,
            },
            {
                'masterID':
                'form-widgets-IContactDetails-use_parent_address-0',
                'name': 'additional_address_details',
                'action': 'show',
                'hide_values': 0,
                'siblings': True,
            },
            {
                'masterID':
                'form-widgets-IContactDetails-use_parent_address-0',
                'name': 'parent_address',
                'action': 'hide',
                'hide_values': 0,
                'siblings': True,
            },
        ),
        default=True,
        required=False,
    )

    parent_address = RichText(
        default_mime_type='text/html',
        output_mime_type='text/html',
        required=False,
    )
    form.mode(parent_address='display')

    country = schema.TextLine(
        title=_('Country'),
        required=False,
    )

    zip_code = schema.TextLine(
        title=_('Zip Code'),
        required=False,
    )

    city = schema.TextLine(
        title=_('City'),
        required=False,
    )

    street = schema.TextLine(
        title=_('Street'),
        required=False,
    )

    number = schema.TextLine(
        title=_('Number'),
        required=False,
    )

    region = schema.TextLine(
        title=_('Region'),
        required=False,
    )

    additional_address_details = schema.TextLine(
        title=_('Additional address details'),
        required=False,
    )
예제 #18
0
class IMissPiggyTile(IBorderTile):

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

    image_0 = NamedBlobImage(
        title=_(u"Image 1"),
        description=_(u""),
        required=False,
    )

    image_alt_0 = schema.TextLine(
        title=_(u"Image 1 Alt Text"),
        description=_(u""),
        required=False,
    )

    image_1 = NamedBlobImage(
        title=_(u"Image 2"),
        description=_(u""),
        required=False,
    )

    image_alt_1 = schema.TextLine(
        title=_(u"Image 2 Alt Text"),
        description=_(u""),
        required=False,
    )

    image_2 = NamedBlobImage(
        title=_(u"Image 3"),
        description=_(u""),
        required=False,
    )

    image_alt_2 = schema.TextLine(
        title=_(u"Image 3 Alt Text"),
        description=_(u""),
        required=False,
    )

    image_3 = NamedBlobImage(
        title=_(u"Image 4"),
        description=_(u""),
        required=False,
    )

    image_alt_3 = schema.TextLine(
        title=_(u"Image 4 Alt Text"),
        description=_(u""),
        required=False,
    )

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

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

    url = schema.TextLine(
        title=_(u"Video URL"),
        required=False,
    )

    video_aspect_ratio = schema.Choice(
        title=_(u"Video Aspect Ratio"),
        vocabulary="agsci.common.tiles.video_aspect_ratio",
        required=False,
        default=u"16:9",
    )
예제 #19
0
class FakeModel(interface.Interface):
    text = RichText(title=u"text")
예제 #20
0
class IRichTextTileData(IPersistentCoverTile):

    text = RichText(title=u'Text')
예제 #21
0
class IEchelon(model.Schema):
    """ Marker interface and Dexterity Python Schema for Echelon
    """

    fieldset(_(u'Course Basic'),
             fields=[
                 'classStatus',
                 'duringTime',
                 'classTime',
                 'classroom',
                 'courseStart',
                 'courseEnd',
                 'regDeadline',
                 'trainingCenter',
                 'specialCourse',
                 'undertaker',
                 'counselor',
                 'quota',
                 'altCount',
                 'courseFee',
                 'trainingCenterAgent',
                 'manageOrg',
                 'docSN',
             ])

    fieldset(_(u'Handbook'),
             fields=[
                 'contact',
                 'discountInfo_no_open',
                 'discountProgram',
                 'discountStart',
                 'discountEnd',
                 'prepareInfo',
                 'courseHours',
                 'detailClassTime',
                 'memo',
             ])

    title = schema.TextLine(
        title=_(u'Echelon Title'),
        default=_(u'New Course'),
        required=True,
    )

    duringTime = schema.Choice(title=_(u'During Time'),
                               vocabulary='cshm.content.ClassTime',
                               default=u'notYat',
                               required=True)

    courseStart = schema.Date(
        title=_(u"Course Start Date"),
        required=False,
    )

    courseEnd = schema.Date(
        title=_(u"Course End Date"),
        required=False,
    )

    classTime = schema.TextLine(
        title=_(u"Class Time, ex. 0900-1800"),
        required=False,
    )

    classroom = schema.Choice(title=_(u'Classroom'),
                              vocabulary='cshm.content.ClassRoom',
                              required=True)

    undertaker = schema.Choice(title=_(u'undertaker'),
                               vocabulary='cshm.content.AllUser',
                               required=True)

    counselor = schema.Choice(title=_(u'counselor'),
                              vocabulary='cshm.content.AllUser',
                              required=True)

    trainingCenter = RelationChoice(
        title=_(u"Training Center"),
        required=False,
        source=CatalogSource(Type='TrainingCenter'))

    quota = schema.Int(
        title=_(u'Class Quota'),
        description=_(u'if 0, is not confirm'),
        default=0,
        required=True,
    )

    altCount = schema.Int(
        title=_(u'Alternate Count'),
        default=100,
        min=0,
        required=True,
    )

    courseFee = schema.Int(
        title=_(u'Course Fee'),
        required=False,
    )

    classStatus = schema.Choice(
        title=_(u'Course Status'),
        vocabulary='cshm.content.ClassStatus',
        default=u'registerFirst',
        required=False,
    )

    memo = RichText(
        title=_(u'Memo'),
        required=False,
    )

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

    regDeadline = schema.Date(
        title=_(u'Registration Deadline'),
        required=False,
    )

    discountProgram = schema.TextLine(
        title=_(u'Discount Program'),
        required=False,
    )

    discountInfo_no_open = schema.Text(
        title=_(u'Discount Information, No Open'),
        required=False,
    )

    @invariant
    def check_date(data):
        if data.discountEnd < data.discountStart:
            raise Invalid(_(u'The End Date Need Bigger Then Start Date'))

    discountStart = schema.Date(title=_(u'Discount Start Date'),
                                required=False)

    discountEnd = schema.Date(title=_(u'Discount End Date'), required=False)

    prepareInfo = schema.Text(
        title=_(u'Prepare Information'),
        required=False,
    )

    courseHours = schema.Int(
        title=_(u"Course Hours"),
        default=0,
        description=_(u"If 0, asking for phone"),
        required=True,
    )

    detailClassTime = schema.Text(
        title=_(u'Detail Class Time'),
        required=False,
    )

    fieldset(_(u'Other'),
             fields=[
                 'submitClassDate',
                 'craneType',
                 'availableMaterial',
                 'qualification',
                 'reTrainingDetail',
                 'courseIntro',
                 'courseScope',
                 'testMethod',
                 'studDataSendDate',
                 'finishCourseSendDate',
                 'receivedDate',
                 'giveLicenseStatus',
                 'checkNote',
                 'preFee',
                 'feeDetail',
                 'manageFee',
                 'finishCourseStatus',
                 'cashierNote',
                 'statusNote',
                 'docDate',
                 'licenseDate',
             ])

    submitClassDate = schema.Date(
        title=_(u'Submit Class Date'),
        required=False,
    )

    craneType = schema.TextLine(
        title=_(u'Crane Type'),
        required=False,
    )

    availableMaterial = schema.List(
        title=_(u"Select Material"),
        required=False,
        value_type=schema.Choice(title=_(u"material"),
                                 vocabulary='cshm.content.MaterialList'))

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

    reTrainingDetail = RichText(
        title=_(u'ReTraining Detail'),
        required=False,
    )

    courseIntro = RichText(
        title=_(u'CourseIntro'),
        required=False,
    )

    courseScope = RichText(
        title=_(u'Course Scope'),
        required=False,
    )

    testMethod = RichText(
        title=_(u'Test Method'),
        required=False,
    )

    studDataSendDate = schema.Date(
        title=_(u"studDataSendDate"),
        required=False,
    )

    finishCourseSendDate = schema.Date(
        title=_(u"finishCourseSendDate"),
        required=False,
    )

    receivedDate = schema.Date(
        title=_(u"receivedDate"),
        required=False,
    )

    giveLicenseStatus = schema.TextLine(
        title=_(u"Give License Status"),
        required=False,
    )

    checkNote = schema.TextLine(
        title=_(u"checkNote"),
        required=False,
    )

    preFee = schema.TextLine(
        title=_(u"preFee"),
        required=False,
    )

    feeDetail = schema.TextLine(
        title=_(u"feeDetail"),
        required=False,
    )

    manageFee = schema.TextLine(
        title=_(u"manageFee"),
        required=False,
    )

    finishCourseStatus = schema.TextLine(
        title=_(u"finishCourseStatus"),
        required=False,
    )

    cashierNote = schema.TextLine(
        title=_(u"cashierNote"),
        required=False,
    )

    statusNote = schema.TextLine(
        title=_(u"statusNote"),
        required=False,
    )

    trainingCenterAgent = schema.TextLine(
        title=_(u'Training Center Agent'),
        required=False,
    )

    specialCourse = schema.TextLine(
        title=_(u"Special Course"),
        required=False,
    )

    manageOrg = schema.TextLine(title=_(u"Manage Org"), required=False)

    docSN = schema.TextLine(
        title=_(u"Document SN"),
        required=False,
    )

    docDate = schema.Date(
        title=_(u"Document Date"),
        required=False,
    )

    # 發證日期
    licenseDate = schema.Date(
        title=_(u"License Date"),
        required=False,
    )
예제 #22
0
class IKursabschluss(model.Schema):
    """ Marker interface and Dexterity Python Schema for Kursabschluss
    """

    text = RichText(title=u"Haupttext zur Beendigung des Online-Kurses.",
                    required=True)

    misserfolg = schema.Text(
        title=u"Text bei Misserfolg",
        default=
        u"Leider liegt ihr Ergebnis unterhalb der Mindestanforderung für die Erlangung eines\
                                      Zertifikates. Sie haben jedoch die Möglichkeit, den Kurs zu wiederholen. Wir wünschen\
                                      Ihnen dabei viel Erfolg.",
        required=False)

    image = NamedBlobImage(
        title=u"Bild des Zertifikats",
        description=u"Das Bild bildet den Hintergrund des PDF-Dokuments mit dem\
                           Zertifikat",
        required=False)

    #punkte = schema.Int(title=u"Notwendige Punktzahl für das Zertifikat",
    #                    description=u"Angabe, welche Punktzahl für den Druck eines Zertifikats erreicht\
    #                    werden musste. 0 Punkte heisst - das Zertifikat wird ohne Bedingungen am Ende des Kurses\
    #                    zum Ausdruck angeboten.",
    #                    default=0,
    #                    required=True)

    print_name = schema.Bool(
        title=
        u"Aktivieren, wenn der Name auf das Zertifikat gedruckt werden soll.",
        description=
        u"Das Feld wird nur berücksichtigt, wenn der Zertifikatsdruck aktiviert wurde."
    )

    name_x = schema.Float(
        title=u"X-Koordinate für den Druck des Namens in cm.",
        description=
        u"Angabe der X-Koordinate für den Druck des Namens auf das Zertifikat.\
                          Bitte vom linken unteren Blattrand aus messen (virtueller 0-Punkt des Koordinatensystems).",
        default=7.0)

    name_y = schema.Float(
        title=u"Y-Koordinate für den Druck des Namens in cm.",
        description=
        u"Angabe der Y-Koordinate für den Druck des Namens auf das Zertifikat.\
                          Bitte vom linken unteren Blattrand aus messen (virtueller 0-Punkt des Koordinatensystems).",
        default=14.0)

    name_fontsize = schema.Int(
        title=
        u"Schriftgröße in pt für den Druck des Namens auf das Zertifikat.",
        default=30)

    print_datum = schema.Bool(
        title=
        u"Aktivieren, wenn das Datum auf das Zertifikat gedruckt werden soll.",
        description=
        u"Das Feld wird nur berücksichtigt, wenn der Zertifikatsdruck aktiviert wurde."
    )

    datum_x = schema.Float(
        title=u"X-Koordinate für den Druck des Datums in cm.",
        description=
        u"Angabe der X-Koordinate für den Druck des Datums auf das Zertifikat.\
                          Bitte vom linken unteren Blattrand aus messen (virtueller 0-Punkt des Koordinatensystems).",
        default=5.0)

    datum_y = schema.Float(
        title=u"Y-Koordinate für den Druck des Datums in cm.",
        description=
        u"Angabe der Y-Koordinate für den Druck des Datums auf das Zertifikat.\
                          Bitte vom linken unteren Blattrand aus messen (virtueller 0-Punkt des Koordinatensystems).",
        default=8.0)

    datum_fontsize = schema.Int(
        title=
        u"Schriftgröße in pt für den Druck des Datums auf das Zertifikat.",
        default=14)

    print_certid = schema.Bool(
        title=
        u"Aktivieren, wenn eine auf das Zertifikats-ID gedruckt werden soll.",
        description=
        u"Das Feld wird nur berücksichtigt, wenn der Zertifikatsdruck aktiviert wurde."
    )

    certid_x = schema.Float(
        title=u"X-Koordinate für den Druck der Zertifikats-ID in cm.",
        description=
        u"Angabe der X-Koordinate für den Druck der Zertifikats-ID auf das Zertifikat.\
                          Bitte vom linken unteren Blattrand aus messen (virtueller 0-Punkt des Koordinatensystems).",
        default=5.0)

    certid_y = schema.Float(
        title=u"Y-Koordinate für den Druck der Zertifikats-ID in cm.",
        description=
        u"Angabe der Y-Koordinate für den Druck der Zertifikats-ID auf das Zertifikat.\
                          Bitte vom linken unteren Blattrand aus messen (virtueller 0-Punkt des Koordinatensystems).",
        default=6.0)

    certid_fontsize = schema.Int(
        title=
        u"Schriftgröße in pt für den Druck der Zertifikats-ID auf das Zertifikat.",
        default=14)

    #@invariant
    #def zertifikat_invariant(data):
    #    if data.zertifikat:
    #        if not data.image:
    #            raise Invalid(u'Für den Druck des Zertifikats wird ein Hintergrundbild benötigt.')

    @invariant
    def name_invariant(data):
        if data.print_name:
            if not data.name_x or not data.name_y or not data.name_fontsize:
                raise Invalid(
                    u'Bitte machen Sie alle notwendigen Angaben für den Druck des Namens.'
                )

    @invariant
    def name_invariant(data):
        if data.print_datum:
            if not data.datum_x or not data.datum_y or not data.datum_fontsize:
                raise Invalid(
                    u'Bitte machen Sie alle notwendigen Angaben für den Druck des Datums.'
                )
예제 #23
0
class IConferenceSpeaker(model.Schema):
    """A conference speaker or leader of a workshop. Speaker can be added anywhere.
    """

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

    firstname = schema.TextLine(
        title=_(u"First name"),
        required=True,
    )

    street = schema.TextLine(
        title=_(u"Street"),
        description=
        _(u"For those requiring visa, please add your full postal address details"
          ),
        required=False,
    )

    city = schema.TextLine(
        title=_(u"City"),
        description=
        _(u"For those requiring visa, please add your full postal address details"
          ),
        required=False,
    )

    postalcode = schema.TextLine(
        title=_(u"Postal Code"),
        description=
        _(u"For those requiring visa, please add your full postal address details"
          ),
        required=False,
    )

    country = schema.TextLine(
        title=_(u"Country"),
        description=
        _(u"For those requiring visa, please add your full postal address details"
          ),
        required=False,
    )

    email = schema.ASCIILine(
        title=_(u"Your email address"),
        constraint=validateEmail,
        required=True,
    )

    telephonenumber = schema.TextLine(
        title=_(u"Telephone Number"),
        description=
        _(u"Please fill in your telephone number so that we could get in contact with you by phone if necessary."
          ),
        required=False,
    )
    mobiletelepone = schema.TextLine(
        title=_(u"Mobile Telephone Number"),
        description=
        _(u"Please fill in your mobile telephone number so that we could get in contact with you during the conference."
          ),
        required=True,
    )

    organisation = schema.TextLine(
        title=_(u"Organisation"),
        required=False,
    )

    description = schema.Text(title=_(u"A short bio"), )

    bio = RichText(title=_(u"Bio"), required=False)

    picture = NamedBlobImage(
        title=_(u"Picture"),
        description=_(u"Please upload an image"),
        required=False,
    )
예제 #24
0
class IDokuPraevention(form.Schema, IImageScaleTraversable):
    """
    Artikeltyp zur Erfassung von Dokumentationen im Bereich Praevention der BG ETEM.
    """

    directives.fieldset('doku_details',
                        label=u'gut zu wissen',
                        fields=('details',),
                       )

    directives.fieldset('doku_zusatzinfos',
                        label=u'weiss nicht jeder',
                        fields=('zusatzinfos',),
                       )

    directives.fieldset('doku_bilder',
                        label=u'Bilder',
                        fields=('titelbilder', 'bilder','nachrichtenbild','bildtitel'),
                       )

    directives.fieldset('doku_dateien_links',
                        label=u'Dateien/Links',
                        fields=('dateien','links'),
                       )

    ueberschrift = schema.TextLine(title=u"Überschrift",
                   description=u"Hier können Sie dem Dokument eine Überschrift geben und damit den Title überschrieben.",
                   required = False,)

    haupttext = RichText(
                title=u"wichtig zu wissen",
                description=u"(grundlegende Informationen zum Thema - Haupttext)",
                required = True,
                )

    details = RichText(
              title=u"gut zu wissen",
              description=u"(detaillierte Informationen ergänzend zu den Grundlagen)",
              required = False,
              )

    zusatzinfos = RichText(
              title=u"weiss nicht jeder",
              description=u"(Interessantes und Wissenswertes, ergänzend zu den Grundlagen und Details)",
              required = False,
              )

    titelbilder = RelationList(title=u"Titelbilder",
                           description=u"(Anzeige im Kopf der Seite)",
                           default=[],
                           value_type=RelationChoice(title=_(u"Titelbilder"),
                                                     source=ObjPathSourceBinder()),
                           required=False,)

    bilder = RelationList(
              title=u"Illustration",
              description=u"(Bilder zur Anzeige unterhalb der Inhaltstexte)",
              value_type=RelationChoice(title=u"Bilder", 
                                        source=ObjPathSourceBinder()),
              required=False,
              )

    webcode = schema.TextLine(
              title=u"Webcode",
              description=u"Der Webcode für diesen Artikel wird automatisch errechnet und angezeigt. Sie\
                          können diesen Webcode bei Bedarf jedoch jederzeit überschreiben.",
              required = True,
              defaultFactory = genWebcode,
              )

    vorgaenger = schema.TextLine(
              title=u"Vorgänger",
              description=u"Bitte tragen Sie den Webcode des Vorgängerdokuments ein.",
              required = False,
              )

    nachfolger = schema.TextLine(
              title=u"Nachfolger",
              description=u"Bitte tragen Sie den Webcode des Nachfolgerdokuments ein.",
              required = False,
              )

    weiterlesen = RelationList(title=u"Dokumente zum Weiterlesen",
                           description=u"Bitte wählen Sie hier Dokumente aus, die Sie dem Benutzer zum\
                                   Weiterlesen empfehlen.",
                           default=[],
                           value_type=RelationChoice(title=_(u"Weiterlesen"),
                                                     source=ObjPathSourceBinder()),
                           required=False,)

    nachrichtenbild = RelationChoice(
        title=u"Vorschaubild",
        description=u"(Anzeige in Verweisboxen oder Ordneransichten)",
        source=ObjPathSourceBinder(),
        required=False,
        )

    bildtitel = schema.TextLine(
              title=u"Titel des Vorschaubildes",
              required = False,
              )

    directivesform.widget(dateien=MultiFileFieldWidget)
    dateien = schema.List(title = u'Ihre Dateien für dieses Dokument',
                             value_type=NamedBlobFile(),
                             required = False,)

    form.widget(links=DataGridFieldFactory)
    links = schema.List(title = u'Ihre Links für dieses Dokument',
                        value_type=DictRow(title=u"Link", schema=ILink),
                        required = False,)
예제 #25
0
class IOrganisationExtra(model.Schema):

    phase_1_intro = RichText(
        title=_(""),
        required=False,
    )
    formdirectives.omitted('phase_1_intro')
    formdirectives.no_omit(IAddForm, 'phase_1_intro')

    privacy_policy_text = RichText(
        title=u"",
        required=False,
    )
    formdirectives.omitted('privacy_policy_text')
    formdirectives.no_omit(IAddForm, 'privacy_policy_text')

    privacy_policy = schema.Bool(
        title=_(
            u"label_accept_privacy",
            default=
            u"I confirm that I have read and accept the terms of privacy "
            u"conditions and I authorise the treatment of my personal data."),
        required=True,
        constraint=isTicked,
    )
    formdirectives.omitted('privacy_policy')
    formdirectives.no_omit(IAddForm, 'privacy_policy')

    countries = schema.List(
        title=_(u"Countries of activity"),
        description=_(
            u"Please indicate at least 3 countries in which your company is "
            u"represented through branches / representative offices / "
            u"network members"),
        value_type=schema.Choice(vocabulary=vocabularies.countries, ),
        required=True,
        constraint=isActiveInMultipleCountries,
    )
    directives.languageindependent('countries')

    additional_countries = schema.Text(
        title=_(u"Other countries"),
        description=_(
            u"Other countries in which you organisation is represented (enter "
            "names)"),
        required=False,
    )
    directives.languageindependent('additional_countries')

    business_sector = schema.TextLine(
        title=_(u"Business sector"),
        description=_(u"Business sector in which you operate"),
    )
    directives.languageindependent('business_sector')

    social_dialogue = schema.Choice(
        title=_(u"Social Dialogue Partner?"),
        description=_(
            u"Are you a Social Partner within the framework of the European "
            "Social Dialogue?"),
        vocabulary=vocabularies.yes_no,
    )

    why_partner = schema.Text(
        title=_(u"1. Why do you want to be an official partner of the Healthy "
                u"Workplaces Campaign 2014-15 on ‘Healthy workplaces manage "
                u"stress’?"),
        description=_(u"Please explain briefly"),
    )
    directives.languageindependent('why_partner')

    promotion_electronic = schema.Text(
        title=_(
            u"2. How do you plan to promote and support the Campaign via your "
            "corporate website and in any other electronic means (intranet, "
            "newsletter, social media, etc.)?"),
        description=_(u"Please describe"),
        required=False,
    )
    directives.languageindependent('promotion_electronic')

    conferences_check = schema.Bool(
        title=_(u"Conferences, seminars or workshops exclusively or partly "
                "dedicated to the topic of the Campaign"),
        required=False,
    )
    directives.languageindependent('conferences_check')

    conferences_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on topic, main objectives, "
            "profile of participants, etc."),
        required=False,
    )
    directives.languageindependent('conferences_description')

    training_check = schema.Bool(
        title=_(u'Training sessions'),
        required=False,
    )
    directives.languageindependent('training_check')

    training_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on topic, main objectives, "
            "profile of participants, etc."),
        required=False,
    )
    directives.languageindependent('training_description')

    partnerships_check = schema.Bool(
        title=_(
            u"Partnerships with other organisations and schools / colleges / "
            "training centres"),
        required=False,
    )
    directives.languageindependent('partnerships_check')

    partnerships_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on planned activities"),
        required=False,
    )
    directives.languageindependent('partnerships_description')

    promotion_check = schema.Bool(
        title=_(u"Promotion in the media (press release, press conference, "
                "advertorials, etc )"),
        required=False,
    )
    directives.languageindependent('promotion_check')

    promotion_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on planned activities"),
        required=False,
    )
    directives.languageindependent('promotion_description')

    bestpractice_check = schema.Bool(
        title=_(u"Best Practice competition / activities"),
        required=False,
    )
    directives.languageindependent('bestpractice_check')

    bestpractice_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on planned activities"),
        required=False,
    )
    directives.languageindependent('bestpractice_description')

    otheractivities_check = schema.Bool(
        title=_(u"Other activities"),
        required=False,
    )
    directives.languageindependent('otheractivities_check')

    otheractivities_description = schema.Text(
        title=_(u"Please describe"),
        description=_(
            u"Please provide some information on planned activities"),
        required=False,
    )
    directives.languageindependent('otheractivities_description')

    phase_2_intro = RichText(
        title=_(""),
        required=False,
    )
    formdirectives.omitted('phase_2_intro')
    formdirectives.no_omit(IEditForm, 'phase_2_intro')

    ceo_name = schema.TextLine(
        title=_(u"CEO"),
        description=_(
            u"Name / surname of your CEO, President, General Director or "
            "other"),
    )
    directives.languageindependent('ceo_name')
    formdirectives.omitted('ceo_name')
    formdirectives.no_omit(IEditForm, 'ceo_name')

    ceo_position = schema.TextLine(
        title=_(u"Position identifier"),
        description=_(
            u"Please indicate the actual position, such as President, General "
            "Director, CEO, Chairman, etc"),
        default=u"CEO",
    )
    directives.languageindependent('ceo_position')
    formdirectives.omitted('ceo_position')
    formdirectives.no_omit(IEditForm, 'ceo_position')

    description = schema.Text(title=_(
        u'His / her quote on the Healthy Workplaces Campaign 2014-15 on '
        '"Healthy workplaces manage stress"'), )
    directives.languageindependent('description')
    formdirectives.omitted('description')
    formdirectives.no_omit(IEditForm, 'description')

    key_position = schema.TextLine(
        title=_(u"Position of the main contact person."), )
    directives.languageindependent('key_position')

    representative_name = schema.TextLine(
        required=False,
        title=_(
            u"Name of your organisation's health and safety representative"),
    )
    directives.languageindependent('representative_name')
    formdirectives.omitted('representative_name')
    formdirectives.no_omit(IEditForm, 'representative_name')

    representative_email = schema.TextLine(
        required=False,
        title=_(u"Email address of your organisation's health and safety "
                "representative"),
        constraint=isEmail,
    )
    directives.languageindependent('representative_email')
    formdirectives.omitted('representative_email')
    formdirectives.no_omit(IEditForm, 'representative_email')

    representative_phone = schema.TextLine(
        required=False,
        title=_(u"Telephone number of your organisation's health and safety "
                "representative"),
    )
    directives.languageindependent('representative_phone')
    formdirectives.omitted('representative_phone')
    formdirectives.no_omit(IEditForm, 'representative_phone')
예제 #26
0
class IReference(model.Schema):

    body = RichText(title=_(u'Reference content'))

    xml_body = XMLText(title=_(u'XML Content'), required=False)
예제 #27
0
class IEasyForm(Schema):
    """Forms for Plone."""

    directives.omitted("fields_model", "actions_model")
    fields_model = zope.schema.Text(
        title=_(u"Fields Model"), defaultFactory=default_fields
    )
    actions_model = zope.schema.Text(
        title=_(u"Actions Model"), defaultFactory=default_actions
    )

    # DEFAULT
    formPrologue = RichText(
        title=_(u"label_prologue_text", default=u"Form Prologue"),
        description=_(
            u"help_prologue_text",
            default=u"This text will be displayed above the form fields.",
        ),
        required=False,
    )
    formEpilogue = RichText(
        title=_(u"label_epilogue_text", default=u"Form Epilogue"),
        description=_(
            u"help_epilogue_text",
            default=u"The text will be displayed after the form fields.",
        ),
        required=False,
    )

    # THANKYOU
    fieldset(
        u"thankyou",
        label=_("Thanks Page"),
        fields=[
            "thankstitle",
            "thanksdescription",
            "showAll",
            "showFields",
            "includeEmpties",
            "thanksPrologue",
            "thanksEpilogue",
        ],
        order=10,
    )
    thankstitle = zope.schema.TextLine(
        title=_(u"label_thankstitle", default=u"Thanks title"),
        defaultFactory=default_thankstitle,
        required=True,
    )
    thanksdescription = zope.schema.Text(
        title=_(u"label_thanksdescription", default=u"Thanks summary"),
        description=_(u"help_thanksdescription", default=u"Used in thanks page."),
        defaultFactory=default_thanksdescription,
        required=False,
        missing_value=u"",
    )
    showAll = zope.schema.Bool(
        title=_(u"label_showallfields_text", default=u"Show All Fields"),
        description=_(
            u"help_showallfields_text",
            default=u""
            u"Check this to display input for all fields "
            u"(except label and file fields). If you check "
            u"this, the choices in the pick box below "
            u"will be ignored.",
        ),
        default=True,
        required=False,
    )
    showFields = zope.schema.List(
        title=_(u"label_showfields_text", default=u"Show Responses"),
        description=_(
            u"help_showfields_text",
            default=u"Pick the fields whose inputs you'd like to display on "
            u"the success page.",
        ),
        unique=True,
        required=False,
        value_type=zope.schema.Choice(vocabulary="easyform.Fields"),  # noqa
    )
    includeEmpties = zope.schema.Bool(
        title=_(u"label_includeEmpties_text", default=u"Include Empties"),
        description=_(
            u"help_includeEmpties_text",
            default=u""
            u"Check this to display field titles "
            u"for fields that received no input. Uncheck "
            u"to leave fields with no input off the list.",
        ),
        default=True,
        required=False,
    )
    thanksPrologue = RichText(
        title=_(u"label_thanksprologue_text", default=u"Thanks Prologue"),
        description=_(
            u"help_thanksprologue_text",
            default=u"This text will be displayed above the selected field " u"inputs.",
        ),
        required=False,
    )
    thanksEpilogue = RichText(
        title=_(u"label_thanksepilogue_text", default=u"Thanks Epilogue"),
        description=_(
            u"help_thanksepilogue_text",
            default=u"The text will be displayed after the field inputs.",
        ),
        required=False,
    )

    # ADVANCED
    fieldset(
        u"advanced",
        label=_("Advanced"),
        fields=[
            "submitLabel",
            "useCancelButton",
            "resetLabel",
            "form_tabbing",
            "default_fieldset_label",
            "method",
            "unload_protection",
            "CSRFProtection",
            "forceSSL",
        ],
        order=20,
    )
    submitLabel = zope.schema.TextLine(
        title=_(u"label_submitlabel_text", default=u"Submit Button Label"),
        description=_(u"help_submitlabel_text", default=u""),
        defaultFactory=default_submitLabel,
        required=False,
    )
    useCancelButton = zope.schema.Bool(
        title=_(u"label_showcancel_text", default=u"Show Reset Button"),
        description=_(u"help_showcancel_text", default=u""),
        default=False,
        required=False,
    )
    resetLabel = zope.schema.TextLine(
        title=_(u"label_reset_button", default=u"Reset Button Label"),
        description=_(u"help_reset_button", default=u""),
        defaultFactory=default_resetLabel,
        required=False,
    )
    directives.write_permission(form_tabbing=config.EDIT_ADVANCED_PERMISSION)
    form_tabbing = zope.schema.Bool(
        title=_(u"label_form_tabbing", default=u"Turn fieldsets to tabs"),
        description=_(u"help_form_tabbing", default=u""),
        default=True,
        required=False,
    )
    directives.write_permission(default_fieldset_label=config.EDIT_ADVANCED_PERMISSION)
    default_fieldset_label = zope.schema.TextLine(
        title=_(
            u"label_default_fieldset_label_text",
            default=u"Custom Default Fieldset Label",
        ),
        description=_(
            u"help_default_fieldset_label_text",
            default=u"This field allows you to change default fieldset label.",
        ),
        required=False,
        default=u"",
    )
    directives.write_permission(method=config.EDIT_TECHNICAL_PERMISSION)
    method = zope.schema.Choice(
        title=_(u"label_method", default=u"Form method"),
        description=_(u"help_method", default=u""),
        default=u"post",
        required=False,
        vocabulary="easyform.FormMethods",
    )
    directives.write_permission(unload_protection=config.EDIT_TECHNICAL_PERMISSION)
    unload_protection = zope.schema.Bool(
        title=_(u"label_unload_protection", default=u"Unload protection"),
        description=_(u"help_unload_protection", default=u""),
        default=True,
        required=False,
    )
    directives.write_permission(CSRFProtection=config.EDIT_TECHNICAL_PERMISSION)
    CSRFProtection = zope.schema.Bool(
        title=_(u"label_csrf", default=u"CSRF Protection"),
        description=_(
            u"help_csrf",
            default=u"Check this to employ Cross-Site "
            u"Request Forgery protection. Note that only HTTP Post "
            u"actions will be allowed.",
        ),
        default=True,
        required=False,
    )
    directives.write_permission(forceSSL=config.EDIT_TECHNICAL_PERMISSION)
    forceSSL = zope.schema.Bool(
        title=_(u"label_force_ssl", default=u"Force SSL connection"),
        description=_(
            u"help_force_ssl",
            default=u"Check this to make the form redirect to an SSL-enabled "
            u"version of itself (https://) if accessed via a non-SSL "
            u"URL (http://).  In order to function properly, "
            u"this requires a web server that has been configured to "
            u"handle the HTTPS protocol on port 443 and forward it to "
            u"Zope.",
        ),
        default=False,
        required=False,
    )

    # OVERRIDES
    fieldset(
        u"overrides",
        label=_("Overrides"),
        fields=[
            "thanksPageOverrideAction",
            "thanksPageOverride",
            "formActionOverride",
            "onDisplayOverride",
            "afterValidationOverride",
            "headerInjection",
            "submitLabelOverride",
        ],
        order=30,
    )
    directives.write_permission(thanksPageOverrideAction=config.EDIT_TALES_PERMISSION)
    thanksPageOverrideAction = zope.schema.Choice(
        title=_(
            u"label_thankspageoverrideaction_text",
            default=u"Custom Success Action Type",
        ),
        description=_(
            u"help_thankspageoverrideaction_text",
            default=u"Use this field in place of a thanks-page designation "
            u"to determine final action after calling "
            u"your action adapter (if you have one). You would "
            u"usually use this for a custom success template or "
            u"script. Leave empty if unneeded. Otherwise, specify as "
            u"you would a CMFFormController action type and argument, "
            u"complete with type of action to execute "
            u'(e.g., "redirect_to" or "traverse_to") '
            u"and a TALES expression. For example, "
            u'"Redirect to" and "string:thanks-page" would redirect '
            u'to "thanks-page".',
        ),
        default=u"redirect_to",
        required=False,
        vocabulary="easyform.CustomActions",
    )
    directives.write_permission(thanksPageOverride=config.EDIT_TALES_PERMISSION)
    thanksPageOverride = zope.schema.TextLine(
        title=_(u"label_thankspageoverride_text", default=u"Custom Success Action"),
        description=_(
            u"help_thankspageoverride_text",
            default=u"Use this field in place of a thanks-page designation "
            u"to determine final action after calling your action "
            u"adapter (if you have one). You would usually use "
            u"this for a custom success template or script. "
            u"Leave empty if unneeded. Otherwise, specify as you "
            u"would a CMFFormController action type and argument, "
            u"complete with type of action to execute "
            u'(e.g., "redirect_to" or "traverse_to") '
            u"and a TALES expression. For example, "
            u'"Redirect to" and "string:thanks-page" would redirect '
            u'to "thanks-page".',
        ),
        default=u"",
        constraint=isTALES,
        required=False,
    )
    directives.write_permission(formActionOverride=config.EDIT_TALES_PERMISSION)
    formActionOverride = zope.schema.TextLine(
        title=_(u"label_formactionoverride_text", default=u"Custom Form Action"),
        description=_(
            u"help_formactionoverride_text",
            default=u"Use this field to override the form action attribute. "
            u"Specify a URL to which the form will post. "
            u"This will bypass form validation, success action "
            u"adapter and thanks page.",
        ),
        default=u"",
        required=False,
        constraint=isTALES,
    )
    directives.write_permission(onDisplayOverride=config.EDIT_TALES_PERMISSION)
    onDisplayOverride = zope.schema.TextLine(
        title=_(u"label_OnDisplayOverride_text", default=u"Form Setup Script"),
        description=_(
            u"help_OnDisplayOverride_text",
            default=u"A TALES expression that will be called when the form is "
            u"displayed. Leave empty if unneeded. The most common "
            u"use of this field is to call a python script that "
            u"sets defaults for multiple fields by pre-populating "
            u"request.form. "
            u"Any value returned by the expression is ignored. "
            u"PLEASE NOTE: errors in the evaluation of this "
            u"expression will cause an error on form display.",
        ),
        constraint=isTALES,
        required=False,
        default=u"",
    )
    directives.write_permission(afterValidationOverride=config.EDIT_TALES_PERMISSION)
    afterValidationOverride = zope.schema.TextLine(
        title=_(
            u"label_AfterValidationOverride_text", default=u"After Validation Script"
        ),
        description=_(
            u"help_AfterValidationOverride_text",
            default=u"A TALES expression that will be called after the form is"
            u"successfully validated, but before calling an action "
            u"adapter (if any) or displaying a thanks page."
            u"Form input will be in the request.form dictionary."
            u"Leave empty if unneeded. The most "
            u"common use of this field is to call a python script"
            u"to clean up form input or to script an alternative "
            u"action. Any value returned by the expression is ignored."
            u"PLEASE NOTE: errors in the evaluation of this "
            u"expression willcause an error on form display.",
        ),
        constraint=isTALES,
        required=False,
        default=u"",
    )
    directives.write_permission(headerInjection=config.EDIT_TALES_PERMISSION)
    headerInjection = zope.schema.TextLine(
        title=_(u"label_headerInjection_text", default=u"Header Injection"),
        description=_(
            u"help_headerInjection_text",
            default=u"This override field allows you to insert content into "
            u"the xhtml head. The typical use is to add custom CSS "
            u"or JavaScript. Specify a TALES expression returning a "
            u"string. The string will be inserted with no "
            u"interpretation. PLEASE NOTE: errors in the evaluation "
            u"of this expression will cause an error on form display.",
        ),
        constraint=isTALES,
        required=False,
        default=u"",
    )
    directives.write_permission(submitLabelOverride=config.EDIT_TALES_PERMISSION)
    submitLabelOverride = zope.schema.TextLine(
        title=_(
            u"label_submitlabeloverride_text", default=u"Custom Submit Button Label"
        ),
        description=_(
            u"help_submitlabeloverride_text",
            default=u"This override field allows you to change submit button "
            u"label. The typical use is to set label with request "
            u"parameters. Specify a TALES expression returning a "
            u"string. PLEASE NOTE: errors in the evaluation of this "
            u"expression will cause an error on form display.",
        ),
        constraint=isTALES,
        required=False,
        default=u"",
    )
예제 #28
0
class IExample(model.Schema):
    """Dexterity-Schema with all field-types."""

    # The most used fields
    # textline, text, bool, richtext, email

    fieldset(
        "numberfields",
        label=u"Number fields",
        fields=("int_field", "float_field"),
    )

    fieldset(
        "datetimefields",
        label=u"Date and time fields",
        fields=(
            "datetime_field",
            "date_field",
            "time_field",
            "timedelta_field",
        ),
    )

    fieldset(
        "choicefields",
        label=u"Choice and Multiple Choice fields",
        fields=(
            "choice_field",
            "choice_field_radio",
            "choice_field_select",
            "choice_field_voc",
            "list_field",
            "list_field_checkbox",
            "list_field_select",
            "list_field_voc_unconstrained",
            "tuple_field",
            "set_field",
            "set_field_checkbox",
        ),
    )

    fieldset(
        "relationfields",
        label=u"Relation fields",
        fields=(
            "relationchoice_field",
            "relationlist_field",
            "relationchoice_field_constrained",
            "relationlist_field_constrained",
            "relationlist_field_search_mode",
            "relationchoice_field_select",
            "relationchoice_field_radio",
            "relationlist_field_select",
            "relationlist_field_checkbox",
            "relationchoice_field_ajax_select",
            "relationlist_field_ajax_select",
        ),
    )

    fieldset(
        "uuidrelationfields",
        label=u"Relation widgets with uuids",
        fields=(
            "uuid_choice_field",
            "uuid_list_field",
            "uuid_choice_field_constrained",
            "uuid_list_field_constrained",
            "uuid_list_field_search_mode",
            "uuid_choice_field_select",
            "uuid_choice_field_radio",
            "uuid_list_field_select",
            "uuid_list_field_checkbox",
            "uuid_choice_field_ajax_select",
            "uuid_list_field_ajax_select",
        ),
    )

    fieldset(
        "filefields",
        label=u"File fields",
        fields=("file_field", "image_field"),
    )

    fieldset(
        "otherfields",
        label=u"Other fields",
        fields=(
            "uri_field",
            "sourcetext_field",
            "ascii_field",
            "bytesline_field",
            "asciiline_field",
            "pythonidentifier_field",
            "dottedname_field",
            # 'dict_field',
            # "vocabularyterms_field",
            # "vocabularytermstranslation_field",
            # 'dict_field_with_choice',
        ),
    )

    fieldset(
        "datagrid",
        label=u"Datagrid field",
        fields=("datagrid_field", ),
    )

    primary("title")
    title = schema.TextLine(
        title=u"Primary Field (Textline)",
        description=u"zope.schema.TextLine",
        required=True,
    )

    description = schema.TextLine(
        title=u"Description (Textline)",
        description=u"zope.schema.TextLine",
        required=False,
    )

    text_field = schema.Text(
        title=u"Text Field",
        description=u"zope.schema.Text",
        required=False,
        missing_value=u"",
    )

    textline_field = schema.TextLine(
        title=u"Textline field",
        description=u"A simple input field (schema.TextLine)",
        required=False,
    )

    bool_field = schema.Bool(
        title=u"Boolean field",
        description=u"zope.schema.Bool",
        required=False,
    )

    choice_field = schema.Choice(
        title=u"Choice field",
        description=u"zope.schema.Choice",
        values=[u"One", u"Two", u"Three"],
        required=True,
    )

    directives.widget(choice_field_radio=RadioFieldWidget)
    choice_field_radio = schema.Choice(
        title=u"Choice field with radio boxes",
        description=u"zope.schema.Choice",
        values=[u"One", u"Two", u"Three"],
        required=False,
    )

    choice_field_voc = schema.Choice(
        title=u"Choicefield with values from named vocabulary",
        description=u"zope.schema.Choice",
        vocabulary="plone.app.vocabularies.PortalTypes",
        required=False,
    )

    directives.widget(choice_field_select=SelectFieldWidget)
    choice_field_select = schema.Choice(
        title=u"Choicefield with select2 widget",
        description=u"zope.schema.Choice",
        vocabulary="plone.app.vocabularies.PortalTypes",
        required=False,
    )

    list_field = schema.List(
        title=u"List field",
        description=u"zope.schema.List",
        value_type=schema.Choice(
            values=[u"Beginner", u"Advanced", u"Professional"], ),
        required=False,
        missing_value=[],
    )

    directives.widget(list_field_checkbox=CheckBoxFieldWidget)
    list_field_checkbox = schema.List(
        title=u"List field with checkboxes",
        description=u"zope.schema.List",
        value_type=schema.Choice(
            values=[u"Beginner", u"Advanced", u"Professional"], ),
        required=False,
        missing_value=[],
    )

    directives.widget(list_field_select=SelectFieldWidget)
    list_field_select = schema.List(
        title=u"List field with select widget",
        description=u"zope.schema.List",
        value_type=schema.Choice(
            values=[u"Beginner", u"Advanced", u"Professional"], ),
        required=False,
        missing_value=[],
    )

    list_field_voc_unconstrained = schema.List(
        title=
        u"List field with values from vocabulary but not constrained to them.",
        description=u"zope.schema.List",
        value_type=schema.TextLine(),
        required=False,
        missing_value=[],
    )
    directives.widget(
        "list_field_voc_unconstrained",
        AjaxSelectFieldWidget,
        vocabulary="plone.app.vocabularies.PortalTypes",
        pattern_options={
            "closeOnSelect":
            False,  # Select2 option to leave dropdown open for multiple selection
        },
    )

    tuple_field = schema.Tuple(
        title=u"Tuple field",
        description=u"zope.schema.Tuple",
        value_type=schema.Choice(
            values=[u"Beginner", u"Advanced", u"Professional"], ),
        required=False,
        missing_value=(),
    )

    set_field = schema.Set(
        title=u"Set field",
        description=u"zope.schema.Set",
        value_type=schema.Choice(
            values=[u"Beginner", u"Advanced", u"Professional"], ),
        required=False,
        missing_value={},
    )

    directives.widget(set_field_checkbox=CheckBoxFieldWidget)
    set_field_checkbox = schema.Set(
        title=u"Set field with checkboxes",
        description=u"zope.schema.Set",
        value_type=schema.Choice(
            values=[u"Beginner", u"Advanced", u"Professional"], ),
        required=False,
        missing_value={},
    )

    # File fields
    image_field = NamedBlobImage(
        title=u"Image field",
        description=
        u"A upload field for images (plone.namedfile.field.NamedBlobImage)",
        required=False,
    )

    file_field = NamedBlobFile(
        title=u"File field",
        description=
        u"A upload field for files (plone.namedfile.field.NamedBlobFile)",
        required=False,
    )

    # Date and Time fields
    datetime_field = schema.Datetime(
        title=u"Datetime field",
        description=u"Uses a date and time picker (zope.schema.Datetime)",
        required=False,
    )

    date_field = schema.Date(
        title=u"Date field",
        description=u"Uses a date picker (zope.schema.Date)",
        required=False,
    )

    time_field = schema.Time(
        title=u"Time field",
        description=u"zope.schema.Time",
        required=False,
    )

    timedelta_field = schema.Timedelta(
        title=u"Timedelta field",
        description=u"zope.schema.Timedelta",
        required=False,
    )

    # Relation Fields
    relationchoice_field = RelationChoice(
        title=u"Relationchoice field",
        description=u"z3c.relationfield.schema.RelationChoice",
        vocabulary="plone.app.vocabularies.Catalog",
        required=False,
    )

    relationlist_field = RelationList(
        title=u"Relationlist Field",
        description=u"z3c.relationfield.schema.RelationList",
        default=[],
        value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"),
        required=False,
        missing_value=[],
    )

    relationchoice_field_constrained = RelationChoice(
        title=u"Relationchoice field (only allows Documents)",
        description=u"z3c.relationfield.schema.RelationChoice",
        vocabulary="plone.app.vocabularies.Catalog",
        required=False,
    )
    directives.widget(
        "relationchoice_field_constrained",
        RelatedItemsFieldWidget,
        pattern_options={"selectableTypes": ["Document"]},
    )

    relationlist_field_constrained = RelationList(
        title=u"Relationlist Field (only allows Documents and Events)",
        description=u"z3c.relationfield.schema.RelationList",
        default=[],
        value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"),
        required=False,
        missing_value=[],
    )
    directives.widget(
        "relationlist_field_constrained",
        RelatedItemsFieldWidget,
        pattern_options={"selectableTypes": ["Document", "Event"]},
    )

    relationlist_field_search_mode = RelationList(
        title=
        u"Relationlist Field in Search Mode (constrained to published Documents and Events)",
        description=u"z3c.relationfield.schema.RelationList",
        default=[],
        value_type=RelationChoice(source=CatalogSource(
            portal_type=["Document", "Event"], review_state="published")),
        required=False,
        missing_value=[],
    )
    directives.widget(
        "relationlist_field_search_mode",
        RelatedItemsFieldWidget,
        pattern_options={
            "baseCriteria":
            [  # This is a optimization that limits the catalog-query
                {
                    "i": "portal_type",
                    "o": "plone.app.querystring.operation.selection.any",
                    "v": ["Document", "Event"],
                },
                {
                    "i": "review_state",
                    "o": "plone.app.querystring.operation.selection.any",
                    "v": "published",
                },
            ],
            "mode":
            "search",
        },
    )

    # From here on we use other widgets than the default RelatedItemsFieldWidget

    # This one also works in Volto!
    # All other options use the default ObjectWidget in Volto so far.
    relationchoice_field_select = RelationChoice(
        title=u"RelationChoice with Select Widget",
        vocabulary=StaticCatalogVocabulary({
            "portal_type": ["Document", "Event"],
            "review_state": "published",
        }),
        required=False,
    )
    directives.widget(
        "relationchoice_field_select",
        SelectFieldWidget,
    )

    relationchoice_field_radio = RelationChoice(
        title=
        u"RelationChoice with Radio Widget (and customized title-template)",
        vocabulary=StaticCatalogVocabulary(
            {
                "portal_type": ["Document", "Event"],
                "review_state": "published",
            },
            title_template="{brain.Title}",
        ),  # Set a custom vocabulary item title
        required=False,
    )
    directives.widget(
        "relationchoice_field_radio",
        RadioFieldWidget,
    )

    relationlist_field_select = RelationList(
        title=
        u"RelationList with select widget with items from a named vocabulary",
        value_type=RelationChoice(
            vocabulary="example.vocabularies.documents", ),
        required=False,
    )
    directives.widget(
        "relationlist_field_select",
        SelectFieldWidget,
        pattern_options={
            "closeOnSelect":
            False,  # Select2 option to leave dropdown open for multiple selection
        },
    )

    relationlist_field_checkbox = RelationList(
        title=u"RelationList with Checkboxes",
        value_type=RelationChoice(
            vocabulary="example.vocabularies.documents", ),
        required=False,
    )
    directives.widget(
        "relationlist_field_checkbox",
        CheckBoxFieldWidget,
    )

    relationchoice_field_ajax_select = RelationChoice(
        title=u"Relationchoice Field with AJAXSelect",
        description=u"z3c.relationfield.schema.RelationChoice",
        vocabulary=StaticCatalogVocabulary({
            "portal_type": ["Document", "Event"],
        }),
        required=False,
    )
    directives.widget(
        "relationchoice_field_ajax_select",
        AjaxSelectFieldWidget,
        vocabulary=StaticCatalogVocabulary({
            "portal_type": ["Document", "Event"],
        }),
        pattern_options={  # Options for Select2
            "minimumInputLength":
            2,  # - Don't query until at least two characters have been typed
            "ajax": {
                "quietMillis": 500
            },  # - Wait 500ms after typing to make query
        },
    )

    relationlist_field_ajax_select = RelationList(
        title=u"Relationlist Field with AJAXSelect",
        description=u"z3c.relationfield.schema.RelationList",
        value_type=RelationChoice(vocabulary=StaticCatalogVocabulary({
            "portal_type": ["Document", "Event"],
            "review_state":
            "published",
        })),
        required=False,
    )
    directives.widget(
        "relationlist_field_ajax_select",
        AjaxSelectFieldWidget,
        vocabulary=StaticCatalogVocabulary(
            {
                "portal_type": ["Document", "Event", "Folder"],
            },
            title_template="{brain.Type}: {brain.Title} at {path}",
        ),  # Custom item rendering
        pattern_options={  # Options for Select2
            "minimumInputLength":
            2,  # - Don't query until at least two characters have been typed
            "ajax": {
                "quietMillis": 500
            },  # - Wait 500ms after typing to make query
        },
    )

    # These look like relationsfields (see above) but only store the uuid(s) of the selected target
    # as a string in a the field instead of a RelationValue.
    # A good way to use these is in combination with a index that allows you to query these connenctions.
    uuid_choice_field = schema.Choice(
        title=u"Choice field with RelatedItems widget storing uuids",
        description=u"schema.Choice",
        vocabulary="plone.app.vocabularies.Catalog",
        required=False,
    )
    directives.widget("uuid_choice_field", RelatedItemsFieldWidget)

    uuid_list_field = schema.List(
        title=u"List Field with RelatedItems widget storing uuids",
        description=u"schema.List",
        default=[],
        value_type=schema.Choice(vocabulary="plone.app.vocabularies.Catalog"),
        required=False,
        missing_value=[],
    )
    directives.widget("uuid_list_field", RelatedItemsFieldWidget)

    uuid_choice_field_constrained = schema.Choice(
        title=
        u"Choice field with RelatedItems widget storing uuids (only allows Documents)",
        description=u"schema.Choice",
        vocabulary="plone.app.vocabularies.Catalog",
        required=False,
    )
    directives.widget(
        "uuid_choice_field_constrained",
        RelatedItemsFieldWidget,
        pattern_options={"selectableTypes": ["Document"]},
    )

    uuid_list_field_constrained = schema.List(
        title=
        u"List Field with RelatedItems widget storing uuids (only allows Documents and Events)",
        description=u"schema.List",
        default=[],
        value_type=schema.Choice(vocabulary="plone.app.vocabularies.Catalog"),
        required=False,
        missing_value=[],
    )
    directives.widget(
        "uuid_list_field_constrained",
        RelatedItemsFieldWidget,
        pattern_options={"selectableTypes": ["Document", "Folder"]},
    )

    uuid_list_field_search_mode = schema.List(
        title=
        u"List Field with RelatedItems widget in Search Mode storing uuids",
        description=u"schema.List",
        default=[],
        value_type=schema.Choice(source=CatalogSource(
            portal_type=["Document", "Event"], review_state="published")),
        required=False,
        missing_value=[],
    )
    directives.widget(
        "uuid_list_field_search_mode",
        RelatedItemsFieldWidget,
        pattern_options={
            "selectableTypes": ["Document", "Folder"],
            "basePath": "",  # Start the search at the portal root
            "mode": "search",
        },
    )

    # From here on we use other widgets than the default RelatedItemsFieldWidget

    uuid_choice_field_select = schema.Choice(
        title=u"UUID Choice with select widget storing uuids",
        vocabulary=StaticCatalogVocabulary({
            "portal_type": ["Document", "Event"],
            "review_state": "published",
        }),
        required=False,
    )
    directives.widget(
        "uuid_choice_field_select",
        SelectFieldWidget,
    )

    uuid_choice_field_radio = schema.Choice(
        title=u"RelationChoice with Radio widget storing uuids",
        vocabulary=StaticCatalogVocabulary(
            {
                "portal_type": ["Document", "Event"],
                "review_state": "published",
            },
            title_template="{brain.Title}",
        ),  # Set a custom vocabulary item title
        required=False,
    )
    directives.widget(
        "uuid_choice_field_radio",
        RadioFieldWidget,
    )

    uuid_list_field_select = schema.List(
        title=
        u"RelationList with select widget with items from a named vocabulary storing uuids",
        value_type=schema.Choice(
            vocabulary="example.vocabularies.documents", ),
        required=False,
    )
    directives.widget(
        "uuid_list_field_select",
        SelectFieldWidget,
        pattern_options={
            "closeOnSelect":
            False,  # Select2 option to leave dropdown open for multiple selection
        },
    )

    uuid_list_field_checkbox = schema.List(
        title=u"RelationList with Checkboxes storing uuids",
        value_type=schema.Choice(
            vocabulary="example.vocabularies.documents", ),
        required=False,
    )
    directives.widget(
        "uuid_list_field_checkbox",
        CheckBoxFieldWidget,
    )

    uuid_choice_field_ajax_select = schema.Choice(
        title=u"Relationchoice Field with AJAXSelect storing uuids",
        description=u"z3c.relationfield.schema.RelationChoice",
        vocabulary=StaticCatalogVocabulary({
            "portal_type": ["Document", "Event"],
        }),
        required=False,
    )
    directives.widget(
        "uuid_choice_field_ajax_select",
        AjaxSelectFieldWidget,
        vocabulary=StaticCatalogVocabulary({
            "portal_type": ["Document", "Event"],
        }),
        pattern_options={  # Options for Select2
            "minimumInputLength":
            2,  # - Don't query until at least two characters have been typed
            "ajax": {
                "quietMillis": 500
            },  # - Wait 500ms after typing to make query
        },
    )

    uuid_list_field_ajax_select = schema.List(
        title=u"Relationlist Field with AJAXSelect storing uuids",
        description=u"z3c.relationfield.schema.RelationList",
        value_type=schema.Choice(vocabulary=StaticCatalogVocabulary({
            "portal_type": ["Document", "Event"],
            "review_state":
            "published",
        })),
        required=False,
    )
    directives.widget(
        "uuid_list_field_ajax_select",
        AjaxSelectFieldWidget,
        vocabulary=StaticCatalogVocabulary(
            {
                "portal_type": ["Document", "Event"],
            },
            title_template="{brain.Type}: {brain.Title} at {path}",
        ),  # Custom item rendering
        pattern_options={  # Options for Select2
            "minimumInputLength":
            2,  # - Don't query until at least two characters have been typed
            "ajax": {
                "quietMillis": 500
            },  # - Wait 500ms after typing to make query
            "closeOnSelect":
            False,  # - Leave dropdown open for multiple selection
        },
    )

    # Number fields
    int_field = schema.Int(
        title=u"Integer Field (e.g. 12)",
        description=u"zope.schema.Int",
        required=False,
    )

    float_field = schema.Float(
        title=u"Float field, e.g. 12.7",
        description=u"zope.schema.Float",
        required=False,
    )

    # Text fields
    email_field = Email(
        title=u"Email field",
        description=
        u"A simple input field for a email (plone.schema.email.Email)",
        required=False,
    )

    uri_field = schema.URI(
        title=u"URI field",
        description=u"A simple input field for a URLs (zope.schema.URI)",
        required=False,
    )

    richtext_field = RichText(
        title=u"RichText field",
        description=
        u"This uses a richtext editor. (plone.app.textfield.RichText)",
        max_length=2000,
        required=False,
    )

    sourcetext_field = schema.SourceText(
        title=u"SourceText field",
        description=u"zope.schema.SourceText",
        required=False,
    )

    ascii_field = schema.ASCII(
        title=u"ASCII field",
        description=u"zope.schema.ASCII",
        required=False,
    )

    bytesline_field = schema.BytesLine(
        title=u"BytesLine field",
        description=u"zope.schema.BytesLine",
        required=False,
    )

    asciiline_field = schema.ASCIILine(
        title=u"ASCIILine field",
        description=u"zope.schema.ASCIILine",
        required=False,
    )

    pythonidentifier_field = schema.PythonIdentifier(
        title=u"PythonIdentifier field",
        description=u"zope.schema.PythonIdentifier",
        required=False,
    )

    dottedname_field = schema.DottedName(
        title=u"DottedName field",
        description=u"zope.schema.DottedName",
        required=False,
    )

    # dict_field = schema.Dict(
    #     title=u'Dict field',
    #     description=u"zope.schema.Dict",
    #     required=False,
    #     key_type=schema.TextLine(
    #         title=u'Key',
    #         required=False,
    #     ),
    #     value_type=schema.TextLine(
    #         title=u'Value',
    #         required=False,
    #     ),
    # )

    # vocabularyterms_field = Dict(  # we use the plone.schema field Dict not zope.schema field to use the attribute 'widget'
    #     title=u"Vocabulary terms field",
    #     description=u"plone.schema.Dict field with value_type schema.TextLine and frontend widget 'VocabularyTermsWidget'",
    #     required=False,
    #     key_type=schema.TextLine(
    #         title=u"Key",
    #         required=False,
    #     ),
    #     value_type=schema.TextLine(
    #         title=u"Value",
    #         required=False,
    #     ),
    #     widget="vocabularyterms",  # we use the widget attribute to apply the frontend widget VocabularyWidget
    # )

    # vocabularytermstranslation_field = Dict(  # we use the plone.schema field Dict not zope.schema field to use the attribute 'widget'
    #     title=u"Vocabulary terms field with translations",
    #     description=u"plone.schema.Dict field with value_type Dict and frontend widget 'VocabularyTermsWidget'",
    #     required=False,
    #     key_type=schema.TextLine(
    #         title=u"Key",
    #         required=False,
    #     ),
    #     value_type=Dict(  # we use the plone.schema field Dict not zope.schema field to use the attribute 'widget'
    #         title=u"Term translation",
    #         description=u"plone.schema.Dict field for translations of vocabulary term",
    #         required=True,
    #         key_type=schema.TextLine(
    #             title=u"Key",
    #             required=False,
    #         ),
    #         value_type=schema.TextLine(
    #             title=u"Value",
    #             required=False,
    #         ),
    #     ),
    #     widget="vocabularyterms",  # we use the widget attribute to apply the frontend widget VocabularyWidget
    # )

    # dict_field_with_choice = schema.Dict(
    #     title=u'Dict field with key and value as choice',
    #     description=u"zope.schema.Dict",
    #     required=False,
    #     key_type=schema.Choice(
    #         title=u'Key',
    #         values=[u'One', u'Two', u'Three'],
    #         required=False,
    #         ),
    #     value_type=schema.Set(
    #         title=u'Value',
    #         value_type=schema.Choice(
    #             values=[u'Beginner', u'Advanced', u'Professional'],
    #             ),
    #         required=False,
    #         missing_value={},
    #         ),
    #     )

    datagrid_field = schema.List(
        title=u"Datagrid field",
        description=u"schema.List",
        value_type=DictRow(title=u"Table", schema=IMyRowSchema),
        default=[],
        required=False,
    )
    directives.widget("datagrid_field", DataGridFieldFactory)
예제 #29
0
class IEasyForm(Schema):
    """Forms for Plone"""

    #     fieldset(u'models', label=_('Models'),
    #                   fields=['fields_model', 'actions_model'])
    omitted('fields_model', 'actions_model')
    fields_model = Text(
        title=_(u'Fields Model'),
        default=FIELDS_DEFAULT,
    )
    actions_model = Text(
        title=_(u'Actions Model'),
        default=ACTIONS_DEFAULT,
    )
    submitLabel = TextLine(
        title=_(u'label_submitlabel_text', default=u'Submit Button Label'),
        description=_(u'help_submitlabel_text', default=u''),
        default=u'Submit',
        required=False,
    )
    useCancelButton = Bool(
        title=_(u'label_showcancel_text', default=u'Show Reset Button'),
        description=_(u'help_showcancel_text', default=u''),
        default=False,
        required=False,
    )
    resetLabel = TextLine(
        title=_(u'label_reset_button', default=u'Reset Button Label'),
        description=_(u'help_reset_button', default=u''),
        default=u'Reset',
        required=False,
    )
    method = Choice(
        title=_(u'label_method', default=u'Form method'),
        description=_(u'help_method', default=u''),
        default=u'post',
        required=False,
        vocabulary=FORM_METHODS,
    )
    form_tabbing = Bool(
        title=_(u'label_form_tabbing', default=u'Turn fieldsets to tabs'),
        description=_(u'help_form_tabbing', default=u''),
        default=True,
        required=False,
    )
    default_fieldset_label = TextLine(
        title=_(u'label_default_fieldset_label_text',
                default=u'Custom Default Fieldset Label'),
        description=_(
            u'help_default_fieldset_label_text',
            default=u'This field allows you to change default fieldset label.'
        ),
        required=False,
        default=u'',
    )
    unload_protection = Bool(
        title=_(u'label_unload_protection', default=u'Unload protection'),
        description=_(u'help_unload_protection', default=u''),
        default=True,
        required=False,
    )
    CSRFProtection = Bool(
        title=_(u'label_csrf', default=u'CSRF Protection'),
        description=_(u'help_csrf',
                      default=u'Check this to employ Cross-Site '
                      u'Request Forgery protection. Note that only HTTP Post '
                      u'actions will be allowed.'),
        default=True,
        required=False,
    )
    write_permission(forceSSL=EDIT_ADVANCED_PERMISSION)
    forceSSL = Bool(
        title=_(u'label_force_ssl', default=u'Force SSL connection'),
        description=_(
            u'help_force_ssl',
            default=u''
            u'Check this to make the form redirect to an SSL-enabled '
            u'version of itself (https://) if accessed via a non-SSL '
            u'URL (http://).  In order to function properly, '
            u'this requires a web server that has been configured to '
            u'handle the HTTPS protocol on port 443 and forward it to Zope.'),
        default=False,
        required=False,
    )
    formPrologue = RichText(
        title=_(u'label_prologue_text', default=u'Form Prologue'),
        description=_(
            u'help_prologue_text',
            default=u'This text will be displayed above the form fields.'),
        required=False,
    )
    formEpilogue = RichText(
        title=_(u'label_epilogue_text', default=u'Form Epilogue'),
        description=_(
            u'help_epilogue_text',
            default=u'The text will be displayed after the form fields.'),
        required=False,
    )
    fieldset(u'overrides',
             label=_('Overrides'),
             fields=[
                 'thanksPageOverrideAction', 'thanksPageOverride',
                 'formActionOverride', 'onDisplayOverride',
                 'afterValidationOverride', 'headerInjection',
                 'submitLabelOverride'
             ])
    write_permission(thanksPageOverrideAction=EDIT_TALES_PERMISSION)
    thanksPageOverrideAction = Choice(
        title=_(u'label_thankspageoverrideaction_text',
                default=u'Custom Success Action Type'),
        description=_(
            u'help_thankspageoverrideaction_text',
            default=u''
            u'Use this field in place of a thanks-page designation '
            u'to determine final action after calling '
            u'your action adapter (if you have one). You would usually use '
            u'this for a custom success template or script. '
            u'Leave empty if unneeded. Otherwise, specify as you would a '
            u'CMFFormController action type and argument, '
            u'complete with type of action to execute '
            u'(e.g., "redirect_to" or "traverse_to") '
            u'and a TALES expression. For example, '
            u'"Redirect to" and "string:thanks-page" would redirect to '
            u'"thanks-page".'),
        default=u'redirect_to',
        required=False,
        vocabulary=customActions,
    )
    write_permission(thanksPageOverride=EDIT_TALES_PERMISSION)
    thanksPageOverride = TextLine(
        title=_(u'label_thankspageoverride_text',
                default=u'Custom Success Action'),
        description=_(
            u'help_thankspageoverride_text',
            default=u''
            u'Use this field in place of a thanks-page designation '
            u'to determine final action after calling '
            u'your action adapter (if you have one). You would usually use '
            u'this for a custom success template or script. '
            u'Leave empty if unneeded. Otherwise, specify as you would a '
            u'CMFFormController action type and argument, '
            u'complete with type of action to execute '
            u'(e.g., "redirect_to" or "traverse_to") '
            u'and a TALES expression. For example, '
            u'"Redirect to" and "string:thanks-page" would redirect to '
            u'"thanks-page".'),
        default=u'',
        constraint=isTALES,
        required=False,
    )
    write_permission(formActionOverride=EDIT_TALES_PERMISSION)
    formActionOverride = TextLine(
        title=_(u'label_formactionoverride_text',
                default=u'Custom Form Action'),
        description=_(u'help_formactionoverride_text',
                      default=u''
                      u'Use this field to override the form action attribute. '
                      u'Specify a URL to which the form will post. '
                      u'This will bypass form validation, success action '
                      u'adapter and thanks page.'),
        default=u'',
        required=False,
        constraint=isTALES,
    )
    write_permission(onDisplayOverride=EDIT_TALES_PERMISSION)
    onDisplayOverride = TextLine(
        title=_(u'label_OnDisplayOverride_text', default=u'Form Setup Script'),
        description=_(
            u'help_OnDisplayOverride_text',
            default=u''
            u'A TALES expression that will be called when the form is '
            u'displayed. '
            u'Leave empty if unneeded. '
            u'The most common use of this field is to call a python script '
            u'that sets defaults for multiple fields by pre-populating '
            u'request.form. '
            u'Any value returned by the expression is ignored. '
            u'PLEASE NOTE: errors in the evaluation of this expression '
            u'will cause an error on form display.'),
        constraint=isTALES,
        required=False,
        default=u'',
    )
    write_permission(afterValidationOverride=EDIT_TALES_PERMISSION)
    afterValidationOverride = TextLine(
        title=_(u'label_AfterValidationOverride_text',
                default=u'After Validation Script'),
        description=_(
            u'help_AfterValidationOverride_text',
            default=u''
            u'A TALES expression that will be called after the form is'
            u'successfully validated, but before calling an action adapter'
            u'(if any) or displaying a thanks page.'
            u'Form input will be in the request.form dictionary.'
            u'Leave empty if unneeded.'
            u'The most common use of this field is to call a python script'
            u'to clean up form input or to script an alternative action.'
            u'Any value returned by the expression is ignored.'
            u'PLEASE NOTE: errors in the evaluation of this expression will'
            u'cause an error on form display.'),
        constraint=isTALES,
        required=False,
        default=u'',
    )
    write_permission(headerInjection=EDIT_TALES_PERMISSION)
    headerInjection = TextLine(
        title=_(u'label_headerInjection_text', default=u'Header Injection'),
        description=_(
            u'help_headerInjection_text',
            default=u''
            u'This override field allows you to insert content into the xhtml '
            u'head. The typical use is to add custom CSS or JavaScript. '
            u'Specify a TALES expression returning a string. The string will '
            u'be inserted with no interpretation. '
            u'PLEASE NOTE: errors in the evaluation of this expression will '
            u'cause an error on form display.'),
        constraint=isTALES,
        required=False,
        default=u'',
    )
    write_permission(submitLabelOverride=EDIT_TALES_PERMISSION)
    submitLabelOverride = TextLine(
        title=_(u'label_submitlabeloverride_text',
                default=u'Custom Submit Button Label'),
        description=_(
            u'help_submitlabeloverride_text',
            default=u''
            u'This override field allows you to change submit button label. '
            u'The typical use is to set label with request parameters. '
            u'Specify a TALES expression returning a string. '
            u'PLEASE NOTE: errors in the evaluation of this expression will '
            u'cause an error on form display.'),
        constraint=isTALES,
        required=False,
        default=u'',
    )
    fieldset(u'thankyou',
             label=_('Thanks Page'),
             fields=[
                 'thankstitle', 'thanksdescription', 'showAll', 'showFields',
                 'includeEmpties', 'thanksPrologue', 'thanksEpilogue'
             ])
    thankstitle = TextLine(title=_(u'label_thankstitle',
                                   default=u'Thanks title'),
                           default=u'Thank You',
                           required=True)
    thanksdescription = Text(
        title=_(u'label_thanksdescription', default=u'Thanks summary'),
        description=_(u'help_thanksdescription',
                      default=u'Used in thanks page.'),
        default=u'Thanks for your input.',
        required=False,
        missing_value=u'',
    )
    #     TODO
    #     obj.setTitle(_(u'pfg_thankyou_title', u'Thank You'))
    #     obj.setDescription(_(u'pfg_thankyou_description', u'Thanks for your input.'))
    showAll = Bool(
        title=_(u'label_showallfields_text', default=u'Show All Fields'),
        description=_(u'help_showallfields_text',
                      default=u''
                      u'Check this to display input for all fields '
                      u'(except label and file fields). If you check '
                      u'this, the choices in the pick box below '
                      u'will be ignored.'),
        default=True,
        required=False,
    )
    showFields = List(
        title=_(u'label_showfields_text', default=u'Show Responses'),
        description=_(
            u'help_showfields_text',
            default=
            u'Pick the fields whose inputs you\'d like to display on the success page.'
        ),
        unique=True,
        required=False,
        value_type=Choice(vocabulary=fieldsFactory),
    )
    includeEmpties = Bool(
        title=_(u'label_includeEmpties_text', default=u'Include Empties'),
        description=_(u'help_includeEmpties_text',
                      default=u''
                      u'Check this to display field titles '
                      u'for fields that received no input. Uncheck '
                      u'to leave fields with no input off the list.'),
        default=True,
        required=False,
    )
    thanksPrologue = RichText(
        title=_(u'label_thanksprologue_text', default=u'Thanks Prologue'),
        description=_(
            u'help_thanksprologue_text',
            default=
            u'This text will be displayed above the selected field inputs.'),
        required=False,
    )
    thanksEpilogue = RichText(
        title=_(u'label_thanksepilogue_text', default=u'Thanks Epilogue'),
        description=_(
            u'help_thanksepilogue_text',
            default=u'The text will be displayed after the field inputs.'),
        required=False,
    )
예제 #30
0
class IQuestion(form.Schema):
    """ A content-type for source code snippets. """
    title = schema.TextLine(title=_(u"Your question"), required=True)
    question = RichText(title=_(u"A description for the question"),
                        required=False)