示例#1
0
class IntentionSchema(Schema):
    """Schema for Intention"""

    relatedexplanation = RelatedExplanationSchema(widget=SimpleMappingWidget(
        css_class="explanations-bloc"))

    intention = IntentionItemSchema(widget=SimpleMappingWidget(
        css_class="intention-bloc"))
示例#2
0
class StructureBaseSchema(VisualisableElementSchema):
    """Schema for Structure"""

    structure_name = colander.SchemaNode(
        colander.String(),
        title=_('Structure name'),
        )

    domains = colander.SchemaNode(
        colander.String(),
        widget=LimitedTextAreaWidget(rows=5,
                                     cols=30,
                                     limit=350,
                                     alert_values={'limit': 350},
                                     css_class="ce-field-description"),
        title=_("Cultural domains"),
        missing="",
        )

    address = colander.SchemaNode(
        colander.Sequence(),
        omit(AddressSchema(name='address',
                     widget=SimpleMappingWidget(
                         css_class='address-well object-well default-well')),
             ['_csrf_token_']),
        widget=SequenceWidget(
            max_len=1,
            min_len=1,
            add_subitem_text_template=_('Add a new address')),
        title=_('Address'),
        )

    contact = colander.SchemaNode(
        colander.Sequence(),
        omit(select(ContactSchema(name='contact',
                           widget=SimpleMappingWidget(
                           css_class='address-well object-well default-well')),
                    ['person_to_contact', 'public_phone',
                     'professional_phone', 'fax', 'website']),
             ['_csrf_token_']),
        widget=SequenceWidget(
            max_len=1,
            min_len=1,
            add_subitem_text_template=_('Add a new contact')),
        title=_('Contact'),
        )

    picture = colander.SchemaNode(
        ObjectData(Image),
        widget=get_file_widget(file_type=['image']),
        title=_('Logo'),
        required=False,
        missing=None,
        )
示例#3
0
class ContentsByDatesSchema(ContentsByKeywordsSchema):

    dates = omit(
        IntervalDates(widget=SimpleMappingWidget(css_class="filter-block"
                                                 " object-well"
                                                 " default-well")),
        ["_csrf_token_"])
示例#4
0
class MailSeqTemplate(Schema):

    mail_id = colander.SchemaNode(
        colander.String(),
        widget=deform.widget.HiddenWidget(),
        title=_('Mail id'),
        )

    title = colander.SchemaNode(
        colander.String(),
        widget=deform.widget.TextInputWidget(template='readonly/textinput'),
        title=_('Title'),
        missing=""
        )

    languages = colander.SchemaNode(
        colander.Sequence(),
        omit(select(MailTemplate(name='language',
                                 title=_('language'),
                                 widget=SimpleMappingWidget(
                                         css_class="object-well default-well mail-template-well mail-template-block")),
                        ['locale', 'subject', 'template']),
                    ['_csrf_token_']),
        widget=SequenceWidget(
            min_len=1,
            max_len=len(AVAILABLE_LANGUAGES),
            add_subitem_text_template=_('Add a new language')),
        title=_('Languages'),
        )
示例#5
0
class LabelsSchema(Schema):

    labels = colander.SchemaNode(
        colander.Set(),
        widget=labels_choices,
        title=_('Labels'),
        description=_('You can add labels to this object.'),
        default=[],
        missing=[]
        )

    new_labels = colander.SchemaNode(
        colander.Sequence(),
        omit(select(LabelSchema(
            name='new_label',
            factory=Label,
            editable=True,
            widget=SimpleMappingWidget(
               css_class='label-well object-well default-well')),
            ['title', 'picture']),
        ['_csrf_token_']),
        widget=SequenceWidget(
            add_subitem_text_template=_('Add a new label')),
        title=_('New labels'),
        )
示例#6
0
class FilterConfigurationSchema(Schema):

    filters = colander.SchemaNode(
        colander.Sequence(),
        omit(select(FilterSchema(name='filter',
                                 title=_('Filter'),
                                 widget=SimpleMappingWidget(
                                         css_class="object-well default-well mail-template-well mail-template-block")),
                       ['metadata_filter', 'geographic_filter',
                        'temporal_filter', 'contribution_filter',
                        'text_filter', 'other_filter']),
                 ["_csrf_token_"]),
        title=_('Filters'),
        widget=SequenceWidget(
            min_len=1,
            add_subitem_text_template=_('Add a new filter')))

    hold_filter = colander.SchemaNode(
        colander.Boolean(),
        widget=deform.widget.CheckboxWidget(),
        label=_('Keep the filter after sign in'),
        title='',
        default=True,
        missing=True
        )
示例#7
0
class EventsInterfaceConfigurationSchema(Schema):

    nb_event_maxi = colander.SchemaNode(
        colander.Integer(),
        title=_('Maximum number of events per Member'),
        default=7,
    )

    event_descriptions = colander.SchemaNode(
        colander.Sequence(),
        omit(
            select(
                EventDescriptionTemplate(
                    name='description',
                    title=_('Description'),
                    widget=SimpleMappingWidget(
                        css_class=
                        "object-well default-well mail-template-well mail-template-block"
                    )), ['locale', 'template']), ['_csrf_token_']),
        widget=SequenceWidget(
            min_len=1,
            max_len=len(AVAILABLE_LANGUAGES),
            add_subitem_text_template=_('Add a new description')),
        title=_('Descriptions'),
        default=descriptions_default)
示例#8
0
class CreationCulturelleApplicationSchema(VisualisableElementSchema):
    """Schema for application configuration."""

    name = NameSchemaNode(editing=context_is_a_root, )

    titles = colander.SchemaNode(
        colander.Sequence(),
        colander.SchemaNode(colander.String(), name=_("Title")),
        widget=SequenceWidget(),
        default=DEFAULT_TITLES,
        title=_('List of titles'),
    )

    tree = colander.SchemaNode(
        typ=DictSchemaType(),
        validator=colander.All(keywords_validator),
        widget=keyword_widget,
        default=DEFAULT_TREE,
        title=_('Categories'),
    )

    organizations = colander.SchemaNode(
        colander.Sequence(),
        omit(
            OrganizationSchema(factory=Organization,
                               editable=True,
                               name=_('Organization'),
                               widget=SimpleMappingWidget(
                                   css_class='object-well default-well'),
                               omit=['managers']), ['_csrf_token_']),
        widget=organizations_choice,
        title=_('Organizations'),
    )
class ServiceDefinitionSchema(VisualisableElementSchema):
    """Schema for service"""

    description = colander.SchemaNode(
        colander.String(),
        widget=LimitedTextAreaWidget(rows=5,
                                     cols=30,
                                     limit=350,
                                     alert_values={'limit': 350},
                                     css_class="ce-field-description"),
        description=_('Thank you to enter a description for your service.'),
        title=_("Description of the service"),
    )

    details = colander.SchemaNode(
        colander.String(),
        widget=RichTextWidget(),
        missing="",
        description=_('Other information about the service.'),
        title=_('Details'),
    )

    subscription = omit(
        SubscriptionSchema(widget=SimpleMappingWidget(
            css_class='object-well default-well')), ['_csrf_token_'])
示例#10
0
class OptionalVenueSchema(VisualisableElementSchema, SearchableEntitySchema):

    typ_factory = ObjectData

    name = NameSchemaNode(
        editing=context_is_a_venue,
        )

    id = colander.SchemaNode(
        colander.String(),
        widget=deform.widget.HiddenWidget(),
        title="ID",
        missing=""
        )

    title = colander.SchemaNode(
        colander.String(),
        widget=venue_choice,
        title=_('Venue title'),
        description=_('Indicate the venue (room, theatre, lecture hall, square, etc.).'),
        )

    description = colander.SchemaNode(
        colander.String(),
        widget=RichTextWidget(),
        description=_("Vous pouvez ajouter ou éditer la description du lieu. Cette description doit porter sur le lieu de l'annonce et non sur l'annonce."),
        title=_("Venue description")
        )

    addresses = colander.SchemaNode(
        colander.Sequence(),
        omit(AddressSchema(name='address',
                           widget=SimpleMappingWidget(
                               css_class='address-well object-well default-well')),
        ['_csrf_token_']),
        widget=SimpleSequenceWidget(
            min_len=1,
            add_subitem_text_template=_('Add a new address'),
            remove_subitem_text_template=_('Remove the address')),
        title=_('Venue addresses'),
        )

    other_conf = omit(MoreInfoVebueSchema(widget=SimpleMappingtWidget(
                        mapping_css_class='controled-form'
                                          ' object-well hide-bloc',
                        ajax=True,
                        control_css_class='optional-venue-form',
                        activator_css_class="glyphicon glyphicon-map-marker",
                        activator_title=_("Avez-vous une minute ? Afin d'améliorer la visibilité et la pertinence de votre événement, pensez à vérifier ou compléter les informations associées au lieu en cliquant ici."))),
                        ["_csrf_token_"])

    origin_oid = colander.SchemaNode(
        colander.Int(),
        widget=deform.widget.HiddenWidget(),
        title=_('OID'),
        missing=0
        )
示例#11
0
    def _addItemsNode(self):
        if self.schema.get('views').children[0].get('item') is not None:
            self.schema.get('views').children[0].__delitem__('item') #return

        schema = self.view.schema.clone()
        schema.name = 'item'
        schema.widget = SimpleMappingWidget()
        viewsschemanode = self.schema.get('views')
        viewsschemanode.widget = self.widget
        viewsschemanode.children[0].children.append(schema)
示例#12
0
class KeywordsConfSchema(Schema):

    tree = colander.SchemaNode(
        typ=DictSchemaType(),
        validator=colander.All(keywords_validator),
        widget=keyword_widget,
        default=DEFAULT_TREE,
        title=_('Categories'),
        )

    keywords_mapping = omit(KeywordsMappingSchema(widget=SimpleMappingWidget()),
                            ["_csrf_token_"])
示例#13
0
class ScheduleSchema(VisualisableElementSchema):
    """Schema for schedule"""

    name = NameSchemaNode(editing=context_is_a_schedule, )

    dates = colander.SchemaNode(
        colander.String(),
        validator=dates_validator,
        widget=DateIcalWidget(css_class="schedule-dates"),
        description=_('Indicate the dates and hours of the event.'),
        title=_('Dates'),
    )

    ticket_type = colander.SchemaNode(
        colander.String(),
        widget=ticket_type_choice,
        title=_('Ticket type'),
    )

    ticketing_url = colander.SchemaNode(
        colander.String(),
        widget=TextInputWidget(item_css_class="hide-bloc item-price"),
        title=_('Ticketing URL'),
        description=
        _('If you have an online ticketing service, you can enter the URL here.'
          ),
        missing='')

    price = colander.SchemaNode(
        colander.String(),
        default='0',
        widget=TextInputWidget(item_css_class="hide-bloc item-price"),
        title=_('Price'),
    )

    venue = omit(
        select(
            OptionalVenueSchema(
                editable=True,
                factory=Venue,
                omit=('id', ),
                name='venue',
                title=_('Venue'),
                oid='venue',
                widget=SimpleMappingWidget(
                    css_class="venue-block",
                    mapping_title=_("The venue of the event"))), [
                        'id', 'origin_oid', 'title', 'description',
                        'addresses', 'other_conf'
                    ]),
        #'kind', 'website','phone', 'capacity',
        ['_csrf_token_', '__objectoid__'])
示例#14
0
class ArtistBlockSchema(Schema):

    artist = omit(
        select(
            ArtistInformationSheetSchema(
                editable=True,
                omit=('id', ),
                widget=SimpleMappingWidget(
                    css_class=
                    'artist-data director-data object-well default-well')), [
                        'id', 'origin_oid', 'title', 'description', 'picture',
                        'biography', 'is_director'
                    ]), ['_csrf_token_', '__objectoid__'])
示例#15
0
class InviteUsersSchema(Schema):

    invitations = colander.SchemaNode(
                colander.Sequence(),
                select(omit(InvitationSchema(factory=Invitation,
                                         editable=True,
                                         name='Invitation',
                                         widget=SimpleMappingWidget(css_class='object-well default-well')), 
                            ['_csrf_token_']), 
                       ['user_title', 'roles', 'first_name', 
                       'last_name','email']),
                widget=SequenceWidget(min_len=1),
                title=_('The invitations')
                )
示例#16
0
class CreatOrganizationsSchema(Schema):

    organizations = colander.SchemaNode(
        colander.Sequence(),
        select(
            omit(
                OrganizationSchema(factory=Organization,
                                   editable=True,
                                   name='Organization',
                                   widget=SimpleMappingWidget(
                                       css_class='object-well default-well')),
                ['_csrf_token_']),
            ['title', 'description', 'logo', 'cover_picture', 'contacts']),
        widget=SequenceWidget(min_len=1),
        title=_('Organizations to create'))
示例#17
0
class MailTemplatesConfigurationSchema(Schema):

    mail_templates = colander.SchemaNode(
        colander.Sequence(),
        omit(select(MailSeqTemplate(name='template',
                                 title=_('E-mail template'),
                                 widget=SimpleMappingWidget(
                                         css_class="object-well default-well mail-template-well mail-template-block")),
                        ['mail_id', 'title', 'languages']),
                    ['_csrf_token_']),
        widget=templates_widget,
        default=templates_default,
        missing=templates_default,
        title=_('E-mail templates'),
        )
示例#18
0
class KeywordsMappingSchema(Schema):

    mapping = colander.SchemaNode(
        colander.Sequence(),
        omit(
            select(
                KeywordMappingSchema(
                    name='mapping',
                    widget=SimpleMappingWidget(
                        css_class='object-well default-well')),
                ['node_id', 'aliases', 'content_types']), ['_csrf_token_']),
        widget=SequenceWidget(
            add_subitem_text_template=_("Add a new keyword's mapping")),
        title=_("keywords's mapping"),
        missing=[])
示例#19
0
class CinemaReviewSchema(BaseReviewSchema):
    """Schema for review"""

    name = NameSchemaNode(editing=context_is_a_cinema_review, )

    nationality = colander.SchemaNode(colander.String(),
                                      widget=TextInputWidget(),
                                      title=_("Nationality"))

    directors_ids = colander.SchemaNode(colander.Set(),
                                        widget=directors_choice,
                                        title=_('Directors'),
                                        missing=[])

    directors = colander.SchemaNode(
        colander.Sequence(),
        omit(
            select(
                ArtistInformationSheetSchema(
                    editable=True,
                    factory=ArtistInformationSheet,
                    omit=('id', ),
                    widget=SimpleMappingWidget(
                        css_class='director-data object-well'
                        ' default-well'),
                    name=_('Director')), [
                        'id', 'origin_oid', 'title', 'description', 'picture',
                        'biography'
                    ]), ['_csrf_token_', '__objectoid__']),
        widget=SequenceWidget(css_class='directors-values',
                              template='lac:views/'
                              'templates/sequence_modal.pt',
                              item_template='lac:views/'
                              'templates/sequence_modal_item.pt'),
        title=_('Directors'),
    )

    duration = colander.SchemaNode(colander.String(),
                                   widget=TextInputWidget(),
                                   title=_("Duration"))
    appreciation = colander.SchemaNode(colander.String(),
                                       widget=appreciation_choice,
                                       title=_("Appreciation"))
    opinion = colander.SchemaNode(colander.String(),
                                  widget=RichTextWidget(),
                                  title=_("Opinion"))
示例#20
0
class OrganizationSchema(VisualisableElementSchema):
    """Schema for Organization"""

    name = NameSchemaNode(editing=context_is_a_organization, )

    logo = colander.SchemaNode(
        ObjectData(Image),
        widget=get_file_widget(),
        required=False,
        missing=None,
        title=_('Logo'),
    )

    cover_picture = colander.SchemaNode(
        ObjectData(File),
        widget=get_file_widget(file_extensions=['png', 'jpg', 'svg']),
        title=_('Cover picture'),
        missing=None,
        description=_("Only PNG and SVG files are supported."),
    )

    contacts = colander.SchemaNode(
        colander.Sequence(),
        omit(
            select(
                ContactSchema(
                    name='contact',
                    widget=SimpleMappingWidget(
                        css_class='contact-well object-well default-well')), [
                            'title', 'address', 'phone', 'surtax', 'email',
                            'website', 'fax'
                        ]), ['_csrf_token_']),
        widget=SequenceWidget(
            min_len=1, add_subitem_text_template=_('Add a new contact')),
        title='Contacts',
        oid='contacts')

    members = colander.SchemaNode(colander.Set(),
                                  widget=members_choice,
                                  title=_('Members'),
                                  missing=[])

    managers = colander.SchemaNode(colander.Set(),
                                   widget=managers_choice,
                                   title=_('The managers'),
                                   missing=[])
示例#21
0
class ContentsByKeywordsSchema(Schema):

    content_types = colander.SchemaNode(
        colander.Set(),
        widget=content_types_choices,
        title=_('Types'),
        description=_('You can select the content types to be displayed.'),
        default=default_content_types,
        missing=default_content_types)

    states = colander.SchemaNode(
        colander.Set(),
        widget=states_choices,
        title=_('States'),
        description=_(
            'You can select the states of the contents to be displayed.'),
        default=['published'],
        missing=['published'])

    tree = colander.SchemaNode(
        typ=DictSchemaType(),
        widget=core.keyword_widget,
        default=DEFAULT_TREE,
        title=_('Keywords'),
        description=
        _('Indicate keywords. You can specify a second keyword level for each keyword chosen.'
          ))

    author = colander.SchemaNode(
        ObjectType(),
        widget=authors_choices,
        title=_('Author'),
        description=_(
            'You can enter the author name of the contents to be displayed.'),
        default=None,
        missing=None)

    dates = omit(
        PublicationDates(widget=SimpleMappingWidget(css_class="filter-block"
                                                    " object-well"
                                                    " default-well")),
        ["_csrf_token_"])
示例#22
0
class ContentsByKeywordsSchema(Schema):

    content_types = colander.SchemaNode(
        colander.Set(),
        widget=content_types_choices,
        title=_('Types'),
        description=_('You can select the content types to be displayed.'),
        default=default_content_types,
        missing=default_content_types)

    states = colander.SchemaNode(
        colander.Set(),
        widget=states_choices,
        title=_('States'),
        description=_(
            'You can select the states of the contents to be displayed.'),
        default=['published'],
        missing=['published'])

    keywords = colander.SchemaNode(
        colander.Set(),
        widget=keywords_choice,
        title=_('Keywords'),
        description=_(
            "You can select the keywords of the contents to be displayed."),
        missing=[])

    author = colander.SchemaNode(
        ObjectType(),
        widget=authors_choices,
        title=_('Author'),
        description=_(
            'You can enter the author name of the contents to be displayed.'),
        default=None,
        missing=None)

    dates = omit(
        PublicationDates(widget=SimpleMappingWidget(css_class="filter-block"
                                                    " object-well"
                                                    " default-well")),
        ["_csrf_token_"])
示例#23
0
class CinemagoerSchema(Schema):

    next_date = colander.SchemaNode(
        colander.Date(),
        title=_('End date of publication'),
        missing=None,
    )

    venues = colander.SchemaNode(
        colander.Sequence(),
        omit(
            select(
                CinemaVenueSchema(
                    name='venue',
                    title=_('Venue'),
                    widget=SimpleMappingWidget(
                        css_class=
                        "venue-block cinema-block object-well default-well")),
                ['id', 'title', 'schedules']), ['_csrf_token_']),
        widget=SequenceWidget(min_len=1, css_class="add-venues-mode"),
        title=_('Cinemas'),
    )
示例#24
0
class MoreInfoVebueSchema(Schema):

    kind = colander.SchemaNode(
        colander.Set(),
        widget=kind_choice,
        title=_('Venue kinds'),
        missing=[],
        description=_('Please select kinds of the venue. If the type does not exist, you can add it.')
        )

    capacity = colander.SchemaNode(
        colander.String(),
        title=_('Venue capacity'),
        description=_("Please indicate the reception capacity."),
        missing=""
        )

    handicapped_accessibility = colander.SchemaNode(
        colander.Boolean(),
        label=_('Handicapped accessibility'),
        title='',
        missing=False
    )

    contacts = colander.SchemaNode(
        colander.Sequence(),
        omit(select(ContactSchema(name='contact',
                                  widget=SimpleMappingWidget(
                                  css_class='contact-well object-well default-well')),
                    ['title', 'phone', 'surtax', 'email', 'website', 'fax']),
            ['_csrf_token_']),
        widget=SimpleSequenceWidget(
            add_subitem_text_template=_('Add a new contact'),
            remove_subitem_text_template=_('Remove the contact')),
        title=_('Venue contacts'),
        oid='contacts'
        )
示例#25
0
class MetadataSchema(Schema):

    visibility_dates = colander.SchemaNode(
        colander.String(),
        validator=dates_validator,
        widget=DateIcalWidget(),
        title=_('Visibility dates'),
        missing=''
        )

    release_date = colander.SchemaNode(
        colander.DateTime(),
        title=_('Release date'),
        default=release_date_default
        )

    accessibility = colander.SchemaNode(
        colander.Boolean(),
        widget=deform.widget.CheckboxWidget(),
        label=_('Make accessible only on this site'),
        title='',
        default=default_accessibility,
        missing=False
        )

    connections_to = colander.SchemaNode(
        colander.Set(),
        widget=connect_to_choices,
        title=_('Connect to'),
        description=_('You can connect this object to other objects.'),
        default=[],
        missing=[]
        )

    object_labels = omit(LabelsSchema(widget=SimpleMappingWidget(
                                   css_class='object-well default-well')),
                  ["_csrf_token_"])
示例#26
0
class OtherSchema(Schema):

    title = colander.SchemaNode(
        colander.String(),
        title=_('Title'),
        description=_("The title of the application"),
        missing=""
        )

    locale = colander.SchemaNode(
        colander.String(),
        title=_('Locale'),
        widget=locale_widget,
        missing=locale_missing,
        validator=colander.OneOf(AVAILABLE_LANGUAGES),
    )

    contacts = colander.SchemaNode(
        colander.Sequence(),
        omit(select(ContactSchema(name='contact',
                                  widget=SimpleMappingWidget(
                                  css_class='contact-well object-well default-well')),
                    ['title', 'address', 'phone', 'surtax', 'email', 'website', 'fax']),
            ['_csrf_token_']),
        widget=SequenceWidget(
            add_subitem_text_template=_('Add a new contact')),
        title='Contacts',
        oid='contacts'
        )

    analytics = colander.SchemaNode(
        colander.String(),
        widget=deform.widget.TextAreaWidget(rows=4, cols=60),
        title=_('Analytics'),
        missing=''
        )
class NovaIdeoApplicationSchema(VisualisableElementSchema):
    """Schema for Nova-Ideo configuration"""

    typ_factory = ObjectData

    name = NameSchemaNode(editing=context_is_a_root, )

    invitations = colander.SchemaNode(
        colander.Sequence(),
        omit(
            InvitationSchema(factory=Invitation,
                             editable=True,
                             name=_('The invitations'),
                             widget=SimpleMappingWidget(
                                 css_class='object-well default-well')),
            ['_csrf_token_']),
        widget=invitations_choice,
        title=_('List of invitations'),
    )

    organizations = colander.SchemaNode(
        colander.Sequence(),
        omit(
            OrganizationSchema(factory=Organization,
                               editable=True,
                               name='organization',
                               widget=SimpleMappingWidget(
                                   css_class='object-well default-well')),
            ['_csrf_token_']),
        widget=organizations_choice,
        title=_('The Organizations'),
    )

    work_conf = omit(
        WorkParamsConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_icon="glyphicon glyphicon-filter",
            activator_title=_('Set up work parameters'))), ["_csrf_token_"])

    mail_conf = omit(
        MailTemplatesConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' mail-templats-container hide-bloc',
            ajax=True,
            activator_icon="glyphicon glyphicon-envelope",
            activator_title=_('Edit e-mail templates'))), ["_csrf_token_"])

    user_conf = omit(
        UserParamsConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_icon="glyphicon glyphicon-user",
            activator_title=_('Configure user parameters'))), ["_csrf_token_"])

    keywords_conf = omit(
        KeywordsConfSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_icon="glyphicon glyphicon-tags",
            activator_title=_('Configure keywords'))), ["_csrf_token_"])

    other_conf = omit(
        OtherSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_icon="glyphicon glyphicon-plus",
            activator_title=_('Other'))), ["_csrf_token_"])

    ui_conf = omit(
        UserInterfaceConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_icon="glyphicon glyphicon-eye-open",
            activator_title=_('Configure the user interface'))),
        ["_csrf_token_"])

    homepage_conf = omit(
        HomepageConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_icon="glyphicon glyphicon-home",
            activator_title=_('Configure the homepage'))), ["_csrf_token_"])

    notif_conf = omit(
        NotificationConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_icon="glyphicon glyphicon-bell",
            activator_title=_('Configure the push notification'))),
        ["_csrf_token_"])
示例#28
0
class NewIdeaSchema(Schema):

    new_idea = select(
        IdeaSchema(factory=Idea, editable=True, widget=SimpleMappingWidget()),
        ['title', 'text', 'keywords'])
示例#29
0
class SiteFolderSchema(VisualisableElementSchema):
    """Schema for schedule"""

    typ_factory = ObjectData

    name = NameSchemaNode(editing=context_is_a_sitefolder, )

    title = colander.SchemaNode(
        colander.String(),
        title=_('Title'),
    )

    urls_ids = colander.SchemaNode(
        colander.Set(),
        widget=urls_ids_choise,
        title=_('URLs ids'),
    )

    contacts = colander.SchemaNode(
        colander.Sequence(),
        omit(
            select(
                ContactSchema(
                    name='contact',
                    widget=SimpleMappingWidget(
                        css_class='contact-well object-well default-well')), [
                            'title', 'address', 'phone', 'surtax', 'email',
                            'website', 'fax'
                        ]), ['_csrf_token_']),
        widget=SequenceWidget(
            min_len=1, add_subitem_text_template=_('Add a new contact')),
        title='Contacts',
        oid='contacts')

    filter_conf = omit(
        FilterConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_css_class="glyphicon glyphicon-filter",
            activator_title=_('Set up a filter'))), ["_csrf_token_"])

    mail_conf = omit(
        MailTemplatesConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_css_class="glyphicon glyphicon-envelope",
            activator_title=_('Edit mail templates'))), ["_csrf_token_"])

    ui_conf = omit(
        UserInterfaceConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_css_class="glyphicon glyphicon-eye-open",
            activator_title=_('Configure the ui'))), ["_csrf_token_"])

    pub_conf = omit(
        PublicationConfigurationSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_css_class="lac-icon icon-history",
            activator_title=_('Configure the publication settings'))),
        ["_csrf_token_"])
    keywords_conf = omit(
        KeywordsConfSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_css_class="glyphicon glyphicon-tags",
            activator_title=_('Configure the keywords tree'))),
        ["_csrf_token_"])

    other_conf = omit(
        OtherSchema(widget=SimpleMappingtWidget(
            mapping_css_class='controled-form'
            ' object-well default-well hide-bloc',
            ajax=True,
            activator_css_class="glyphicon glyphicon-plus",
            activator_title=_('Other'))), ["_csrf_token_"])
示例#30
0
class SmartFolderSchema(VisualisableElementSchema):
    """Schema for keyword"""

    name = NameSchemaNode(editing=context_is_a_smartfolder, )

    title = colander.SchemaNode(
        colander.String(),
        widget=TextInputWidget(css_class="smartfolder-title-field"),
        title=_('Title'),
    )

    description = colander.SchemaNode(
        colander.String(),
        widget=deform.widget.TextAreaWidget(rows=4, cols=60),
        title=_("Description"),
    )

    locale = colander.SchemaNode(
        colander.String(),
        title=_('Locale'),
        description=_('The language for which the folder will be displayed'),
        widget=locale_widget,
        missing='')

    cover_picture = colander.SchemaNode(
        ObjectData(File),
        widget=get_file_widget(file_extensions=['png', 'jpg', 'svg']),
        title=_('Cover picture'),
        missing=None,
        description=_("Only PNG and SVG files are supported."),
    )

    filters = colander.SchemaNode(
        colander.Sequence(),
        omit(
            select(
                FilterSchema(name='filter',
                             title=_('Filter'),
                             widget=SimpleMappingWidget(
                                 css_class='object-well default-well')),
                [
                    'metadata_filter', 'temporal_filter',
                    'contribution_filter', 'text_filter', 'other_filter'
                ]), ["_csrf_token_"]),
        widget=SequenceWidget(add_subitem_text_template=_('Add a new filter')),
        title=_('Filters'),
        description=_('Applied filters'),
        missing=[])

    contents = colander.SchemaNode(
        colander.Set(),
        widget=relatedcontents_choice,
        title=_('Associated contents'),
        description=_('Choose the contents to be associated'),
        missing=[],
        default=[],
    )

    view_type = colander.SchemaNode(colander.String(),
                                    widget=view_type_widget,
                                    title=_("View type"),
                                    description=_('How to display contents'),
                                    default='default')

    icon_data = colander.SchemaNode(DictSchemaType(),
                                    widget=BootstrapIconInputWidget(),
                                    title=_('Icon'),
                                    default={
                                        'icon': 'glyphicon-folder-open',
                                        'icon_class': 'glyphicon'
                                    },
                                    description=_('Select an icon.'))

    style = omit(CssSchema(widget=SimpleMappingWidget()), ["_csrf_token_"])

    @invariant
    def contact_invariant(self, appstruct):
        contents = appstruct.get('contents', [])
        filters = appstruct.get('filters', [])
        if not contents and not filters:
            raise colander.Invalid(
                self, _('Filters or associated contents must be specified.'))