class IThreecolumnsTile(IExistingContentTile):

    show_text = schema.Bool(title=_(u"Show content text"), default=False)

    show_comments = schema.Bool(
        title=_(u"Show content comments count (if enabled)"),
        default=False,
        required=False,
    )

    show_image = schema.Bool(
        title=_(u"Show content image (if available)"),
        default=True,
        required=False,
    )

    image_scale = schema.Choice(
        title=_(u"Image scale"),
        vocabulary="plone.app.vocabularies.ImagesScales",
        required=False,
        default=u"large")

    tile_class = schema.TextLine(
        title=_(u"Tile additional styles"),
        description=_(u"Insert a list of additional CSS classes that will" +
                      u" be added to the tile"),
        default=u"",
        required=False)

    description_alternative = schema.TextLine(
        title=_(u"Replace the description with a custom text"),
        description=
        _(u"The item's description will be replaced with the text on this field"
          ),
        default=u"",
        required=False)

    contact = schema.TextLine(title=_(u"Contact"),
                              description=_(u"Contact"),
                              default=u"",
                              required=False)

    linkedin = schema.TextLine(title=_(u"LinkedIn"),
                               description=_(u"LinkedIn"),
                               default=u"",
                               required=False)

    picture_credits = schema.TextLine(title=_(u"Foto credits"),
                                      description=_(u"Foto credits"),
                                      default=u"",
                                      required=False)

    view_template = schema.Choice(title=_(u'Display mode'),
                                  source=_(u'Available Threecolumns Views'),
                                  required=True)

    use_only_two = schema.Bool(
        title=_(u"Use only the last two columns"),
        default=False,
        required=False,
    )

    form.omitted('show_text')
    form.omitted('show_comments')
    form.omitted('tile_class')
示例#2
0
class IMailchimpSettings(Interface):
    """Global mailchimp settings. This describes records stored in the
    configuration registry and obtainable via plone.registry.
    """

    api_key = schema.TextLine(
        title=_(u"MailChimp API Key"),
        description=_(
            u"help_api_key",
            default=u"Enter in your MailChimp key here (.e.g. " +
                    u"'8b785dcabe4b5aa24ef84201ea7dcded-us4'). Log into " +
                    u"mailchimp.com, go to account -> extras -> API Keys & " +
                    u"Authorized Apps and copy the API Key to this field."
        ),
        default=u"",
        required=True
    )

    email_type = schema.Choice(
        title=_(u"email_type"),
        description=_(
            u"help_email_type",
            default=u"Email type preference for the email (html, text, or "
                    u"mobile defaults to html)"),
        vocabulary="collective.mailchimp.vocabularies.EmailType",
        default="html",
        required=True,
    )

    email_type_is_optional = schema.Bool(
        title=_(u"email_type_is_optional"),
        description=_(
            u"help_email_type_is_optional",
            default=u"Let users choose their email type preference in the "
                    u"newsletter subscription form."
        ),
        required=True,
        default=False
    )

    default_list = schema.Choice(
        title=_(u"default_list"),
        description=_(
            u"help_default_list",
            default=u"Default list which is used in the @@newsletter view if "
                    u"no list_id param is provided."),
        vocabulary="collective.mailchimp.vocabularies.AvailableLists",
        required=False,
    )

    double_optin = schema.Bool(
        title=_(u"double_optin"),
        description=_(
            u"help_double_optin",
            default=u"Flag to control whether a double opt-in confirmation "
                    u"message is sent, defaults to true. Abusing this may "
                    u"cause your account to be suspended."
        ),
        required=True,
        default=True
    )

    update_existing = schema.Bool(
        title=_(u"update_existing"),
        description=_(
            u"help_update_existing",
            default=u"Flag to control whether existing subscribers should be "
                    u"updated instead of throwing an error, defaults to false"
        ),
        required=True,
        default=False
    )

    replace_interests = schema.Bool(
        title=_(u"replace_interests"),
        description=_(
            u"help_replace_interests",
            default=u"Flag to determine whether we replace the interest "
                    u"groups with the groups provided or we add the provided"
                    u"groups to the member's interest groups (optional, "
                    u"defaults to true)"
        ),
        required=True,
        default=True
    )

    send_welcome = schema.Bool(
        title=_(u"send_welcome"),
        description=_(
            u"help_send_welcome",
            default=u"If your double_optin is false and this is true, we "
                    u"will send your lists Welcome Email if this subscribe "
                    u"succeeds - this will *not* fire if we end up updating "
                    u"an existing subscriber. If double_optin is true, this "
                    u"has no effect. defaults to false."
        ),
        required=True,
        default=False
    )

    @invariant
    def valid_api_key(data):
        if len(data.api_key) == 0:
            return
        parts = data.api_key.split('-')
        if len(parts) != 2:
            raise Invalid(
                u"Your MailChimp API key is not valid. Please go " +
                u"to mailchimp.com and check your API key.")
示例#3
0
class ITask(model.Schema):
    """Define the task schema."""

    model.fieldset(
        u'common',
        label=_(u'fieldset_common', default=u'Common'),
        fields=[
            u'title',
            u'issuer',
            u'task_type',
            u'responsible_client',
            u'responsible',
            u'deadline',
            u'text',
            u'relatedItems',
        ],
    )

    model.fieldset(
        u'additional',
        label=_(u'fieldset_additional', u'Additional'),
        fields=[
            u'expectedStartOfWork',
            u'expectedDuration',
            u'expectedCost',
            u'effectiveDuration',
            u'effectiveCost',
            u'date_of_completion',
        ],
    )

    dexteritytextindexer.searchable('title')

    title = schema.TextLine(
        title=_(u"label_title", default=u"Title"),
        description=_('help_title', default=u""),
        required=True,
        max_length=256,
    )

    form.widget('issuer', KeywordFieldWidget, async=True)

    issuer = schema.Choice(
        title=_(u"label_issuer", default=u"Issuer"),
        source=UsersContactsInboxesSourceBinder(),
        required=True,
    )

    form.widget(task_type='z3c.form.browser.radio.RadioFieldWidget')

    task_type = schema.Choice(
        title=_(u'label_task_type', default=u'Task Type'),
        description=_('help_task_type', default=u''),
        required=True,
        readonly=False,
        default=None,
        missing_value=None,
        source=util.getTaskTypeVocabulary,
    )

    form.mode(responsible_client='hidden')

    responsible_client = schema.Choice(
        title=_(
            u'label_resonsible_client',
            default=u'Responsible Client',
        ),
        description=_(
            u'help_responsible_client',
            default=u'',
        ),
        vocabulary='opengever.ogds.base.OrgUnitsVocabularyFactory',
        required=True,
    )

    form.widget('responsible', KeywordFieldWidget, async=True)

    responsible = schema.Choice(
        title=_(u"label_responsible", default=u"Responsible"),
        description=_(u"help_responsible", default=""),
        source=AllUsersInboxesAndTeamsSourceBinder(include_teams=True),
        required=True,
    )

    form.widget(deadline=DatePickerFieldWidget)

    deadline = schema.Date(
        title=_(u"label_deadline", default=u"Deadline"),
        description=_(u"help_deadline", default=u""),
        required=True,
        defaultFactory=deadline_default,
    )

    form.widget(date_of_completion=DatePickerFieldWidget)
    form.mode(IAddForm, date_of_completion=HIDDEN_MODE)

    date_of_completion = schema.Date(
        title=_(u"label_date_of_completion", default=u"Date of completion"),
        description=_(u"help_date_of_completion", default=u""),
        required=False,
    )

    dexteritytextindexer.searchable('text')
    model.primary('text')

    text = schema.Text(
        title=_(u"label_text", default=u"Text"),
        description=_(u"help_text", default=u""),
        required=False,
    )

    relatedItems = RelationList(
        title=_(u'label_related_items', default=u'Related Items'),
        default=[],
        missing_value=[],
        value_type=RelationChoice(
            title=u"Related",
            source=DossierPathSourceBinder(
                portal_type=("opengever.document.document", "ftw.mail.mail"),
                navigation_tree_query={
                    'object_provides': [
                        'opengever.dossier.behaviors.dossier.IDossierMarker',
                        'opengever.document.document.IDocumentSchema',
                        'opengever.task.task.ITask',
                        'ftw.mail.mail.IMail',
                        'opengever.meeting.proposal.IProposal',
                    ],
                },
            ),
        ),
        required=False,
    )

    form.widget(expectedStartOfWork=DatePickerFieldWidget)

    expectedStartOfWork = schema.Date(
        title=_(u"label_expectedStartOfWork", default="Start with work"),
        required=False,
    )

    expectedDuration = schema.Float(
        title=_(
            u"label_expectedDuration",
            default="Expected duration",
        ),
        description=_(u"help_expectedDuration", default="Duration in h"),
        required=False,
    )

    expectedCost = schema.Float(
        title=_(u"label_expectedCost", default="expected cost"),
        description=_(u"help_expectedCost", default="Cost in CHF"),
        required=False,
    )

    effectiveDuration = schema.Float(
        title=_(u"label_effectiveDuration", default="effective duration"),
        description=_(u"help_effectiveDuration", default="Duration in h"),
        required=False,
    )

    effectiveCost = schema.Float(
        title=_(u"label_effectiveCost", default="effective cost"),
        description=_(u"help_effectiveCost", default="Cost in CHF"),
        required=False,
    )

    form.omitted('predecessor')
    predecessor = schema.TextLine(title=_(u'label_predecessor',
                                          default=u'Predecessor'),
                                  required=False)
class IAssignedDescriptiveCataloguer(form.Schema):
    cataloguer = schema.Choice(
        title=_(u"Cataloguer"),
        source=possibleDescriptiveCataloguers,
        required=False,
    )
class IAssignedSubjectCataloguer(form.Schema):
    cataloguer = schema.Choice(
        title=_(u"Cataloguer"),
        source=possibleSubjectCataloguers,
        required=False,
    )
示例#6
0
class IDiscussionSettings(Interface):
    """Global discussion settings. This describes records stored in the
    configuration registry and obtainable via plone.registry.
    """

    # Todo: Write a short hint, that other discussion related options can
    # be found elsewhere in the Plone control panel:
    #
    # - Types control panel: Allow comments on content types
    # - Search control panel: Show comments in search results

    globally_enabled = schema.Bool(
        title=_(u"label_globally_enabled",
                default=u"Globally enable comments"),
        description=_(
            u"help_globally_enabled",
            default=u"If selected, users are able to post comments on the "
            u"site. Though, you have to enable comments for "
            u"specific content types, folders or content objects "
            u"before users will be able to post comments."),
        required=False,
        default=False,
    )

    anonymous_comments = schema.Bool(
        title=_(u"label_anonymous_comments",
                default="Enable anonymous comments"),
        description=_(u"help_anonymous_comments",
                      default=u"If selected, anonymous users are able to post "
                      u"comments without loggin in. It is highly "
                      u"recommended to use a captcha solution to prevent "
                      u"spam if this setting is enabled."),
        required=False,
        default=False,
    )

    moderation_enabled = schema.Bool(
        title=_(u"label_moderation_enabled",
                default="Enable comment moderation"),
        description=_(
            u"help_moderation_enabled",
            default=u"If selected, comments will enter a 'Pending' state "
            u"in which they are invisible to the public. A user "
            u"with the 'Review comments' permission ('Reviewer' "
            u"or 'Manager') can approve comments to make them "
            u"visible to the public. If you want to enable a "
            u"custom comment workflow, you have to go to the "
            u"types control panel."),
        required=False,
        default=False,
    )

    edit_comment_enabled = schema.Bool(
        title=_(u"label_edit_comment_enabled",
                default="Enable editing of comments"),
        description=_(u"help_edit_comment_enabled",
                      default=u"If selected, supports editing and deletion "
                      "of comments for users with the 'Edit comments' "
                      "permission."),
        required=False,
        default=False,
    )

    text_transform = schema.Choice(
        title=_(u"label_text_transform", default="Comment text transform"),
        description=_(
            u"help_text_transform",
            default=u"Use this setting to choose if the comment text " +
            u"should be transformed in any way. You can choose "
            u"between 'Plain text' and 'Intelligent text'. " +
            u"'Intelligent text' converts plain text into HTML " +
            u"where line breaks and indentation is preserved, " +
            u"and web and email addresses are made into " +
            u"clickable links."),
        required=True,
        default='text/plain',
        vocabulary='plone.app.discussion.vocabularies.TextTransformVocabulary',
    )

    captcha = schema.Choice(
        title=_(u"label_captcha", default="Captcha"),
        description=_(u"help_captcha",
                      default=u"Use this setting to enable or disable Captcha "
                      u"validation for comments. Install "
                      u"plone.formwidget.captcha, "
                      u"plone.formwidget.recaptcha, collective.akismet, or "
                      u"collective.z3cform.norobots if there are no options "
                      u"available."),
        required=True,
        default='disabled',
        vocabulary='plone.app.discussion.vocabularies.CaptchaVocabulary',
    )

    show_commenter_image = schema.Bool(
        title=_(u"label_show_commenter_image",
                default=u"Show commenter image"),
        description=_(
            u"help_show_commenter_image",
            default=u"If selected, an image of the user is shown next to "
            u"the comment."),
        required=False,
        default=True,
    )

    moderator_notification_enabled = schema.Bool(
        title=_(u"label_moderator_notification_enabled",
                default=u"Enable moderator email notification"),
        description=_(
            u"help_moderator_notification_enabled",
            default=u"If selected, the moderator is notified if a comment "
            u"needs attention. The moderator email address can " +
            u"be found in the 'Mail settings' control panel "
            u"(Site 'From' address)"),
        required=False,
        default=False,
    )

    moderator_email = schema.ASCIILine(
        title=_(u'label_moderator_email', default=u'Moderator Email Address'),
        description=_(u'help_moderator_email',
                      default=u"Address to which moderator notifications "
                      u"will be sent."),
        required=False,
    )

    user_notification_enabled = schema.Bool(
        title=_(u"label_user_notification_enabled",
                default=u"Enable user email notification"),
        description=_(u"help_user_notification_enabled",
                      default=u"If selected, users can choose to be notified "
                      u"of new comments by email."),
        required=False,
        default=False)

    anonymous_email_enabled = schema.Bool(
        title=_(u"label_anonymous_email_enabled",
                default=u"Enable anonymous email field"),
        description=_(u"help_anonymous_email_enabled",
                      default=u"If selected, anonymous user will have to "
                      u"give their email."),
        required=False,
        default=False)
示例#7
0
                    token=info.type_key,
                    title=_(naming.split_camel(info.domain_model.__name__))
                ))
        terms.sort(key=lambda item:item.value)
        if len(terms) > 1:
            all_types=",".join([t.value for t in terms])
            terms.insert(0, schema.vocabulary.SimpleTerm(
                value=all_types,
                token=all_types,
                title=_(u"* all document types")
            ))
        return schema.vocabulary.SimpleVocabulary(terms)
search_document_types = SearchDocumentTypes()

doc_type = schema.Choice(title=_("document type"),
    vocabulary=search_document_types,
    required=False
)

search_group = schema.Choice(title=_("group type"),
    vocabulary=search_group_types,
    default="*",
    required=False
)

class SearchWorkflowStatus(BaseVocabularyFactory):
    """workflow document status vocabulary"""
    def __call__(self, context):
        terms = []
        seen_keys = []
        for info in get_search_doc_types(context):
            if info.workflow and info.workflow.has_feature("workspace"):
示例#8
0
class IFundraisingSettings(Interface):
    """Global settings for collective.salesforce.fundraising
    configuration registry and obtainable via plone.registry.
    """

    organization_name = schema.TextLine(
        title=_(u"Organization Name"),
        description=
        _(u"Enter your organization's official name.  This is used mostly on donation receipts."
          ),
        required=True,
    )

    default_thank_you_message = schema.Text(
        title=_(u"Default Thank You Message"),
        description=_(
            u"The default Thank You Message for Fundraising Campaigns"),
        default=
        u"<p>Your donation was processed successfully.  Thank you for your support.</p>",
        required=True,
    )

    default_personal_appeal = schema.Text(
        title=_(u"Default Personal Appeal"),
        description=
        _(u"The default Personal Appeal for Personal Campaign Pages.  This can be overridden on a campaign by campaign basis"
          ),
        default=
        u"<p>I am helping raise money for a great organization.  Please donate to help me reach my goal.</p>",
        required=True,
    )

    default_personal_thank_you = schema.Text(
        title=_(u"Default Personal Thank You"),
        description=
        _(u"The default Personal Thank You Message for Personal Campaign Pages"
          ),
        default=
        u"<p>Thank you for your donation and for helping me reach my goal.</p>",
        required=True,
    )

    default_header_image_url = schema.TextLine(
        title=_(u"Default Header Image URL"),
        description=
        u"If provided, the specified image will be rendered as the header image for fundraising campaigns unless the campaign uses its header_image field to override the default setting.",
        required=False,
    )

    default_donation_form_header = schema.TextLine(
        title=_(u"Default Header for Donation Forms"),
        description=
        _(u"The text entered here will appear as a header above donation forms.  If left empty, the default value 'Make A Donation' will be used.  This value may be overridden by providing a value on a specific fundraising campaign."
          ),
        default=u'',
        required=False,
    )

    default_donation_form_description = schema.Text(
        title=_(u"Default Description for Donation Forms"),
        description=
        _(u"The text entered here will be displayed above donation forms.  If left empty, no text will appear.  HTML is allowed. This value may be overridden by providing a value on a specific fundraising campaign"
          ),
        default=u'',
        required=False,
    )

    default_donation_receipt_legal = schema.Text(
        title=_(u"Donation Receipt Legal Text"),
        description=
        _(u"Enter any legal text you want displayed at the bottom of html receipt.  For example, you might want to state that all donations are tax deductable and include the organization's Tax ID"
          ),
        required=False,
    )

    ssl_seal = schema.Text(
        title=_(u"SSL Seal HTML Snippet"),
        description=
        _(u"If provided, this snippet of HTML will be inserted into the donation forms"
          ),
        required=False,
    )

    thank_you_email_subject = schema.Text(
        title=_(u"Thank You Email Subject"),
        description=
        _(u"Enter the email subject for Thank You email messages with donation receipt"
          ),
        required=False,
        default=_(u"Thank you for your donation"))

    thank_you_share_message = schema.Text(
        title=_(u"Thank You Share Message"),
        description=
        _(u"Enter the Share Message you want to present in the Share widget on the Thank You page after a donation.  {{ amount }} will be replaced with the amount"
          ),
        required=False,
        default=
        _(u"I just donated ${{ amount }} to a great cause.  You should join me."
          ),
    )

    default_campaign = schema.TextLine(
        title=_(u"Default Campaign UID"),
        description=_(u"The id of the default campaign for this site."),
        required=False,
    )

    email_header = schema.Text(
        title=_(u"Email Header HTML"),
        description=
        _(u"Enter any html you want to always render in the header of outbound emails."
          ),
        required=False,
    )

    email_footer = schema.Text(
        title=_(u"Email Footer HTML"),
        description=
        _(u"Enter any html you want to always render in the footer of outbound emails."
          ),
        required=False,
    )

    default_email_thank_you = schema.Choice(
        title=_(u"Email Template - Thank You Email"),
        description=
        _(u"Provide the path to the chimpdrill template to use by default for thank you emails."
          ),
        required=False,
        vocabulary=u'collective.salesforce.fundraising.thank_you_templates',
    )

    default_email_honorary = schema.Choice(
        title=_(u"Email Template - Honorary Email"),
        description=
        _(u"Provide the path to the chimpdrill template to use by default for honorary notification emails."
          ),
        required=False,
        vocabulary=u'collective.salesforce.fundraising.honorary_templates',
    )

    default_email_memorial = schema.Choice(
        title=_(u"Email Template - Memorial Email"),
        description=
        _(u"Provide the path to the chimpdrill template to use by default for memorial notification emails."
          ),
        required=False,
        vocabulary=u'collective.salesforce.fundraising.memorial_templates',
    )

    default_email_personal_page_created = schema.Choice(
        title=_(u"Email Template - Personal Page Created Email"),
        description=
        _(u"Provide the path to the chimpdrill template to use by default for personal page created emails."
          ),
        required=False,
        vocabulary=
        u'collective.salesforce.fundraising.personal_page_created_templates',
    )

    default_email_personal_page_donation = schema.Choice(
        title=_(u"Email Template - Personal Page Donation Email"),
        description=
        _(u"Provide the path to the chimpdrill template to use by default for personal page donation emails."
          ),
        required=False,
        vocabulary=
        u'collective.salesforce.fundraising.personal_page_donation_templates',
    )

    email_recurring_receipt = schema.Choice(
        title=_(u"Email Template - Recurring Donation Receipt"),
        description=
        _(u"For recurring donations, the email template used to send receipts on recurring charges.  The first charge is sent the normal thank you email."
          ),
        required=False,
        vocabulary=
        u'collective.salesforce.fundraising.recurring_receipt_templates',
    )

    email_recurring_failed_first = schema.Choice(
        title=_(u"Email Template - Recurring Payment Failed, First Time"),
        description=
        _(u"For recurring donations, the email template used to notify a donor that their recurring payment failed to process for the first time."
          ),
        required=False,
        vocabulary=
        u'collective.salesforce.fundraising.recurring_receipt_templates',
    )

    email_recurring_failed_second = schema.Choice(
        title=_(u"Email Template - Recurring Payment Failed, Second Time"),
        description=
        _(u"For recurring donations, the email template used to notify a donor that their recurring payment failed to process for the second time."
          ),
        required=False,
        vocabulary=
        u'collective.salesforce.fundraising.recurring_receipt_templates',
    )

    email_recurring_failed_third = schema.Choice(
        title=_(u"Email Template - Recurring Payment Failed, Third Time"),
        description=
        _(u"For recurring donations, the email template used to notify a donor that their recurring payment failed to process for the third time."
          ),
        required=False,
        vocabulary=
        u'collective.salesforce.fundraising.recurring_receipt_templates',
    )

    email_recurring_cancelled = schema.Choice(
        title=_(u"Email Template - Recurring Donation Cancelled"),
        description=
        _(u"For recurring donations, the email template used to notify a donor that their recurring donation has been cancelled."
          ),
        required=False,
        vocabulary=
        u'collective.salesforce.fundraising.recurring_receipt_templates',
    )

    default_stripe_recurring_plan = schema.TextLine(
        title=_(u"Default Stripe Recurring Plan"),
        description=
        _(u"Enter the ID of the default Stripe plan for recurring donations to be handled directly via Stripe"
          ),
        required=False,
    )

    enable_share_via_email = schema.Bool(
        title=_(u"Enable Share via Email?"),
        description=
        _(u"If enabled, share messages will have a button to share via email which will send an email using Plone's built in mail configuration."
          ),
        required=False,
        default=True,
    )

    default_donation_form = schema.Text(
        title=_(u"Default donation form"),
        description=
        _(u"The name of the form view to be used by default on a fundraising campaign to render the donation form.  This name must match a view's name on the campaign"
          ),
        required=True,
        default=u'donation_form_stripe',
    )

    # FIXME: Add validation for the structure here
    donation_ask_levels = schema.List(
        title=_(u"Donation Ask Levels"),
        description=
        _(u"Enter sets of donation ask amounts one per line in the format ID|1,2,3,4,5,6 and use the value for ID in the url when calling the donation form"
          ),
        default=[
            u"5|5,10,25,50,100,250",
            u"10|10,25,50,100,250,500",
            u"25|25,50,100,250,500,1000",
            u"50|50,100,250,500,1000,2500",
            u"100|100,500,1000,2500,5000,7500",
        ],
        value_type=schema.TextLine(),
    )

    default_donation_ask_one_time = schema.TextLine(
        title=_(u"Default One Time Donation Ask"),
        description=
        _(u"Enter the ID of the default Donation Ask Level set to use for one time donations if no set is specified in the url"
          ),
        default=u"25",
    )

    default_donation_ask_recurring = schema.TextLine(
        title=_(u"Default Recurring Donation Ask"),
        description=
        _(u"Enter the ID of the default Donation Ask Level set to use for recurring donations if no set is specified in the url"
          ),
        default=u"10",
    )

    # FIXME: Add validation for the structure here
    product_ask_levels = schema.List(
        title=_(u"Product Quantity Ask Levels"),
        description=
        _(u"Enter sets of product quanity ask amounts one per line in the format ID|1,2,3,4,5,6 and use the value for ID in the url when calling the donation form"
          ),
        default=[
            u"1|1,2,3,4,5,10",
            u"5|5,10,25,50,75,100",
        ],
        value_type=schema.TextLine(),
    )

    default_product_ask = schema.TextLine(
        title=_(u"Default Product Quantity Ask"),
        description=
        _(u"Enter the ID of the default Product Ask Level set to use for Donation Products if no set is specified in the url"
          ),
        default=u"1",
    )

    default_fundraising_seals = schema.List(
        title=_(u"Default Fundraising Seals"),
        description=
        _(u"Enter the full physical path (from Zope root) to the default seals to display on Fundraising Campaigns"
          ),
        value_type=schema.TextLine(),
        required=False,
    )

    sf_individual_account_id = schema.TextLine(
        title=_(u"Salesforce Individual AccountId"),
        description=
        _(u"The ID of the Account in Salesforce that represents Individuals in the \"bucket account\" model.  This is typically an account named Individual. This account will be used as the default account when creating the Opportuntity object in Salesforce for a donation"
          ),
        required=True,
        default=u'',
    )

    sf_opportunity_record_type_one_time = schema.TextLine(
        title=_(u"Salesforce Opportunity Record Type ID - One Time Donations"),
        description=
        _(u"If provided, any Opportunities created from a one time donation will be created as the specified record type"
          ),
        required=False,
        default=u'',
    )

    sf_opportunity_record_type_recurring = schema.TextLine(
        title=_(
            u"Salesforce Opportunity Record Type ID - Recurring Donations"),
        description=
        _(u"If provided, any Opportunities created from a recurring donation will be created as the specified record type"
          ),
        required=False,
        default=u'',
    )

    sf_opportunity_record_type_product = schema.TextLine(
        title=
        _(u"Salesforce Opportunity Record Type ID = Donation Product Donations"
          ),
        description=
        _(u"If provided, any Opportunities created from a donation product will be created as the specified record type"
          ),
        required=False,
        default=u'',
    )

    sf_recurring_donation_record_type = schema.TextLine(
        title=_(u"Salesforce Recurring Donation Record Type ID"),
        description=
        _(u"If provided, any Recurring Donation profiles created from a recurring donation will be created as the specified record type"
          ),
        required=False,
        default=u'',
    )

    sf_campaign_record_type = schema.TextLine(
        title=_(u"Salesforce Campaign Record Type ID - Fundraising Campaign"),
        description=
        _(u"If provided, any Campaigns in Salesforce created by creating a Fundraising Campaign in this site will be created as the specified record type"
          ),
        required=False,
        default=u'',
    )

    sf_campaign_record_type_personal = schema.TextLine(
        title=_(
            u"Salesforce Campaign Record Type ID - Personal Campaign Page"),
        description=
        _(u"If provided, any Campaigns in Salesforce created by creating a Personal Campaign Page in this site will be created as the specified record type"
          ),
        required=False,
        default=u'',
    )

    sf_campaign_record_type_share = schema.TextLine(
        title=_(u"Salesforce Campaign Record Type ID - Share Message"),
        description=
        _(u"If provided, any Campaigns in Salesforce created by creating a Share Message in this site will be created as the specified record type"
          ),
        required=False,
        default=u'',
    )

    sf_create_campaign_member = schema.Bool(
        title=_(u"Create Salesforce Campaign Member on Donation?"),
        description=
        _(u"If checked, a Campaign Member will be created for the Contact after a donation.  If you're concerned about API usage limits, unchecking this will reduce the number of API calls to process a donation by 1.  This is useful if you either don't care about campaign members on your fundraising campaign (donations are already linked) or if you are using a trigger on Opportunity creation to create the Campaign Member in Salesforce."
          ),
        default=True,
    )

    sf_standard_pricebook_id = schema.TextLine(
        title=_(u"Salesforce Standard Pricebook ID"),
        description=
        _(u"The Salesforce Record ID of the Standard Pricebook.  This value will be autopopulated if left empty."
          ),
        default=u'',
        required=False,
    )

    janrain_api_key = schema.TextLine(
        title=_(u"Janrain API Key"),
        description=
        _(u"If provided, Janrain integration functionality will be turned on allowing for social login and social sharing"
          ),
        required=False,
    )

    janrain_site_id = schema.TextLine(
        title=_(u"Janrain Site ID"),
        description=
        _(u"If you are using Janrain, the Site ID is the name of your instance. You can find it in the urls in the embed code provided through the Janrain control panel"
          ),
        required=False,
    )

    janrain_sharing_app_id = schema.TextLine(
        title=_(u"Janrain App ID"),
        description=
        _(u"If you are using Janrain, enter the value for appId in the embed code provided for your sharing widget"
          ),
        required=False,
    )

    janrain_use_extended_profile = schema.Bool(
        title=_(u"Janrain - Use extended profile?"),
        description=
        _(u"If checked, the auth_info call after authentication will attempt to fetch an extended profile which is only available in the paid versions."
          ),
        required=False,
    )

    campaign_status_completion_threshold = schema.Int(
        title=_(u"Campaign Status Completion Threshold"),
        description=
        _(u"The percentage of campaign goal completion that should be reached before displaying status on campaign pages."
          ),
        default=3,
        required=False,
    )

    personal_campaign_status_completion_threshold = schema.Int(
        title=_(u"Campaign Status Completion Threshold"),
        description=
        _(u"The percentage of personal campaign goal completion that should be reached before displaying status on personal campaign pages."
          ),
        default=0,
        required=False,
    )

    async_error_email = schema.TextLine(
        title=_(u"Async Error Email Address"),
        description=
        _(u"Where to send emails about errors that happen in asynchronous jobs"
          ),
        default=u'*****@*****.**',
        required=False,
    )
示例#9
0
class ISmart(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)

    show_header = schema.Bool(title=_(u'label_show_header',
                                      default=u'Show header'),
                              description=_(u'Renders the header'),
                              required=False,
                              default=True)

    description = schema.TextLine(title=_(u"Portlet description"),
                                  description=_(u"Description of the portlet"),
                                  required=False)

    container_view = schema.Choice(
        title=_(u'label_container_view', default=u'Portlet view to use'),
        description=_(u"""Portlet view to use"""),
        vocabulary="base.portlet.smart.AvailablePortletContainerRenderers",
        required=True)

    query = schema.List(
        title=_(u'label_query', default=u'Search terms'),
        description=_(u"""Define the search terms for the items you want to
            list by choosing what to match on.
            The list of results will be dynamically updated"""),
        value_type=schema.Dict(value_type=schema.Field(),
                               key_type=schema.TextLine()),
        required=False)

    form.mode(sort_on='hidden')
    sort_on = schema.TextLine(
        title=_(u'label_sort_on', default=u'Sort on'),
        description=_(u"Sort the collection on this index"),
        required=False,
    )

    form.mode(sort_order='hidden')
    sort_order = schema.Bool(
        title=_(u'label_sort_reversed', default=u'Reversed order'),
        description=_(u'Sort the results in reversed order'),
        required=False,
    )

    sort_folderorder = schema.Bool(
        title=_(u'label_sort_folderorder', default=u'Order as in folder'),
        description=_(u'Override query sort order using folder order'),
        required=False,
    )

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(u"Specify the maximum number of items to show in the "
                      u"portlet. Leave this blank to show all items."),
        required=False)

    random = schema.Bool(
        title=_(u"Select random items"),
        description=_(u"If enabled, items will be selected randomly from the "
                      u"collection, rather than based on its sort order."),
        required=True,
        default=False)

    more_link = schema.TextLine(
        title=_(u"Show more link"),
        description=_(
            u"Link to display in the footer, leave empty to hide it"),
        required=False)

    more_text = schema.TextLine(
        title=_(u"Show more link text"),
        description=_(u"Label the 'Show more link' defined avobe"),
        default=u'+',
        required=False)
示例#10
0
class INCE(BaseModel):
    """General NCE Item to be used to track non conformance events in the lab
    """

    nce_tracking_number = schema.TextLine(
        title=_(u"Tracking Number"),
        description=_(u"Tracking Number"),
        required=False,
    )

    date_of_NCE = schema.Date(
        title=_(u"Date of NCE"),
        description=_(u"Date of NCE"),
        required=True,
    )

    date_of_nce_discovery = schema.Date(
        title=_(u"Date of NCE Discovery"),
        description=_(u"Date of NCE Discovery"),
        required=True,
    )

    reporter = schema.Choice(
        title=_(u"Operator that is Reporting NCE"),
        description=_(u"Operator that is Reporting NCE"),
        vocabulary=u"plone.principalsource.Users",
        required=False,
    )

    position = schema.TextLine(
        title=_(u"Position of Reporter"),
        description=_(u"Position of Reporter"),
        required=False,
    )

    area_of_operation = schema.Choice(
        title=_(u"Area of Operation"),
        description=_(u"Area of Operation"),
        values=[
            _(u'Scanning'),
            _(u'Accessioning'),
            _(u'Test Preparation'),
            _(u'Blocking'),
            _(u'Testing'),
            _(u'Data Analysis')
        ],
        required=False,
    )

    accession_number = schema.TextLine(
        title=_(u"Accession Number or Batch Number"),
        description=_(u"Accession Number or Batch Number"),
        required=False,
    )

    assay = schema.TextLine(
        title=_(u"Assay"),
        description=_(u"Assay"),
        required=False,
    )

    facility = schema.TextLine(
        title=_(u"Facility where NCE Happened"),
        description=_(u"Facility where NCE Happened"),
        required=False,
    )

    current_date_time = schema.Datetime(
        title=_(u"Datetime of NCE"),
        description=_(u"Datetime of NCE"),
        defaultFactory=currentTime,
        required=True,
    )
    category_primary = schema.Choice(
        title=_(u"Category - Primary"),
        description=_(u"Category - Primary"),
        vocabulary='immunarray.lims.vocabularies.nce.PrimaryNCEVocabulary',
        required=False,
    )

    category_secondary = schema.Choice(
        title=_(u"Category - Secondary"),
        description=_(u"Category - Secondary"),
        vocabulary='immunarray.lims.vocabularies.nce.SecondaryNCEVocabulary',
        required=False,
    )

    category_tertiary = schema.Choice(
        title=_(u"Category - Tertiary"),
        description=_(u"Category - Tertiary"),
        vocabulary='immunarray.lims.vocabularies.nce.TertiaryNCEVocabulary',
        required=False,
    )
    risk_score = schema.Choice(
        title=_(u"Risk Score"),
        description=_(u"Risk Score"),
        values=[_(u'Lowest'), _(u'Intermediate'),
                _(u'High')],
        required=False,
    )
    initial_finding = schema.Text(
        title=_(u"Initial Finding"),
        description=_(u"Initial Finding"),
        required=False,
    )

    first_occurrence = schema.Bool(
        title=_(u"First Occurrence"),
        description=_(u"First Occurrence"),
        required=True,
        default=False,
    )

    persons_involved = schema.TextLine(
        title=_(u"Persons Involved"),
        description=_(u"Persons Involved"),
        required=False,
    )

    remedial_action_type = schema.Choice(
        title=_(u"Remedial Action Type"),
        description=_(u"Remedial Action Type"),
        values=[_(u'Corrective'),
                _(u'Preventive'),
                _(u'Process Improve')],
        required=False,
    )

    remedial_action = schema.Text(
        title=_(u"Remedial Action"),
        description=_(u"Remedial Action"),
        required=False,
    )

    is_follow_up_needed = schema.Bool(
        title=_(u"Is Follow Up Needed?"),
        description=_(u"Is Follow Up Needed?"),
        required=True,
        default=False,
    )

    investigation_needed = schema.Bool(
        title=_(u"Investigation Needed"),
        description=_(u"Investigation Needed"),
        required=True,
        default=False,
    )

    Investigation_tracking_number = schema.TextLine(
        title=_(u"Investigation Tracking Number"),
        description=_(u"Investigation Tracking Number"),
        required=False,
    )
    nce_status = schema.Choice(
        title=_(u"Status"),
        description=_(u"Status"),
        values=[_(u'Closed'),
                _(u'In Process'),
                _(u'Non Resolvable')],
        required=False,
    )
    date_closed = schema.Date(
        title=_(u"Date NCE Closed"),
        description=_(u"Date NCE Closed"),
        required=False,
    )
示例#11
0
文件: core.py 项目: UPCnet/base5.core
class IBaseCoreControlPanelSettings(Interface):
    """ Global Base settings. This describes records stored in the
    configuration registry and obtainable via plone.registry.
    """

    model.fieldset('General', (u'General'),
                   fields=[
                       'user_properties_extender', 'custom_editor_icons',
                       'elasticsearch'
                   ])

    model.fieldset('Ldap', (u'Ldap'),
                   fields=[
                       'alt_ldap_uri', 'alt_bind_dn', 'alt_bindpasswd',
                       'alt_base_dn', 'groups_query', 'user_groups_query',
                       'create_group_type'
                   ])

    user_properties_extender = schema.Choice(
        title=_(u'User properties extender'),
        vocabulary=u'base5.core.controlpanel.core.user_extenders',
        required=False,
        default=u'')

    custom_editor_icons = schema.List(
        title=_(u'Llista personalitzada d\'icones per l\'editor TinyMCE'),
        description=
        _(u'Cada línia és una fila d\'icones. Si es deixa en blanc s\'agafen els valors per defecte. Han d\'omplir-se fins a 4 files obligatòriament.'
          ),
        value_type=schema.TextLine(),
        required=False,
        default=[])

    elasticsearch = schema.TextLine(
        title=_(u"elasticsearch", default=u"ElasticSearch"),
        description=_(
            u"elasticsearch_help",
            default=u"URL del servidor d'ElasticSearch per aquest site"),
        required=False,
        default=u'localhost',
    )

    alt_ldap_uri = schema.TextLine(
        title=_(u"alt_ldap_uri", default=u"alt_ldap_uri"),
        description=_(u"alt_ldap_uri_help",
                      default=u"URL del servidor ldap per aquest site"),
        required=False,
        default=u'',
    )

    alt_bind_dn = schema.TextLine(
        title=_(u"alt_bind_dn", default=u"alt_bind_dn"),
        description=_(u"alt_bind_dn_help", default=u"LDAP bind dn"),
        required=False,
        default=u'',
    )

    alt_bindpasswd = schema.TextLine(
        title=_(u"alt_bindpasswd", default=u"alt_bindpasswd"),
        description=_(u"alt_bindpasswd_help", default=u"LDAP bind password"),
        required=False,
        default=u'',
    )

    alt_base_dn = schema.TextLine(
        title=_(u"alt_base_dn", default=u"alt_base_dn"),
        description=_(u"alt_base_dn_help", default=u"LDAP base dn"),
        required=False,
        default=u'',
    )

    groups_query = schema.TextLine(
        title=_(u"groups_query", default=u"groups_query"),
        description=_(
            u"groups_query_help",
            default=u"LDAP groups query. Ex: (&(objectClass=groupOfNames))"),
        required=False,
        default=u'',
    )

    user_groups_query = schema.TextLine(
        title=_(u"user_groups_query", default=u"user_groups_query"),
        description=_(
            u"user_groups_query_help",
            default=
            u"LDAP user groups query. Ex: (&(objectClass=groupOfNames)(member=%s))"
        ),
        required=False,
        default=u'',
    )

    create_group_type = schema.TextLine(
        title=_(u"create_group_type", default=u"create_group_type"),
        description=_(u"Type of group to create on ldap",
                      default=u"groupOfNames or groupOfUniqueNames"),
        required=False,
        default=u'groupOfNames',
    )
示例#12
0
    def test_collection(self):
        field = schema.List(
            title=u'My field',
            description=u'My great field',
            min_length=1,
            value_type=schema.TextLine(title=u'Text',
                                       description=u'Text field',
                                       default=u'Default text'),
            default=['foobar'],
        )
        adapter = getMultiAdapter((field, self.portal, self.request),
                                  IJsonSchemaProvider)

        self.assertEqual(
            {
                'type': 'array',
                'title': u'My field',
                'description': u'My great field',
                'default': ['foobar'],
                'minItems': 1,
                'uniqueItems': False,
                'additionalItems': True,
                'items': {
                    'type': 'string',
                    'title': u'Text',
                    'description': u'Text field',
                    'default': u'Default text',
                }
            }, adapter.get_schema())

        # Test Tuple
        field = schema.Tuple(
            title=u'My field',
            value_type=schema.Int(),
            default=(1, 2),
        )
        adapter = getMultiAdapter((field, self.portal, self.request),
                                  IJsonSchemaProvider)

        self.assertEqual(
            {
                'type': 'array',
                'title': u'My field',
                'description': u'',
                'uniqueItems': True,
                'additionalItems': True,
                'items': {
                    'title': u'',
                    'description': u'',
                    'type': 'integer',
                },
                'default': (1, 2),
            }, adapter.get_schema())

        # Test Set
        field = schema.Set(
            title=u'My field',
            value_type=schema.TextLine(),
        )
        adapter = getMultiAdapter((field, self.portal, self.request),
                                  IJsonSchemaProvider)

        self.assertEqual(
            {
                'type': 'array',
                'title': u'My field',
                'description': u'',
                'uniqueItems': True,
                'additionalItems': True,
                'items': {
                    'title': u'',
                    'description': u'',
                    'type': 'string',
                }
            }, adapter.get_schema())

        # List of choices
        field = schema.List(
            title=u'My field',
            value_type=schema.Choice(vocabulary=self.dummy_vocabulary, ),
        )
        adapter = getMultiAdapter((field, self.portal, self.request),
                                  IJsonSchemaProvider)

        self.assertEqual(
            {
                'type': 'array',
                'title': u'My field',
                'description': u'',
                'uniqueItems': True,
                'additionalItems': True,
                'items': {
                    'title': u'',
                    'description': u'',
                    'type': 'string',
                    'enum': ['foo', 'bar'],
                    'enumNames': ['Foo', 'Bar'],
                    'choices': [('foo', 'Foo'), ('bar', 'Bar')],
                }
            }, adapter.get_schema())
示例#13
0
class ITaxonomie(form.Schema):

    # priref
    priref = schema.TextLine(
        title=_(u'priref'),
        required=False
    )
    dexteritytextindexer.searchable('priref')


    # # # # # # # # # # # # # # #
    # Taxonomic term details    #
    # # # # # # # # # # # # # # #
    model.fieldset('taxonomic_term_details', label=_(u'Taxonomic term details'), 
        fields=['title', 'taxonomicTermDetails_term_rank',
                'taxonomicTermDetails_status_status', 'taxonomicTermDetails_status_validAcceptedName', 
                'taxonomicTermDetails_commonName', 'taxonomicTermDetails_synonym',
                'taxonomicTermDetails_hierarchy_parentName', 'taxonomicTermDetails_hierarchy_childNames',
                'taxonomicTermDetails_sourceAndDefinition_taxonAuthor', 'taxonomicTermDetails_sourceAndDefinition_description',
                'taxonomicTermDetails_sourceAndDefinition_distribution', 'taxonomicTermDetails_sourceAndDefinition_publication',
                'taxonomicTermDetails_sourceAndDefinition_expert', 'taxonomicTermDetails_sourceAndDefinition_otherSource',
                'taxonomicTermDetails_notes']
    )

    # Term
    title = schema.TextLine(
        title=_(u'Scientific name'),
        required=True
    )
    dexteritytextindexer.searchable('title')

    taxonomicTermDetails_term_rank = schema.Choice(
        title=_(u'Rank'), 
        required=True,
        vocabulary="collective.object.taxonomyrank", 
        default="No value",
        missing_value=" "
    )

    # Status
    taxonomicTermDetails_status_status = schema.Choice(
        title=_(u'Status'), 
        required=True,
        vocabulary="collective.taxonomie.status", 
        default="No value",
        missing_value=" "
    )

    taxonomicTermDetails_status_validAcceptedName = RelationList(
        title=_(u'Valid/accepted name'),
        default=[],
        missing_value=[],
        value_type=RelationChoice(
            title=u"Related",
            source=ObjPathSourceBinder(portal_type='Taxonomie')
        ),
        required=False
    )
    form.widget('taxonomicTermDetails_status_validAcceptedName', SimpleRelatedItemsFieldWidget, vocabulary='collective.object.relateditems')

    # Common name
    taxonomicTermDetails_commonName = ListField(title=_(u'Common name'),
        value_type=DictRow(title=_(u'Common name'), schema=ICommonName),
        required=False)
    form.widget(taxonomicTermDetails_commonName=BlockDataGridFieldFactory)
    dexteritytextindexer.searchable('taxonomicTermDetails_commonName')

    taxonomicTermDetails_synonym = RelationList(
        title=_(u'Synonym'),
        default=[],
        missing_value=[],
        value_type=RelationChoice(
            title=u"Related",
            source=ObjPathSourceBinder(portal_type='Taxonomie')
        ),
        required=False
    )
    form.widget('taxonomicTermDetails_synonym', ExtendedRelatedItemsFieldWidget, vocabulary='collective.object.relateditems')

    # Hierarchy
    taxonomicTermDetails_hierarchy_parentName = RelationList(
        title=_(u'Parent name'),
        default=[],
        missing_value=[],
        value_type=RelationChoice(
            title=u"Related",
            source=ObjPathSourceBinder(portal_type='Taxonomie')
        ),
        required=False
    )
    form.widget('taxonomicTermDetails_hierarchy_parentName', SimpleRelatedItemsFieldWidget, vocabulary='collective.object.relateditems')

    taxonomicTermDetails_hierarchy_childNames = RelationList(
        title=_(u'Child name'),
        default=[],
        missing_value=[],
        value_type=RelationChoice(
            title=u"Related",
            source=ObjPathSourceBinder(portal_type='Taxonomie')
        ),
        required=False
    )
    form.widget('taxonomicTermDetails_hierarchy_childNames', ExtendedRelatedItemsFieldWidget, vocabulary='collective.object.relateditems')

    # Source and definition
    taxonomicTermDetails_sourceAndDefinition_taxonAuthor = schema.TextLine(
        title=_(u'Taxon author'),
        required=False
    )
    dexteritytextindexer.searchable('taxonomicTermDetails_sourceAndDefinition_taxonAuthor')

    taxonomicTermDetails_sourceAndDefinition_description = schema.TextLine(
        title=_(u'Description'),
        required=False
    )
    dexteritytextindexer.searchable('taxonomicTermDetails_sourceAndDefinition_description')

    taxonomicTermDetails_sourceAndDefinition_distribution = schema.TextLine(
        title=_(u'Distribution'),
        required=False
    )
    dexteritytextindexer.searchable('taxonomicTermDetails_sourceAndDefinition_distribution')

    taxonomicTermDetails_sourceAndDefinition_publication = ListField(title=_(u'Publication'),
        value_type=DictRow(title=_(u'Publication'), schema=IPublication),
        required=False)
    form.widget(taxonomicTermDetails_sourceAndDefinition_publication=BlockDataGridFieldFactory)
    dexteritytextindexer.searchable('taxonomicTermDetails_sourceAndDefinition_publication')

    taxonomicTermDetails_sourceAndDefinition_expert = ListField(title=_(u'Expert'),
        value_type=DictRow(title=_(u'Expert'), schema=IExpert),
        required=False)
    form.widget(taxonomicTermDetails_sourceAndDefinition_expert=BlockDataGridFieldFactory)
    dexteritytextindexer.searchable('taxonomicTermDetails_sourceAndDefinition_expert')

    taxonomicTermDetails_sourceAndDefinition_otherSource = ListField(title=_(u'Other source'),
        value_type=DictRow(title=_(u'Other source'), schema=IOtherSource),
        required=False)
    form.widget(taxonomicTermDetails_sourceAndDefinition_otherSource=BlockDataGridFieldFactory)
    dexteritytextindexer.searchable('taxonomicTermDetails_sourceAndDefinition_otherSource')

    # Notes
    taxonomicTermDetails_notes = ListField(title=_(u'Notes'),
        value_type=DictRow(title=_(u'Notes'), schema=INotes),
        required=False)
    form.widget(taxonomicTermDetails_notes=BlockDataGridFieldFactory)
    dexteritytextindexer.searchable('taxonomicTermDetails_notes')
示例#14
0
class INewsletterSubscriberPortlet(IPortletDataProvider):
    """
    """

    portlet_title = schema.TextLine(title=_(u"Title for the portlet."),
                                    default=u"Newsletter",
                                    required=True)

    portlet_description = schema.Text(
        title=_(u"label_subscriber_portlet_description",
                default=u"Description"),
        default=u"",
        required=False,
    )

    newsletter = schema.Choice(
        title=_(u"label_newsletter_path", default=u"Path to Newsletter"),
        description=_(
            u"help_newsletter_path",
            default=u"Search for the accordingly newsletter, choose one and "
            u"apply.",
        ),
        vocabulary="Products.EasyNewsletter.newsletters",
        required=True,
    )

    query_salutation = schema.Bool(
        title=_(
            u"label_newletter_show_salutation",
            default=u"Ask for the salutation of the subscriber",
        ),
        default=True,
        required=False,
    )

    query_name = schema.Bool(
        title=_(u"label_newletter_show_name",
                default=u"Ask for the name of the subscriber"),
        default=True,
        required=False,
    )

    query_firstname = schema.Bool(
        title=_(u"label_newletter_show_firstname",
                default=u"Ask for the firstname as well"),
        default=False,
        required=False,
    )

    query_name_prefix = schema.Bool(
        title=_(
            u"label_newletter_show_name_prefix",
            default=u"Ask for the name prefix (aka title) as well",
        ),
        default=False,
        required=False,
    )

    query_organization = schema.Bool(
        title=_(
            u"label_newletter_show_organization",
            default=u"Display field to enter company/organization of "
            "subscriber",
        ),
        default=False,
        required=False,
    )

    show_unsubscribe = schema.Bool(
        title=_(
            u"label_newletter_show_unsubscribe_link",
            default=u"Display an unsubscribe link in portlet footer",
        ),
        default=True,
        required=False,
    )

    additional_info = schema.Text(
        title=_(
            u"label_subscriber_portlet_additional_info",
            default=(
                u"Additional info, like terms and conditions.\n"
                u"It can contain HTML, the following tags are allowed: {0}".
                format(", ".join(VALID_TAGS))),
        ),
        default=u"",
        required=False,
    )
示例#15
0
class IEmbedder(model.Schema):
    """ A representation of a content embedder content type
    """

    dexteritytextindexer.searchable('text', 'alternate_content')

    form.order_before(**{'url': '*'})

    url = schema.ASCIILine(
        title=_(u'Multimedia URL'),
        description=_(u'The URL for your multimedia file. Can be a URL ' +
                      u'from YouTube, Vimeo, SlideShare, SoundCloud or ' +
                      u'other main multimedia websites.'),
        required=False,
    )

    width = schema.ASCIILine(
        title=_(u'Width'),
        description=_(
            u'Can be expressed as a decimal number or a percentage, e.g., 270 or 50%.'),
        required=True,
        constraint=validate_int_or_percentage,
    )

    height = schema.Int(
        title=_(u'Height'),
        description=_(u'Can be expressed as a decimal number, e.g., 480.'),
        required=True,
        min=1,
        max=9999,
    )

    embed_html = schema.Text(
        title=_(u'Embedded HTML code'),
        description=_(u'HTML code to render the embedded media.'),
        required=True,
    )

    player_position = schema.Choice(
        title=_(u'Player position'),
        description=_(u''),
        default=u'Top',
        required=True,
        values=[u'Top', u'Bottom', u'Left', u'Right'],
    )

    form.widget(image=EmbedderImageFieldWidget)
    image = NamedImage(
        title=_(u'Preview image'),
        description=_(u'Image to be used when listing content.'),
        required=False,
    )

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

    alternate_content = RichText(
        title=_(u'Alternate content'),
        description=_(u'Description or transcription for accessibility (WCAG) users.'),
        required=False,
    )
示例#16
0
class IPpi(model.Schema):
    """IPpi"""

    fieldset(
        "description sheet",
        label=_(u"Description sheet"),
        fields=[
            "title",
            "other_names",
            "address",
            "occupancy_schedule",
            "type_of_activity",
            "concierge_service",
            "contacts",
            "premises",
            "existence_of_a_ppui",
            "data_limited_to_description",
            "site_classified_seveso",
            "keys_code_access_badge",
            "date_of_update_of_the_description_sheet",
        ],
    )

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

    other_names = schema.TextLine(title=_(u"Other names"), required=False)

    address = ObjectField(title=_(u"Address"),
                          schema=IAddressRowSchema,
                          required=True)

    occupancy_schedule = RichText(
        title=_(u"Occupancy schedule"),
        description=_(
            u"<p>Specify night occupancy or not. Specify public occupation</p>"
        ),
        default_mime_type="text/html",
        defaultFactory=default_translator(
            _(u'{table}<div><div class="column">'
              u"<p><span>0 No activity</span></p>"
              u"<p><span>1 Workers present</span></p>"
              u"<p><span>2 Open to public</span></p>"
              u"</div></div>"),
            table=occupation_table_value,
        ),
        required=False,
    )

    type_of_activity = schema.TextLine(
        title=_(u"Type of activity"),
        description=
        _(u"<p>Factory, warehouse, store, MRPA... Public access, number of people, valid? autonomous? sleeping? Describe in a few lines what it is about.</p>"
          ),
        required=False,
    )

    concierge_service = schema.Bool(title=_(u"Concierge Service?"),
                                    required=False)

    contacts = RichText(
        title=_(u"Contacts"),
        required=False,
        defaultFactory=default_translator(
            _(u'<table border="1">'
              u"<tbody>"
              u"<tr>"
              u"<td><strong>Priority</strong></td>"
              u"<td><strong>Function</strong></td>"
              u"<td><strong>Phone</strong></td>"
              u"<td><strong>Remark</strong></td>"
              u"</tr>"
              u"<tr>"
              u"<td>&nbsp;</td>"
              u"<td>&nbsp;</td>"
              u"<td>&nbsp;</td>"
              u"<td>&nbsp;</td>"
              u"</tr>"
              u"</tbody>"
              u"</table>")),
        default_mime_type="text/html",
    )

    premises = RichText(title=_(u"Premises"), required=False)

    existence_of_a_ppui = schema.Text(
        title=_(u"Existence of a PPUI?"),
        description=
        _(u"<p>If yes, briefly describe the multidisciplinary principles...</p>"
          ),
        required=False,
    )

    data_limited_to_description = schema.Bool(
        title=_(u"Data limited to description?"), required=False)

    site_classified_seveso = schema.Choice(
        title=_(u"Site classified SEVESO?"),
        vocabulary=u"rescuearea.core.vocabularies.seveso",
        required=False,
    )

    keys_code_access_badge = ObjectField(
        title=_(u"Keys, code, access badge?"),
        description=_(u"If yes, describe utility"),
        schema=IKeysCodeAccessBadgeFieldsRowSchema,
        required=False,
    )

    date_of_update_of_the_description_sheet = schema.Date(
        title=_(u"Date of update of the description sheet"), required=False)

    fieldset(
        "before departure",
        label=_(u"Before departure"),
        fields=[
            "adaptation_of_the_emergency_services_in_relation_to_the_response_plan",
            "specific_equipment_to_take_with_you",
            "route_to_follow",
            "site_particularities",
            "instructions_for_the_operator",
        ],
    )

    adaptation_of_the_emergency_services_in_relation_to_the_response_plan = RichText(
        title=
        _(u"Adaptation of the emergency services in relation to the response plan"
          ),
        description=
        _(u"<p>How should the dispatch of help be adapted for this site in relation to the usual procedures?</p>"
          ),
        required=False,
    )

    specific_equipment_to_take_with_you = RichText(
        title=_(u"Specific equipment to take with you"),
        description=
        _(u"<p>For example UHF relay for buildings with insufficient UHF range</p>"
          ),
        required=False,
    )

    route_to_follow = RichText(
        title=_(u"Route to follow"),
        description=
        _(u"<p>Is it always the same, or according to the intervention, you must take into account the direction of the wind, or arrive by a particular access to the site according to the place where the event occurred</p>"
          ),
        required=False,
    )

    site_particularities = RichText(
        title=_(u"Site Particularities"),
        description=
        _(u"<p>Describe in a few words why this site is special and has been the subject of a PPI.</p><p>Example: Access not very obvious, complex architecture, exceptional risk(s) present, means of control available on site for firefighters, place for which an intervention will be arduous because of the absence of compartmentalization...</p>"
          ),
        required=False,
    )

    instructions_for_the_operator = RichText(
        title=_(u"Instructions for the operator"),
        description=
        _(u"<p>Specify here if specific actions are to be taken by the operator.</p><p>For example, if the call comes from a private individual, it is imperative to contact the lodge on duty to inform those in charge of the site of our arrival, and thus be welcomed.</p>"
          ),
        required=False,
    )

    fieldset(
        "during the ride",
        label=_(u"During the ride"),
        fields=[
            "vehicle_stop_emergency_reception_point",
            "point_of_first_destination"
        ],
    )

    vehicle_stop_emergency_reception_point = RichText(
        title=_(u"Vehicle stop/emergency reception point"),
        description=
        _(u"<p>Specify here if a meeting point is planned with site managers for reasons of access complexity, or if depending on a chemical scenario you should not get too close...</p>"
          ),
        required=False,
    )

    point_of_first_destination = RichText(
        title=_(u"Point of First Destination (PFD)"),
        description=
        _(u"<p>Specify if a particular place has been designed to gather emergency services in the event of an increase in power. Important mainly if reflex reinforcements are sent, or in case of chemical intervention, for example.</p>"
          ),
        required=False,
    )

    fieldset(
        "on_site",
        label=_(u"On site"),
        fields=[
            "reflex_measurements_on_arrival_on_site",
            "special_means_of_protection_to_wear",
            "risks_present",
            "materials_equipment_available",
        ],
    )

    reflex_measurements_on_arrival_on_site = RichText(
        title=_(u"Reflex measurements on arrival on site"), required=False)

    special_means_of_protection_to_wear = RichText(
        title=_(u"Special means of protection to wear"),
        description=
        _(u"<p>Specify here the means that must be taken in addition to firefighting, or the personal protective equipment imposed on an industrial site for example</p>"
          ),
        required=False,
    )

    materials_equipment_available = RichText(
        title=_(u"Materials/Equipment available"),
        description=
        _(u"<p>Identify the main risks of the site. limit yourself to about 5 maximum.</p><p>Completeness = drown the fish!</p>"
          ),
        required=False,
    )

    risks_present = RichText(
        title=_(u"Risks Present"),
        description=
        _(u"<p>we need to know what's available to assist us in intervention. It is not necessary to mention the presence of fire extinguishers or even reels intended for the PPE of the site. On the other hand, hydrants, dry or wet columns... must be mentioned.</p>"
          ),
        required=False,
    )

    fieldset(
        "Return to normal",
        label=_(u"Return to normal"),
        fields=["attention_points_for_the_return_to_normal"],
    )

    attention_points_for_the_return_to_normal = RichText(
        title=_(u"Attention points for the return to normal"), required=False)

    fieldset(
        "additional_information",
        label=_(u"Additional information"),
        fields=[
            "appendix_itinerary",
            "appendix_map_of_the_location",
            "appendix_implementation_plan",
            "appendix_water_resources",
            "appendix_axonometric_view",
            "appendix_carroyer_plan",
            "appendix_description",
        ],
    )

    appendix_itinerary = NamedBlobFile(
        title=_(u"Appendix : Itinerary"),
        description=_(
            u"<p>mandatory if wind has an influence (toxic risk)</p>"),
        required=False,
    )

    appendix_map_of_the_location = ObjectField(
        title=_(u"Appendix : Map of the location"),
        description=
        _(u"<p>To do via the PPI carto app to put on line on the map.</p><ul><li>Locate accesses</li><li>Red/black area if known</li><li>Type google map with black box on the object </li></ul>"
          ),
        schema=ILinkFileRowSchema,
        required=True,
    )

    appendix_implementation_plan = NamedBlobFile(
        title=_(u"Appendix : Implementation Plan"),
        description=
        _(u"<p>mandatory : do in A3 on the basis of the zonal canvas</p><ul><li>Wind dose</li><li>Access</li><li>(Sub-funds)</li><li>Scale</li><li>Legend of layout </li><li>Pictogram<ul><li>Keybox</li><li>Concierge</li><li>Exhaust installation</li><li>Fire detection station (or firefighter control station)</li><li>Sprinkler installation</li></ul></li><li>Localization of the crisis room of the ets</li></ul>"
          ),
        required=False,
    )

    appendix_water_resources = ObjectField(
        title=_(u"Appendix : Water resources"),
        description=_(
            u"<p>mandatory to be printed from the PPI carto application</p>"),
        schema=ILinkFileRowSchema,
        required=False,
    )

    appendix_axonometric_view = NamedBlobFile(
        title=_(u"Appendix : Axonometric view"), required=False)

    appendix_carroyer_plan = NamedBlobFile(
        title=_(u"Appendix : Carroyer plan"),
        description=
        _(u"<p>Mandatory if the size of the site does not fit within a 250m x 250m square. To do by the Carto team to put online on the PPI carto app.</p><p>If there is no 'not shown', indicate 'not shown'.</p>"
          ),
        required=False,
    )

    appendix_description = NamedBlobFile(
        title=_(u"Appendix : Description"),
        description=
        _(u"<p>Free annex examples</p><ul><li>Facade photos</li><li>Level plan<ul><li>Scale</li><li>Wind dose</li><li>Compartments</li><li>Access</li><li>Pictogra<ul><li>Keybox</li><li>Concierge</li><li>Exhaust installation</li><li>Fire detection center</li><li>Sprinkler installation</li><li>Localization of the crisis room of the ets</li></ul></li><li>Construction<ul><li>Wall structure</li><li>Roof structure</li></ul></li></ul></li><li>Fire panel operation mode</li></ul>"
          ),
        required=False,
    )

    fieldset(
        "Administration of PPI",
        label=_(u"Administration of PPI"),
        fields=[
            "description",
            "date_of_last_modification",
            "deadline_for_searching_for_additional_information",
            "modification_history",
            "case_officer",
            "preventionist",
            "availability_of_paper_copies",
            "classification_for_risk_analysis",
        ],
    )

    description = schema.TextLine(title=_(u"PPI reference"), required=True)

    date_of_last_modification = schema.Date(
        title=_(u"Date of last modification"), required=False)

    deadline_for_searching_for_additional_information = schema.Date(
        title=_(u"Deadline for searching for additional information"),
        required=False)

    modification_history = schema.List(
        title=_(u"Modification history"),
        required=False,
        value_type=ObjectField(title=_(u"History"), schema=IHistoryRowSchema),
    )

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

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

    availability_of_paper_copies = schema.Text(
        title=_(u"Availability of Paper Copies"),
        description=
        _(u"<p>Specify the places where it is necessary to have paper copies available </p><ul><li>DZHC</li><li>Fastest first aid station (several if the means must come from several stations)</li></ul>"
          ),
        required=False,
    )

    classification_for_risk_analysis = schema.Choice(
        title=_(u"Classification for risk analysis"),
        vocabulary=u"rescuearea.core.vocabularies.classification",
        required=False,
    )
class IMessage(model.Schema):

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

    text = RichText(
        title=_(u'Text'),
        required=True,
        description=_(u'Message text'),
    )

    msg_type = schema.Choice(
        title=_(u'Message type'),
        required=True,
        source=msg_types,
        description=_(u'Following the type, the color will be different'),
    )

    form.widget('can_hide', RadioFieldWidget)
    can_hide = schema.Bool(
        title=_(u'Can be marked as read'),
        description=_(u'If checked, the user can hide the message'),
        default=False,
    )

    start = schema.Datetime(
        title=_(u'Start date'),
        required=False,
        description=_(u'Specify start date message appearance'),
        defaultFactory=default_start,
    )
    if HAS_PLONE_5:
        form.widget('start', dtfw5, default_timezone=default_timezone)
    else:
        form.widget('start', dtfw4)

    end = schema.Datetime(
        title=_(u'End date'),
        required=False,
        description=
        _(u'Specify end date message appearance. If nothing specified, this is infinite. '
          u"If you pick a date, <span class=warning-formHelp>dont't forget hours !</span>"
          ),
    )
    if HAS_PLONE_5:
        form.widget('end', dtfw5, default_timezone=default_timezone)
    else:
        form.widget('end', dtfw4)

    required_roles = schema.Set(
        title=_(u'Required roles'),
        description=_(
            u'Choose the roles for which the message will be displayed'),
        required=False,
        value_type=schema.Choice(vocabulary='plone.app.vocabularies.Roles'),
    )
    form.widget('required_roles',
                CheckBoxFieldWidget,
                multiple='multiple',
                size=15)

    form.widget('use_local_roles', RadioFieldWidget)
    use_local_roles = schema.Bool(
        title=_(u'Use Reader local role'),
        description=
        _(u"If checked, the message will be shown only to users having message local role 'Reader'"
          ),
        default=False,
    )

    location = schema.Choice(
        title=_(u'Location'),
        required=True,
        source=location,
    )

    hidden_uid = schema.TextLine(
        title=u'Generated uid',
        defaultFactory=generate_uid,
    )
    form.mode(hidden_uid='hidden')

    @invariant
    def validateStartEnd(data):
        if data.start is not None and data.end is not None:
            data_start = add_timezone(data.start)
            data_end = add_timezone(data.end)
            if data_start > data_end:
                raise Invalid(_(u'The start date must precede the end date.'))
示例#18
0
class IChurchMember(form.Schema, IImageScaleTraversable):
    """
    Church Member
    """

    church_image = NamedBlobImage(
        title=_(u'Image'),
        required=False,
    )

    church_family = RelationChoice(
        title=_(u'Church Family'),
        source=ObjectProvidesPathSourceBinder(
            object_provides='wcc.churches.churchfamily.IChurchFamily'),
        required=False)

    based_in = schema.Choice(
        title=_(u'Based in'),
        vocabulary='wcc.vocabulary.country',
        description=_(u''),
        required=False,
    )

    present_in = schema.List(
        title=_(u'Present in'),
        value_type=schema.Choice(vocabulary='wcc.vocabulary.country'),
        description=_(u''),
        required=False,
    )

    membership = schema.Int(
        title=_(u'Membership'),
        description=_(u''),
        required=False,
    )

    pastors = schema.Int(title=_(u'Pastors'),
                         description=_(u''),
                         required=False)

    congregations = schema.Int(title=_(u'Congregations'),
                               description=_(u''),
                               required=False)

    member_of = RelationList(
        title=_(u'label_member_of', u"Member Of"),
        default=[],
        value_type=RelationChoice(source=ObjectProvidesPathSourceBinder(
            object_provides='wcc.churches.churchbody.IChurchBody')),
        required=False)

    assoc_member_of = RelationList(
        title=_(u'label_assoc_member_of', u'Associate Member Of'),
        default=[],
        value_type=RelationChoice(source=ObjectProvidesPathSourceBinder(
            object_provides='wcc.churches.churchbody.IChurchBody'), ),
        required=False)

    wcc_member_since = schema.Date(title=u'WCC Member Since',
                                   min=date(1900, 1, 1),
                                   max=date.today(),
                                   required=False)

    remoteUrl = schema.TextLine(
        title=_(u"Website"),
        default=u'http://',
        description=u"",
        required=False,
    )
示例#19
0
class IDossier(form.Schema):
    """Behaviour interface for dossier types providing
    common properties/fields.
    """

    form.fieldset(
        u'common',
        label=_(u'fieldset_common', u'Common'),
        fields=[
            u'keywords',
            u'start',
            u'end',
            u'comments',
            u'external_reference',
            u'responsible',
            u'relatedDossier',
        ],
    )

    form.widget('keywords', KeywordFieldWidget, new_terms_as_unicode=True)
    keywords = schema.Tuple(
        title=_(u'label_keywords', default=u'Keywords'),
        description=_(u'help_keywords', default=u''),
        value_type=ChoicePlus(vocabulary='plone.app.vocabularies.Keywords'),
        required=False,
        missing_value=(),
        default=(),
    )

    # workaround because ftw.datepicker wasn't working on the edit form
    form.widget(start=DatePickerFieldWidget)
    start = schema.Date(
        title=_(u'label_start', default=u'Opening Date'),
        required=False,
        defaultFactory=start_date_default,
    )

    # workaround because ftw.datepicker wasn't working on the edit form
    form.widget(end=DatePickerFieldWidget)
    end = schema.Date(
        title=_(u'label_end', default=u'Closing Date'),
        required=False,
    )

    comments = schema.Text(
        title=_(u'label_comments', default=u'Comments'),
        required=False,
    )

    form.widget('responsible', KeywordFieldWidget, async=True)
    responsible = schema.Choice(
        title=_(u"label_responsible", default="Responsible"),
        source=AssignedUsersSourceBinder(),
        required=True,
    )

    external_reference = schema.TextLine(
        title=_(u'label_external_reference', default=u'External Reference'),
        required=False,
    )

    form.fieldset(
        u'filing',
        label=_(u'fieldset_filing', default=u'Filing'),
        fields=[
            u'filing_prefix',
            u'container_type',
            u'number_of_containers',
            u'container_location',
            u'reference_number',
            u'former_reference_number',
        ],
    )

    filing_prefix = schema.Choice(
        title=_(u'filing_prefix', default="filing prefix"),
        source=wrap_vocabulary(
            'opengever.dossier.type_prefixes',
            visible_terms_from_registry="opengever.dossier"
            '.interfaces.IDossierContainerTypes.type_prefixes'),
        required=False,
    )

    # needed for temporarily storing current reference number when
    # moving this dossier
    form.omitted('temporary_former_reference_number')
    temporary_former_reference_number = schema.TextLine(
        title=_(u'temporary_former_reference_number',
                default="Temporary former reference number"),
        required=False,
    )

    container_type = schema.Choice(
        title=_(u'label_container_type', default=u'Container Type'),
        description=_(u'help_container_type', default=u''),
        source=wrap_vocabulary(
            'opengever.dossier.container_types',
            visible_terms_from_registry="opengever.dossier"
            '.interfaces.IDossierContainerTypes.container_types'),
        required=False,
    )

    number_of_containers = schema.Int(
        title=_(u'label_number_of_containers',
                default=u'Number of Containers'),
        description=_(u'help_number_of_containers', default=u''),
        required=False,
    )

    container_location = schema.TextLine(
        title=_(u'label_container_location', default=u'Container Location'),
        description=_(u'help_container_location', default=u''),
        required=False,
    )

    relatedDossier = RelationList(
        title=_(u'label_related_dossier', default=u'Related Dossier'),
        default=[],
        missing_value=[],
        value_type=RelationChoice(
            title=u"Related",
            source=RepositoryPathSourceBinder(
                object_provides='opengever.dossier.behaviors.dossier.'
                'IDossierMarker',
                navigation_tree_query={
                    'object_provides': [
                        'opengever.repository.repositoryroot.IRepositoryRoot',
                        'opengever.repository.repositoryfolder.'
                        'IRepositoryFolderSchema',
                        'opengever.dossier.behaviors.dossier.IDossierMarker',
                    ]
                }),
        ),
        required=False,
    )

    form.mode(former_reference_number='display')
    former_reference_number = schema.TextLine(
        title=_(u'label_former_reference_number', default=u'Reference Number'),
        required=False,
    )

    form.widget(reference_number=referenceNumberWidgetFactory)
    reference_number = schema.TextLine(
        title=_(u'label_reference_number', default=u'Reference Number'),
        required=False,
    )

    @invariant
    def validate_start_end(data):
        # Do not get the data from the context when it is not in the current
        # fields / z3cform group
        data = data._Data_data___

        if 'start' not in data or 'end' not in data:
            return

        if data['start'] is not None and data['end'] is not None:
            if data['start'] > data['end']:
                raise StartBeforeEnd(
                    _(u"The start date must be before the end date."))
示例#20
0
class IRandDSample(ISample):
    """R and D sample!
    """

    department = schema.Choice(
        title=_(u"Department"),
        description=_(u"Department that controls material"),
        values=[_(u"TBI"), _(u"Commercial"), _(u"BrainBox"), _(u"Other")],
        required=False,
    )

    source_id_one = schema.TextLine(
        title=_(u"Primary R&D Source Sample ID"),
        description=_(u"Primary R&D Source Sample ID"),
        required=False,
    )

    source_id_two = schema.TextLine(
        title=_(u"Secondary R&D Source Sample ID"),
        description=_(u"Secondary R&D Source Sample ID"),
        required=False,
    )

    source_id_three = schema.TextLine(
        title=_(u"Tertiary R&D Source Sample ID"),
        description=_(u"Tertiary R&D Source Sample ID"),
        required=False,
    )

    # Unlike Clinical Samples which store this value in "usn" field,
    # RandD/QC samples have a dedicated veracis_id field.
    veracis_id = schema.TextLine(
        title=_(u"R&D Veracis Sample ID"),
        description=_(u"R&D Veracis Sample ID"),
        defaultFactory=assignVeracisId(),
        required=True,
    )

    date_added = schema.Date(
        title=_(u"Date R&D Sample was added to LIMS"),
        description=_(u"Date R&D Sample was added to LIMS"),
        defaultFactory=currentDate,
        required=True,
    )

    added_by = schema.Choice(
        title=_(u"Operator that Added R&D Sample to LIMS"),
        description=_(u"Operator that Added R&D Sample to LIMS"),
        vocabulary=u"plone.principalsource.Users",
        required=False,
    )

    source = schema.TextLine(
        title=_(u"Source of R&D Sample"),
        description=_(u"Source of R&D Sample"),
        required=False,
    )

    pi = schema.TextLine(
        title=_(u"Primary Investigator (PI) of R&D Sample"),
        description=_(u"Primary Investigator (PI) of R&D Sample"),
        required=False,
    )

    description = schema.TextLine(
        title=_(u"Description of R&D Sample"),
        description=_(u"Description of R&D Sample"),
        required=False,
    )

    fluid_type = schema.Choice(
        title=_(u"R&D Fluid Type"),
        description=_(u"R&D Fluid Type"),
        values=[_(u"Serum"), _(u"Plasma"), _(u"CSF"), _(u"Tissue")],
        required=True,
    )

    date_received = schema.Date(
        title=_(u"Date R&D Sample was Received"),
        description=_(u"Date R&D Sample was Received"),
        required=True,
    )

    comment = schema.Text(
        title=_(u"Any Notes or Comments About the R&D Sample"),
        description=_(u"Any Notes or Comments About the R&D Sample"),
        required=False,
    )
示例#21
0
class ISecurityLevel(model.Schema):

    security_level = schema.Choice(
        title=_(u"security level"),
        vocabulary="emc.project.vocabulary.securitylevel",
        default="public")
示例#22
0
class IUniteGalleryGridSettings(IBaseSettings):
    """Unite Gallery Grid Settings"""

    #Theme options
    grid_theme_panel_position = schema.Choice(
        title=_(u"unitegallery_theme_panel_position_title",
                default=u"Thumbs panel position"),
        default=u'bottom',
        vocabulary=SimpleVocabulary([
            SimpleTerm('bottom', 'bottom', _(u"label_bottom",
                                             default=u"Bottom")),
            SimpleTerm('top', 'top', _(u"label_top", default=u"Top")),
            SimpleTerm('left', 'left', _(u"label_left", default=u"Left")),
            SimpleTerm('right', 'right', _(u"label_right", default=u"Right")),
        ]))
    grid_theme_hide_panel_under_width = schema.Int(title=_(
        u"unitegallery_theme_hide_panel_under_width_title",
        default=u"hide panel under certain browser width, if null, don't hide"
    ),
                                                   default=480)

    #Gallery options
    grid_gallery_width = schema.Int(title=_(
        u"unitegallery_gallery_width_title", default=u"Gallery width"),
                                    default=900)
    grid_gallery_height = schema.Int(title=_(
        u"unitegallery_gallery_height_title", default=u"Gallery height"),
                                     default=500)
    grid_gallery_min_width = schema.Int(title=_(
        u"unitegallery_gallery_min_width_title",
        default=u"Gallery minimal width when resizing"),
                                        default=400)
    grid_gallery_min_height = schema.Int(title=_(
        u"unitegallery_gallery_min_height_title",
        default=u"Gallery minimal height when resizing"),
                                         default=300)
    grid_gallery_skin = schema.Choice(
        title=_(u"unitegallery_gallery_skin_title",
                default=u"The global skin of the gallery"),
        description=_(u"unitegallery_gallery_skin_description",
                      default=u"Will change all gallery items by default"),
        default=u'default',
        vocabulary=SimpleVocabulary([
            SimpleTerm('default', 'default',
                       _(u"label_default", default=u"Default")),
            SimpleTerm('alexis', 'alexis', _(u"label_alexis",
                                             default=u"Alexis")),
        ]))
    grid_gallery_images_preload_type = schema.Choice(
        title=_(u"unitegallery_gallery_images_preload_type_title",
                default=u"Preload type of the images"),
        description=_(
            u"unitegallery_gallery_images_preload_type_description",
            default=
            u"Minimal - only image nabours will be loaded each time.\nVisible - visible thumbs images will be loaded each time.\nAll - load all the images first time."
        ),
        default=u'minimal',
        vocabulary=SimpleVocabulary([
            SimpleTerm('minimal', 'minimal',
                       _(u"label_minimal", default=u"Minimal")),
            SimpleTerm('visible', 'visible',
                       _(u"label_visible", default=u"Visible")),
            SimpleTerm('all', 'all', _(u"label_all", default=u"All")),
        ]))
    grid_gallery_pause_on_mouseover = schema.Bool(title=_(
        u"unitegallery_gallery_pause_on_mouseover_title",
        default=u"Pause on mouseover when playing slideshow"),
                                                  default=True)
    grid_gallery_control_thumbs_mousewheel = schema.Bool(title=_(
        u"unitegallery_gallery_control_thumbs_mousewheel_title",
        default=u"Enable / disable the mousewheel"),
                                                         default=False)
    grid_gallery_control_keyboard = schema.Bool(title=_(
        u"unitegallery_gallery_control_keyboard_title",
        default=u"Enable / disble keyboard controls"),
                                                default=True)
    grid_gallery_carousel = schema.Bool(title=_(
        u"unitegallery_gallery_carousel_title",
        default=u"Next button on last image goes to first image"),
                                        default=True)
    grid_gallery_preserve_ratio = schema.Bool(title=_(
        u"unitegallery_gallery_preserve_ratio_title",
        default=u"Preserver ratio when on window resize"),
                                              default=True)
    grid_gallery_debug_errors = schema.Bool(title=_(
        u"unitegallery_gallery_debug_errors_title",
        default=
        u"Show error message when there is some error on the gallery area"),
                                            default=True)
    grid_gallery_background_color = schema.TextLine(title=_(
        u"unitegallery_gallery_background_color_title",
        default=
        u"Set custom background color. If not set it will be taken from css"),
                                                    default=u'',
                                                    required=False)
class IAssignedDescriptiveReviewer(form.Schema):
    reviewer = schema.Choice(
        title=_(u"Reviewer"),
        source=possibleDescriptiveReviewers,
        required=False,
    )
class IUniteGalleryTilesSettings(IBaseSettings):
    """UniteGallery Tiles Settings"""

    #Theme options
    tiles_theme_enable_preloader = schema.Bool(title=_(
        u"unitegallery_theme_enable_preloader_title",
        default=u"Enable preloader circle"),
                                               default=True)
    tiles_theme_preloading_height = schema.Int(
        title=_(u"unitegallery_theme_preloading_height_title",
                default=u"Preloading height"),
        description=_(
            u"unitegallery_theme_preloading_height_description",
            default=
            u"The height of the preloading div, it show before the gallery"),
        default=200)
    tiles_theme_preloader_vertpos = schema.Int(title=_(
        u"unitegallery_theme_preloader_vertpos_title",
        default=u"Vertical position of the preloader"),
                                               default=100)
    tiles_theme_gallery_padding = schema.Int(title=_(
        u"unitegallery_theme_gallery_padding_title",
        default=u"Horizontal padding of the gallery from the sides"),
                                             default=0)
    tiles_theme_appearance_order = schema.Choice(
        title=_(u"unitegallery_theme_appearance_order_title",
                default=u"Appearance order of the tiles"),
        default=u'normal',
        vocabulary=SimpleVocabulary([
            SimpleTerm('normal', 'normal', _(u"label_normal",
                                             default=u"Normal")),
            SimpleTerm('shuffle', 'shuffle',
                       _(u"label_shuffle", default=u"Shuffle")),
            SimpleTerm('keep', 'keep', _(u"label_keep", default=u"Keep")),
        ]))
    tiles_theme_auto_open = schema.Bool(title=_(
        u"unitegallery_theme_auto_open_title",
        default=u"Auto open lightbox at start"),
                                        default=False)
    tiles_theme_auto_open_delay = schema.Int(title=_(
        u"unitegallery_theme_auto_open_delay_title",
        default=u"Delay for auto open lightbox"),
                                             default=0)

    #Gallery options
    tiles_gallery_width = schema.TextLine(title=_(
        u"unitegallery_gallery_width_title", default=u"Gallery Width"),
                                          default=u"100%")
    tiles_gallery_min_width = schema.Int(title=_(
        u"unitegallery_gallery_min_width_title",
        default=u"Gallery minimal width when resizing"),
                                         default=150)
    tiles_gallery_background_color = schema.TextLine(title=_(
        u"unitegallery_gallery_background_color_title",
        default=u"Custom background color. If not set it will be taken from css"
    ),
                                                     default=u"",
                                                     required=False)

    #Tiles options
    tiles_tiles_type = schema.Choice(
        title=_(u"unitegallery_tiles_type_title",
                default=u"Must option for the tiles"),
        default=u'columns',
        vocabulary=SimpleVocabulary([
            SimpleTerm('columns', 'columns',
                       _(u"label_columns", default=u"Columns")),
            SimpleTerm('justified', 'justified',
                       _(u"label_justified", default=u"Justified")),
            SimpleTerm('nested', 'nested', _(u"label_nested",
                                             default=u"Nested")),
        ]))
    tiles_tiles_justified_row_height = schema.Int(title=_(
        u"unitegallery_tiles_justified_row_height_title",
        default=u"Base row height of the justified type"),
                                                  default=150)
    tiles_tiles_justified_space_between = schema.Int(title=_(
        u"unitegallery_tiles_justified_space_between_title",
        default=u"Space between the tiles justified type"),
                                                     default=3)
    tiles_tiles_nested_optimal_tile_width = schema.Int(title=_(
        u"unitegallery_tiles_nested_optimal_tile_width_title",
        default=u"Tiles optimal width nested type"),
                                                       default=250)
    tiles_tiles_col_width = schema.Int(title=_(
        u"unitegallery_tiles_col_width_title",
        default=u"Column width - exact or base according the settings"),
                                       default=250)
    tiles_tiles_align = schema.Choice(
        title=_(u"unitegallery_tiles_align_title",
                default=u"Align of the tiles in the space"),
        default=u'center',
        vocabulary=SimpleVocabulary([
            SimpleTerm('center', 'center', _(u"label_center",
                                             default=u"Center")),
            SimpleTerm('top', 'top', _(u"label_top", default=u"Top")),
            SimpleTerm('left', 'left', _(u"label_left", default=u"Left")),
            SimpleTerm('right', 'right', _(u"label_right", default=u"Right")),
        ]))
    tiles_tiles_space_between_cols = schema.Int(title=_(
        u"unitegallery_tiles_space_between_cols_title",
        default=u"Space between images"),
                                                default=3)
    tiles_tiles_exact_width = schema.Bool(title=_(
        u"unitegallery_tiles_exact_width_title",
        default=u"Exact width of column - disables the min and max columns"),
                                          default=False)
    tiles_tiles_space_between_cols_mobile = schema.Int(title=_(
        u"unitegallery_tiles_space_between_cols_mobile_title",
        default=u"Space between cols for mobile type"),
                                                       default=3)
    tiles_tiles_include_padding = schema.Bool(
        title=_(u"unitegallery_tiles_include_padding_title",
                default=u"Include padding"),
        description=_(
            u"unitegallery_tiles_include_padding_description",
            default=
            u"Include padding at the sides of the columns, equal to current space between cols"
        ),
        default=True)
    tiles_tiles_min_columns = schema.Int(title=_(
        u"unitegallery_tiles_min_columns_title", default=u"Min columns"),
                                         default=2)
    tiles_tiles_max_columns = schema.Int(title=_(
        u"unitegallery_tiles_max_columns_title",
        default=u"Max columns (0 for unlimited)"),
                                         default=20)
    tiles_tiles_set_initial_height = schema.Bool(title=_(
        u"unitegallery_tiles_set_initial_height_title",
        default=u"Set initial height, columns type related only"),
                                                 default=True)
    tiles_tiles_enable_transition = schema.Bool(title=_(
        u"unitegallery_tiles_enable_transition_title",
        default=u"Enable transition when screen width change"),
                                                default=True)

    #Tile design options
    tiles_tile_enable_border = schema.Bool(title=_(
        u"unitegallery_tile_enable_border_title",
        default=u"Enable border of the tile"),
                                           default=False)
    tiles_tile_border_width = schema.Int(title=_(
        u"unitegallery_tile_border_width_title", default=u"Tile border width"),
                                         default=3)
    tiles_tile_border_color = schema.TextLine(title=_(
        u"unitegallery_tile_border_color_title", default=u"Tile border color"),
                                              default=u"#F0F0F0")
    tiles_tile_border_radius = schema.Int(title=_(
        u"unitegallery_tile_border_radius_title",
        default=u"Tile border radius (applied to border only, not to outline)"
    ),
                                          default=0)

    tiles_tile_enable_outline = schema.Bool(
        title=_(u"unitegallery_tile_enable_outline_title",
                default=u"Enable outline of the tile"),
        description=_(u"unitegallery_tile_enable_outline_description",
                      default=u"Works only together with the border"),
        default=False)
    tiles_tile_outline_color = schema.TextLine(title=_(
        u"unitegallery_tile_outline_color_title",
        default=u"Tile outline color"),
                                               default=u"#8B8B8B")

    tiles_tile_enable_shadow = schema.Bool(title=_(
        u"unitegallery_tile_enable_outline_title",
        default=u"Enable shadow of the tile"),
                                           default=False)
    tiles_tile_shadow_h = schema.Int(title=_(
        u"unitegallery_tile_shadow_h_title",
        default=u"Position of horizontal shadow"),
                                     default=1)
    tiles_tile_shadow_v = schema.Int(title=_(
        u"unitegallery_tile_shadow_v_title",
        default=u"Position of vertical shadow"),
                                     default=1)
    tiles_tile_shadow_blur = schema.Int(title=_(
        u"unitegallery_tile_shadow_blur_title", default=u"Shadow blur"),
                                        default=3)
    tiles_tile_shadow_spread = schema.Int(title=_(
        u"unitegallery_tile_shadow_spread_title", default=u"Shadow spread"),
                                          default=2)
    tiles_tile_shadow_color = schema.TextLine(title=_(
        u"unitegallery_tile_shadow_color_title", default=u"Shadow color"),
                                              default=u"#8B8B8B")

    tiles_tile_enable_action = schema.Bool(title=_(
        u"unitegallery_tile_enable_action_title",
        default=u"Enable tile action on click like lightbox"),
                                           default=True)
    tiles_tile_as_link = schema.Bool(title=_(
        u"unitegallery_tile_as_link_title",
        default=u"Act the tile as link, no lightbox will appear"),
                                     default=False)
    tiles_tile_link_newpage = schema.Bool(title=_(
        u"unitegallery_tile_link_newpage_title",
        default=u"Open the tile link in new page"),
                                          default=True)

    tiles_tile_enable_overlay = schema.Bool(title=_(
        u"unitegallery_tile_enable_overlay_title",
        default=u"Enable tile color overlay (on mouseover)"),
                                            default=True)
    tiles_tile_overlay_opacity = schema.Float(title=_(
        u"unitegallery_tile_overlay_opacity_title",
        default=u"Tile overlay opacity"),
                                              default=0.4)
    tiles_tile_overlay_color = schema.TextLine(title=_(
        u"unitegallery_tile_overlay_color_title",
        default=u"Tile overlay color"),
                                               default=u"#000000")

    tiles_tile_enable_icons = schema.Bool(title=_(
        u"unitegallery_ile_enable_icons_title",
        default=u"Enable icons in mouseover mode"),
                                          default=True)
    tiles_tile_show_link_icon = schema.Bool(
        title=_(u"unitegallery_tile_show_link_icon_title",
                default=u"Show link icon (if the tile has a link)"),
        description=_(
            u"unitegallery_tile_show_link_icon_description",
            default=u"In case of tile_as_link this option not enabled"),
        default=False)
    tiles_tile_space_between_icons = schema.Int(title=_(
        u"unitegallery_tile_space_between_icons_title",
        default=u"Initial space between icons, (on small tiles it may change)"
    ),
                                                default=26)
    tiles_tile_enable_image_effect = schema.Bool(title=_(
        u"unitegallery_tile_enable_image_effect_title",
        default=u"Enable tile image effect"),
                                                 default=False)
    tiles_tile_image_effect_type = schema.Choice(
        title=_(u"unitegallery_tile_image_effect_type_title",
                default=u"Tile effect type"),
        default=u'bw',
        vocabulary=SimpleVocabulary([
            SimpleTerm('bw', 'bw',
                       _(u"label_black_and_white",
                         default=u"Black and white")),
            SimpleTerm('blur', 'blur', _(u"label_blur", default=u"Blur")),
            SimpleTerm('sepia', 'sepia', _(u"label_sepia", default=u"Sepia")),
        ]))
    tiles_tile_image_effect_reverse = schema.Bool(title=_(
        u"unitegallery_tile_image_effect_reverse_title",
        default=u"Reverse the image, set only on mouseover state"),
                                                  default=False)

    #tile text panel options
    tiles_tile_enable_textpanel = schema.Bool(title=_(
        u"unitegallery_tile_enable_textpanel_title",
        default=u"Enable textpanel"),
                                              default=False)
    tiles_tile_textpanel_source = schema.Choice(
        title=_(u"unitegallery_tile_textpanel_source_title",
                default=u"Source of the textpanel"),
        default=u'title',
        vocabulary=SimpleVocabulary([
            SimpleTerm('title', 'title', _(u"label_title", default=u"Title")),
            SimpleTerm('desc', 'desc', _(u"label_blur",
                                         default=u"Description")),
            SimpleTerm('desc_title', 'desc_title',
                       _(u"label_sepia", default=u"Description or Title")),
        ]))
    tiles_tile_textpanel_always_on = schema.Bool(title=_(
        u"unitegallery_tile_textpanel_always_on_title",
        default=u"Textpanel always visible"),
                                                 default=False)
    tiles_tile_textpanel_appear_type = schema.Choice(
        title=_(u"unitegallery_tile_textpanel_appear_type_title",
                default=u"Appear type of the textpanel on mouseover"),
        default=u'slide',
        vocabulary=SimpleVocabulary([
            SimpleTerm('slide', 'slide', _(u"label_slide", default=u"Slide")),
            SimpleTerm('fade', 'fade', _(u"label_fade", default=u"Fade")),
        ]))
    tiles_tile_textpanel_position = schema.Choice(
        title=_(u"unitegallery_tile_textpanel_position_title",
                default=u"Position of the textpanel"),
        default=u'inside_bottom',
        vocabulary=SimpleVocabulary([
            SimpleTerm('inside_bottom', 'inside_bottom',
                       _(u"label_inside_bottom", default=u"Inside bottom")),
            SimpleTerm('inside_top', 'inside_top',
                       _(u"label_inside_top", default=u"Inside top")),
            SimpleTerm('inside_center', 'inside_center',
                       _(u"label_inside_center", default=u"Inside center")),
            SimpleTerm('top', 'top', _(u"label_top", default=u"Top")),
            SimpleTerm('bottom', 'bottom', _(u"label_bottom",
                                             default=u"Bottom")),
        ]))
    tiles_tile_textpanel_offset = schema.Int(title=_(
        u"unitegallery_tile_textpanel_offset_title",
        default=u"Vertical offset of the textpanel"),
                                             default=0)
    tiles_tile_textpanel_padding_top = schema.Int(title=_(
        u"unitegallery_tile_textpanel_padding_top_title",
        default=u"Textpanel padding top"),
                                                  default=8)
    tiles_tile_textpanel_padding_bottom = schema.Int(title=_(
        u"unitegallery_tile_textpanel_padding_bottom_title",
        default=u"Textpanel padding bottom"),
                                                     default=8)
    tiles_tile_textpanel_padding_right = schema.Int(title=_(
        u"unitegallery_tile_textpanel_padding_right_title",
        default=u"Cut some space for text from right"),
                                                    default=11)
    tiles_tile_textpanel_padding_left = schema.Int(title=_(
        u"unitegallery_tile_textpanel_padding_left_title",
        default=u"Cut some space for text from left"),
                                                   default=11)
    tiles_tile_textpanel_bg_opacity = schema.Float(title=_(
        u"unitegallery_tile_textpanel_bg_opacity_title",
        default=u"Textpanel background opacity"),
                                                   default=0.4)
    tiles_tile_textpanel_bg_color = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_bg_color_title",
        default=u"Textpanel background color"),
                                                    default=u"#000000")
    tiles_tile_textpanel_bg_css = schema.Text(title=_(
        u"unitegallery_tile_textpanel_bg_css_title",
        default=u"Textpanel background css"),
                                              default=u"{}")
    tiles_tile_textpanel_title_color = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_bg_color_title",
        default=u"Textpanel title color. if empty - take from css"),
                                                       default=u"",
                                                       required=False)
    tiles_tile_textpanel_title_font_family = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_title_font_family_title",
        default=u"Textpanel title font family. if empty - take from css"),
                                                             default=u"",
                                                             required=False)
    tiles_tile_textpanel_title_text_align = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_title_text_align_title",
        default=u"Textpanel title text align. if empty - take from css"),
                                                            default=u"",
                                                            required=False)
    tiles_tile_textpanel_title_font_size = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_title_font_size_title",
        default=u"Textpanel title font size. if empty - take from css"),
                                                           default=u"",
                                                           required=False)
    tiles_tile_textpanel_title_bold = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_title_bold_title",
        default=u"Textpanel title bold. if empty - take from css"),
                                                      default=u"",
                                                      required=False)
    tiles_tile_textpanel_css_title = schema.Text(title=_(
        u"unitegallery_tile_textpanel_css_title_title",
        default=u"Textpanel additional css of the title"),
                                                 default=u"{}")
    tiles_tile_textpanel_desc_color = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_desc_color_title",
        default=u"Textpanel description font family. if empty - take from css"
    ),
                                                      default=u"",
                                                      required=False)
    tiles_tile_textpanel_desc_font_family = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_desc_font_family_title",
        default=u"Textpanel description font family. if empty - take from css"
    ),
                                                            default=u"",
                                                            required=False)
    tiles_tile_textpanel_desc_text_align = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_desc_text_align_title",
        default=u"Textpanel description text align. if empty - take from css"),
                                                           default=u"",
                                                           required=False)
    tiles_tile_textpanel_desc_font_size = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_desc_font_size_title",
        default=u"Textpanel description font size. if empty - take from css"),
                                                          default=u"",
                                                          required=False)
    tiles_tile_textpanel_desc_bold = schema.TextLine(title=_(
        u"unitegallery_tile_textpanel_desc_bold_title",
        default=u"Textpanel description bold. if empty - take from css"),
                                                     default=u"",
                                                     required=False)
    tiles_tile_textpanel_css_description = schema.Text(title=_(
        u"unitegallery_tile_textpanel_css_description_title",
        default=u"Textpanel additional css of the description"),
                                                       default=u"{}")

    #lightbox options:
    tiles_lightbox_type = schema.Choice(
        title=_(u"unitegallery_lightbox_type_title", default=u"Lightbox type"),
        default=u'wide',
        vocabulary=SimpleVocabulary([
            SimpleTerm('compact', 'compact',
                       _(u"label_compact", default=u"Compact")),
            SimpleTerm('wide', 'wide', _(u"label_wide", default=u"Wide")),
        ]))
    tiles_lightbox_hide_arrows_onvideoplay = schema.Bool(title=_(
        u"unitegallery_lightbox_hide_arrows_onvideoplay_title",
        default=u"Hide the arrows when video start playing and show when stop"
    ),
                                                         default=True)
    tiles_lightbox_arrows_position = schema.Choice(
        title=_(u"unitegallery_lightbox_arrows_position_title",
                default=u"Position of the arrows, used on compact type"),
        default=u'sides',
        vocabulary=SimpleVocabulary([
            SimpleTerm('sides', 'sides', _(u"label_sides", default=u"Sides")),
            SimpleTerm('inside', 'inside', _(u"label_inside",
                                             default=u"Inside")),
        ]))
    tiles_lightbox_arrows_offset = schema.Int(title=_(
        u"unitegallery_lightbox_arrows_offset_title",
        default=u"The horizontal offset of the arrows"),
                                              default=10)
    tiles_lightbox_arrows_inside_offset = schema.Int(title=_(
        u"unitegallery_lightbox_arrows_inside_offset_title",
        default=u"The offset from the image border if the arrows placed inside"
    ),
                                                     default=10)
    tiles_lightbox_arrows_inside_alwayson = schema.Bool(title=_(
        u"unitegallery_lightbox_arrows_inside_alwayson_title",
        default=u"Show the arrows on mouseover, or always on"),
                                                        default=False)
    tiles_lightbox_overlay_color = schema.TextLine(title=_(
        u"unitegallery_lightbox_overlay_color_title",
        default=u"The color of the overlay. if empty - take from css"),
                                                   default=u"",
                                                   required=False)
    tiles_lightbox_overlay_opacity = schema.Float(title=_(
        u"unitegallery_lightbox_arrows_inside_offset_title",
        default=u"The opacity of the overlay. for compact type - 0.6"),
                                                  default=1.0,
                                                  required=False)
    tiles_lightbox_top_panel_opacity = schema.Float(title=_(
        u"unitegallery_lightbox_top_panel_opacity_title",
        default=u"The opacity of the top panel. if empty - take from css"),
                                                    default=1.0,
                                                    required=False)
    tiles_lightbox_close_on_emptyspace = schema.Bool(title=_(
        u"unitegallery_lightbox_close_on_emptyspace_title",
        default=u"Close the lightbox on empty space"),
                                                     default=True)
    tiles_lightbox_show_numbers = schema.Bool(title=_(
        u"unitegallery_lightbox_show_numbers_title",
        default=u"Show numbers on the right side"),
                                              default=True)
    tiles_lightbox_numbers_size = schema.TextLine(title=_(
        u"unitegallery_lightbox_numbers_size_title",
        default=u"The size of the numbers string"),
                                                  default=u"",
                                                  required=False)
    tiles_lightbox_numbers_color = schema.TextLine(title=_(
        u"unitegallery_lightbox_numbers_color_title",
        default=u"The color of the numbers"),
                                                   default=u"",
                                                   required=False)
    tiles_lightbox_numbers_padding_top = schema.TextLine(title=_(
        u"unitegallery_lightbox_numbers_padding_top_title",
        default=u"The top padding of the numbers (used in compact mode)"),
                                                         default=u"",
                                                         required=False)
    tiles_lightbox_numbers_padding_right = schema.TextLine(title=_(
        u"unitegallery_lightbox_numbers_padding_right_title",
        default=u"The right padding of the numbers (used in compact mode)"),
                                                           default=u"",
                                                           required=False)
    tiles_lightbox_slider_image_border = schema.Bool(title=_(
        u"unitegallery_lightbox_slider_image_border_title",
        default=u"Enable border around the image (for compact type only)"),
                                                     default=True)
    tiles_lightbox_slider_image_border_width = schema.Int(title=_(
        u"unitegallery_lightbox_slider_image_border_width_title",
        default=u"Image border width"),
                                                          default=10)
    tiles_lightbox_slider_image_border_color = schema.TextLine(
        title=_(u"unitegallery_lightbox_slider_image_border_color_title",
                default=u"Image border color"),
        default=u"#ffffff")
    tiles_lightbox_slider_image_border_radius = schema.Int(title=_(
        u"unitegallery_lightbox_slider_image_border_radius_title",
        default=u"Image border radius"),
                                                           default=0)
    tiles_lightbox_slider_image_shadow = schema.Bool(title=_(
        u"unitegallery_lightbox_slider_image_shadow_title",
        default=u"Enable border shadow the image"),
                                                     default=True)
    tiles_lightbox_slider_control_swipe = schema.Bool(title=_(
        u"unitegallery_lightbox_slider_control_swipe_title",
        default=u"Enable swiping control"),
                                                      default=True)
    tiles_lightbox_slider_control_zoom = schema.Bool(title=_(
        u"unitegallery_lightbox_slider_control_zoom_title",
        default=u"Enable zooming control"),
                                                     default=True)
class IAssignedSubjectReviewer(form.Schema):
    reviewer = schema.Choice(
        title=_(u"Reviewer"),
        source=possibleSubjectReviewers,
        required=False,
    )
示例#26
0
class IBluechurchControlPanel(Interface):

    # TODO widget for bluechurchtags
    # form.widget(bluechurchtags=AjaxSelectWidget)
    bluechurchtags = schema.List(title=u'Schlagworte',
                                 description=u'Schlagworte, Tags, ',
                                 value_type=schema.TextLine(),
                                 default=[
                                     "Spiritual Jazz/Sacred Jazz", "Dixie",
                                     "Swing", "Bebop", "Latin", "Cool Jazz",
                                     "Kinder", "Ethno"
                                 ])

    eventformen = schema.List(
        title=u'Eventformen',
        description=u'Jazzgottesdienst, etc',
        value_type=schema.TextLine(),
        default=[
            "Jazzgottesdienst", "Liturgischer Jazz", "Konzert", "Workshop"
        ],
    )

    profiles_base = schema.TextLine(
        title=_(u"Profiles Folder"),
        default=u"",
        required=False,
    )
    locations_base = schema.TextLine(
        title=_(u"Locations Folder"),
        default=u"",
        required=False,
    )

    default_map_layer = schema.Choice(
        title=_(u'default_map_layer', u'Default map layer'),
        description=_(u'help_default_map_layer',
                      default=u'Set the default map layer'),
        required=False,
        default=default_map_layer,
        vocabulary='rohberg.bluechurch.map_layers')

    map_layers = schema.List(
        title=_(u'label_map_layers', u'Map Layers'),
        description=_(u'help_map_layers',
                      default=u'Set the available map layers'),
        required=False,
        default=default_map_layers,
        missing_value=[],
        value_type=schema.Choice(vocabulary='rohberg.bluechurch.map_layers'))

    GTMCode = schema.TextLine(
        title=u'GTMCode',
        description=u'Google Tag Manager Code',
        required=False,
    )

    google_api_key = schema.TextLine(
        title=_(u'label_google_api_key', default=u'Google maps API Key'),
        description=_(
            u'help_google_api_key',
            default=
            u'If you want to use the Google Maps search API for higher accuracy, you have to provide a Google Maps API key here.'
        ),
        required=False,
        default=None)
示例#27
0
class IDiscussionSettings(Interface):
    """Global discussion settings. This describes records stored in the
    configuration registry and obtainable via plone.registry.
    """

    # Todo: Write a short hint, that other discussion related options can
    # be found elsewhere in the Plone control panel:
    #
    # - Types control panel: Allow comments on content types
    # - Search control panel: Show comments in search results

    globally_enabled = schema.Bool(
        title=_(u'label_globally_enabled',
                default=u'Globally enable comments'),
        description=_(
            u'help_globally_enabled',
            default=u'If selected, users are able to post comments on the '
                    u'site. Though, you have to enable comments for '
                    u'specific content types, folders or content objects '
                    u'before users will be able to post comments.'
        ),
        required=False,
        default=False,
    )

    anonymous_comments = schema.Bool(
        title=_(u'label_anonymous_comments',
                default='Enable anonymous comments'),
        description=_(
            u'help_anonymous_comments',
            default=u'If selected, anonymous users are able to post '
                    u'comments without loggin in. It is highly '
                    u'recommended to use a captcha solution to prevent '
                    u'spam if this setting is enabled.'
        ),
        required=False,
        default=False,
    )

    anonymous_email_enabled = schema.Bool(
        title=_(u'label_anonymous_email_enabled',
                default=u'Enable anonymous email field'),
        description=_(
            u'help_anonymous_email_enabled',
            default=u'If selected, anonymous user will have to '
                    u'give their email.'),
        required=False,
        default=False
    )

    moderation_enabled = schema.Bool(
        title=_(
            u'label_moderation_enabled',
            default='Enable comment moderation'
        ),
        description=_(
            u'help_moderation_enabled',
            default=u'If selected, comments will enter a "Pending" state '
                    u'in which they are invisible to the public. A user '
                    u'with the "Review comments" permission ("Reviewer" '
                    u'or "Manager") can approve comments to make them '
                    u'visible to the public. If you want to enable a '
                    u'custom comment workflow, you have to go to the '
                    u'types control panel.'
        ),
        required=False,
        default=False,
    )

    edit_comment_enabled = schema.Bool(
        title=_(u'label_edit_comment_enabled',
                default='Enable editing of comments'),
        description=_(u'help_edit_comment_enabled',
                      default=u'If selected, supports editing '
                      'of comments for users with the "Edit comments" '
                      'permission.'),
        required=False,
        default=False,
    )

    delete_own_comment_enabled = schema.Bool(
        title=_(u'label_delete_own_comment_enabled',
                default='Enable deleting own comments'),
        description=_(u'help_delete_own_comment_enabled',
                      default=u'If selected, supports deleting '
                      'of own comments for users with the '
                      '"Delete own comments" permission.'),
        required=False,
        default=False,
    )

    text_transform = schema.Choice(
        title=_(u'label_text_transform',
                default='Comment text transform'),
        description=_(
            u'help_text_transform',
            default=u'Use this setting to choose if the comment text '
                    u'should be transformed in any way. You can choose '
                    u'between "Plain text" and "Intelligent text". '
                    u'"Intelligent text" converts plain text into HTML '
                    u'where line breaks and indentation is preserved, '
                    u'and web and email addresses are made into '
                    u'clickable links.'),
        required=True,
        default='text/plain',
        vocabulary='plone.app.discussion.vocabularies.TextTransformVocabulary',
    )

    captcha = schema.Choice(
        title=_(u'label_captcha',
                default='Captcha'),
        description=_(
            u'help_captcha',
            default=u'Use this setting to enable or disable Captcha '
                    u'validation for comments. Install '
                    u'plone.formwidget.captcha, '
                    u'plone.formwidget.recaptcha, collective.akismet, or '
                    u'collective.z3cform.norobots if there are no options '
                    u'available.'),
        required=True,
        default='disabled',
        vocabulary='plone.app.discussion.vocabularies.CaptchaVocabulary',
    )

    show_commenter_image = schema.Bool(
        title=_(u'label_show_commenter_image',
                default=u'Show commenter image'),
        description=_(
            u'help_show_commenter_image',
            default=u'If selected, an image of the user is shown next to '
                    u'the comment.'),
        required=False,
        default=True,
    )

    moderator_notification_enabled = schema.Bool(
        title=_(u'label_moderator_notification_enabled',
                default=u'Enable moderator email notification'),
        description=_(
            u'help_moderator_notification_enabled',
            default=u'If selected, the moderator is notified if a comment '
                    u'needs attention. The moderator email address can '
                    u'be set below.'),
        required=False,
        default=False,
    )

    moderator_email = schema.ASCIILine(
        title=_(
            u'label_moderator_email',
            default=u'Moderator Email Address'
        ),
        description=_(
            u'help_moderator_email',
            default=u'Address to which moderator notifications '
                    u'will be sent.'),
        required=False,
    )

    user_notification_enabled = schema.Bool(
        title=_(
            u'label_user_notification_enabled',
            default=u'Enable user email notification'
        ),
        description=_(
            u'help_user_notification_enabled',
            default=u'If selected, users can choose to be notified '
                    u'of new comments by email.'),
        required=False,
        default=False
    )
示例#28
0
class IPartner(Interface):

    title = schema.TextLine(
        title=_(u'Kurzname für den Netzwerkpartner'),
        description=_(u'Der Kurzname wird in allen Übersichten, Trefferlisten und\
                      in der Navigation angezeigt'),
        required=True,
    )

    #description = schema.Text(
    #    title=_(u'Beschreibung'),
    #    description=_(u'Hier können Sie die Leistungen des Netzwerkpartners kurz\
    #                  beschreiben, z.B.: Spezialist im Bereich Schmerztherapie'),
    #    required=False,
    #)

    art = schema.List(
        title=_(u'Art des Netzwerkpartners'),
        value_type = schema.Choice(vocabulary=spezialgebiete),
        required=True,
    )

    ik = schema.TextLine(
        title=_(u'Institutionskennzeichen'),
        required=False,
    )

    strhnr = schema.TextLine(
        title=_(u'Straße und Hausnummer'),
        required=False,
    )

    plz = schema.TextLine(
        title=_(u'Postleitzahl'),
        required=True,
    )

    ort = schema.TextLine(
        title=_(u'Ort'),
        required=True,
    )

    kontaktinformationen = schema.List(title=u"Kontaktinformationen",
                                       description=u"Bitte tragen Sie hier die Kontaktinformationen zum Netzwerkpartner ein.",
                                       value_type=DictRow(title=u"Kontaktliste", schema=IKontaktOptions),
                                       required=False)

    www = schema.URI(
        title=_(u'Weblink/Homepage'),
        description=_(u'Achtung veraltet, bitte ins Feld Kontaktinformationen übernehmen und speichern'),
        required=False,
    )

    telefon = schema.TextLine(
        title=_(u'Telefon'),
        description=_(u'Achtung veraltet, bitte ins Feld Kontaktinformationen übernehmen und speichern'),
        required=False,
    )

    mobil = schema.TextLine(
        title=_(u'Mobiltelefon'),
        description=_(u'Achtung veraltet, bitte ins Feld Kontaktinformationen übernehmen und speichern'),
        required=False,
    )

    telefax = schema.TextLine(
        title=_(u'Telefax'),
        description=_(u'Achtung veraltet, bitte ins Feld Kontaktinformationen übernehmen und speichern'),
        required=False,
    )

    email = schema.TextLine(
        title=_(u'eMail Adresse'),
        description=_(u'Achtung veraltet, bitte ins Feld Kontaktinformationen übernehmen und speichern'),
        required=False,
    )

    oeffnungszeiten = schema.List(
        title=u'Liste der Öffnungszeiten und/oder Gesprächstermine',
        value_type = schema.TextLine(),
        required = False,
    )

    zusatzinfos = schema.List(
        title=u"Zusatzinformationen zum Netzwerkpartner",
        description=u"Informationen zu Fachgebieten, Fremdsprachenkenntnissen, etc. (1 Eintrag pro Zeile).",
        value_type = schema.TextLine(),
        required = False,
    )

    ansprechpartner = schema.List(
        title=_(u'Feste Ansprechpartner'),
        description=u'Bitte nur einen Namen pro Zeile eintragen',
        value_type = schema.TextLine(),
        required=False,
    )

    bghwansprechpartner = schema.List(
        title=_(u'BGHW Ansprechpartner'),
        description=u'Bitte nur einen Namen pro Zeile eintragen',
        value_type = schema.TextLine(),
        required=False,
    )

    bemerkungen = RichText(
        title=_(u'Bemerkungen'),
        required=False,
    )

    @invariant
    def validateGeoData(data):
        if data.strhnr is not None and data.plz is not None and data.ort is not None:
            location = '%s, Deutschland' %(data.plz)
            latlong = geolocator.geocode(location, addressdetails=True, timeout=10)
            if not latlong:
                location = '%s, %s, Deutschland' %(data.strhnr, data.ort)
                latlong = geolocator.geocode(location, addressdetails=True, timeout=10)
            if not latlong:
                raise NoGeoLocation(u"Für diese Adresse kann keine Geolocation ermittelt werden.")
            plz = latlong.raw['address']['postcode']
            meldung = u'Für Ihre Adresse wurde eine Geolocation mit der PLZ: %s ermittelt. Diese stimmt nicht mit der angegebenen PLZ überein.' % plz
            if plz != data.plz:
                raise NoGeoLocation(meldung)
示例#29
0
    def tabs(self):
        tabs = super(SQLTypeFieldsPage, self).tabs
        tabs += ((_('Data'), '@@data'), )
        return tabs

    @property
    def form(self):
        if self.context.fti.hasDynamicSchema:
            return SQLEnhancedSchemaListing
        else:
            return ReadOnlySchemaListing


TupleFactory = FieldFactory(schema.Tuple,
                            _(u'label_tuple_field', default=u'Tuple'),
                            value_type=schema.Choice(values=[]))


class ITuple(schema.interfaces.ITuple, schema.interfaces.IFromUnicode):
    pass


class SQLCollectionTermsVocabulary(CollectionTermsVocabulary):
    """ITerms adapter for zope.schema.ICollection based implementations using
    vocabulary."""

    zope.component.adapts(ISQLDexterityItem, iz3cform.IFormLayer,
                          zope.interface.Interface,
                          zope.schema.interfaces.ICollection,
                          zope.schema.interfaces.IBaseVocabulary,
                          iz3cform.IWidget)
示例#30
0
class INavigationTile(Schema):
    """A tile which can render the navigation tree."""

    name = schema.TextLine(
        title=_(u'Title'),
        description=_(u'The title of the navigation tree.'),
        default=u'',
        required=False,
    )

    root = schema.Choice(
        title=_(u'Root node'),
        description=_(
            u'You may search for and choose a folder to act as the root '
            u'of the navigation tree. Leave blank to use the Plone site '
            u'root.'
        ),
        source=CatalogSource(),
        required=False,
    )

    includeTop = schema.Bool(
        title=_(u'Include top node'),
        description=_(
            u'Whether or not to show the top, or "root", node in the '
            u'navigation tree. This is affected by the "Start level" '
            u'setting.'
        ),
        default=False,
        required=False,
    )

    currentFolderOnly = schema.Bool(
        title=_(u'Only show the contents of the current folder.'),
        description=_(
            u'If selected, the navigation tree will only show the current '
            u'folder and its children at all times.'
        ),
        default=False,
        required=False,
    )

    topLevel = schema.Int(
        title=_(u'Start level'),
        description=_(
            u'An integer value that specifies the number of folder levels '
            u'below the site root that must be exceeded before the '
            u'navigation tree will display. 0 means that the navigation '
            u'tree should be displayed everywhere including pages in the '
            u'root of the site. 1 means the tree only shows up inside '
            u'folders located in the root and downwards, never showing at '
            u'the top level.'
        ),
        default=0,
        required=False,
    )

    bottomLevel = schema.Int(
        title=_(u'Navigation tree depth'),
        description=_(
            u'How many folders should be included before the navigation '
            u'tree stops. 0 means no limit. 1 only includes the root '
            u'folder.'
        ),
        default=0,
        required=False,
    )