Esempio n. 1
0
class IAddProposal(IProposal):

    proposal_template = TableChoice(
        title=_('label_proposal_template', default=u'Proposal template'),
        vocabulary='opengever.meeting.ProposalTemplatesForCommitteeVocabulary',
        required=True,
        show_filter=True,
        vocabulary_depends_on=['form.widgets.committee'],
        columns=({
            'column': 'title',
            'column_title': _(u'label_title', default=u'Title'),
            'sort_index': 'sortable_title',
            'transform': document_with_icon
        }, {
            'column': 'Creator',
            'column_title': _(u'label_creator', default=u'Creator'),
            'sort_index': 'document_author'
        }, {
            'column': 'modified',
            'column_title': _(u'label_modified', default=u'Modified'),
            'transform': helper.readable_date
        }))

    form.widget(edit_after_creation=SingleCheckBoxFieldWidget)
    edit_after_creation = Bool(title=_(u'label_edit_after_creation',
                                       default=u'Edit after creation'),
                               default=True,
                               required=False)
Esempio n. 2
0
class ICreateDossierFromTemplate(model.Schema):
    """Schema for first wizard step to select the dossiertemplate
    """
    template = TableChoice(title=_(u"label_template", default=u"Template"),
                           source=get_dossier_templates,
                           required=True,
                           show_filter=True,
                           columns=({
                               'column':
                               'title',
                               'column_title':
                               _(u'label_title', default=u'Title'),
                               'sort_index':
                               'sortable_title'
                           }, {
                               'column':
                               'Creator',
                               'column_title':
                               _(u'label_creator', default=u'Creator'),
                               'sort_index':
                               'document_author'
                           }, {
                               'column':
                               'modified',
                               'column_title':
                               _(u'label_modified', default=u'Modified'),
                               'transform':
                               helper.readable_date
                           }))
Esempio n. 3
0
class ICreateDocumentFromOneOffixxTemplate(model.Schema):

    # XXX - this always renders the --NOVALUE-- as the actually chosen
    # default is actually loaded over AJAX - confusing and bad UX
    template_group = schema.Choice(
        title=_(u'label_template_group', default=u'Template group'),
        source=list_template_groups,
        required=False,
        defaultFactory=default_template_group,
    )

    template = TableChoice(
        title=_(u"label_template", default=u"Template"),
        source=list_templates,
        required=True,
        show_filter=True,
        vocabulary_depends_on=['form.widgets.template_group'],
        columns=({
            'column': 'title',
            'column_title': _(u'label_title', default=u'Title'),
            'sort_index': 'sortable_title'
        }, ))

    title = schema.TextLine(title=_(u"label_title", default=u"Title"),
                            required=True)
Esempio n. 4
0
class IWidgetTestRequiredFormSchema(Interface):
    # field with required default columns
    required_radio_table_field = TableChoice(
        required=True,
        title=u"default_table",
        show_filter=True,
        vocabulary=get_radio_table_vocabulary(),
    )
Esempio n. 5
0
class ISelectRecipientAddress(form.Schema):

    address = TableChoice(
        title=_(u"label_address", default=u"Address"),
        required=False,
        source=make_address_vocabulary,
        columns=(
            {'column': 'label',
             'column_title': _(u'label_label', default=u'Label')},
            {'column': 'address',
             'column_title': _(u'label_address', default=u'Address'),
             'transform': address_lines},
        ))

    mail_address = TableChoice(
        title=_(u"label_mail_address", default=u"Mail-Address"),
        required=False,
        source=make_mail_address_vocabulary,
        columns=(
            {'column': 'label',
             'column_title': _(u'label_label', default=u'Label')},
            {'column': 'address',
             'column_title': _(u'label_mail_address', default=u'Mail-Address')},
        ))

    phonenumber = TableChoice(
        title=_(u"label_phonenumber", default=u"Phonenumber"),
        required=False,
        source=make_phonenumber_vocabulary,
        columns=(
            {'column': 'label',
             'column_title': _(u'label_label', default=u'Label')},
            {'column': 'phone_number',
             'column_title': _(u'label_phonenumber', default=u'Phonenumber')},
        ))

    url = TableChoice(
        title=_(u"label_url", default=u"URL"),
        required=False,
        source=make_url_vocabulary,
        columns=(
            {'column': 'label',
             'column_title': _(u'label_label', default=u'Label')},
            {'column': 'url',
             'column_title': _(u'label_url', default=u'URL')},
        ))
Esempio n. 6
0
class IWidgetTestFormSchema(Interface):

    # field with default columns
    default_radio_table_field = TableChoice(
        required=False,
        title=u"default_table",
        show_filter=True,
        vocabulary=get_radio_table_vocabulary(),
    )
    # field with custom columns
    custom_radio_table_field = TableChoice(
        required=False,
        title=u"custom_table",
        vocabulary=get_radio_table_vocabulary(),
        columns=({
            'column': 'description',
            'column_title': u'Description'
        }, ))
    empty_radio_table_field = TableChoice(required=False,
                                          title=u"empty_table",
                                          vocabulary=SimpleVocabulary([]))
Esempio n. 7
0
class ICreateDocumentFromTemplate(model.Schema):

    template = TableChoice(title=_(u"label_template", default=u"Template"),
                           source=get_templates,
                           required=True,
                           show_filter=True,
                           columns=({
                               'column':
                               'title',
                               'column_title':
                               _(u'label_title', default=u'Title'),
                               'sort_index':
                               'sortable_title',
                               'transform':
                               document_with_icon
                           }, {
                               'column':
                               'Creator',
                               'column_title':
                               _(u'label_creator', default=u'Creator'),
                               'sort_index':
                               'document_author'
                           }, {
                               'column':
                               'modified',
                               'column_title':
                               _(u'label_modified', default=u'Modified'),
                               'transform':
                               helper.readable_date
                           }))

    title = schema.TextLine(title=_(u"label_title", default=u"Title"),
                            required=True)

    form.widget('recipient', KeywordFieldWidget, async=True)
    recipient = schema.Choice(
        title=_(u'label_recipient', default=u'Recipient'),
        source=ContactsSourceBinder(),
        required=False,
    )

    form.widget(edit_after_creation=SingleCheckBoxFieldWidget)
    edit_after_creation = schema.Bool(
        title=_(u'label_edit_after_creation', default='Edit after creation'),
        default=True,
        required=False,
    )
Esempio n. 8
0
class IAddProposal(IProposal):

    proposal_template = TableChoice(
        title=_('label_proposal_template', default=u'Proposal template'),
        source=get_proposal_template_vocabulary,
        required=True,
        columns=(
            {'column': 'title',
             'column_title': _(u'label_title', default=u'Title'),
             'sort_index': 'sortable_title',
             'transform': document_with_icon},
            {'column': 'Creator',
             'column_title': _(u'label_creator', default=u'Creator'),
             'sort_index': 'document_author'},
            {'column': 'modified',
             'column_title': _(u'label_modified', default=u'Modified'),
             'transform': helper.readable_date}))
Esempio n. 9
0
class IMeetingModel(model.Schema):
    """Meeting model schema interface."""

    title = schema.TextLine(title=_(u"label_title", default=u"Title"),
                            defaultFactory=default_title,
                            required=True)

    meeting_template = TableChoice(
        title=_(u'label_meeting_template', default=u'Meeting Template'),
        description=_(
            u'help_meeting_template',
            default=u'Template containing the predifined paragraphs'),
        vocabulary='opengever.meeting.MeetingTemplateVocabulary',
        columns=({
            'column': 'title',
            'column_title': _(u'label_title', default=u'Title'),
            'sort_index': 'sortable_title',
            'transform': title_helper
        }, {
            'column': 'Creator',
            'column_title': _(u'label_creator', default=u'Creator'),
            'sort_index': 'document_author'
        }, {
            'column': 'modified',
            'column_title': _(u'label_modified', default=u'Modified'),
            'transform': helper.readable_date
        }),
        required=False,
    )

    committee = schema.Choice(title=_('label_committee', default=u'Committee'),
                              source='opengever.meeting.CommitteeVocabulary',
                              required=True)

    location = schema.TextLine(title=_(u"label_location", default=u"Location"),
                               max_length=256,
                               required=False)

    start = UTCDatetime(title=_('label_start', default=u"Start"),
                        required=True)

    end = UTCDatetime(title=_('label_end', default=u"End"), required=False)
Esempio n. 10
0
class IAddProposal(IProposal):

    proposal_template = TableChoice(title=_('label_proposal_template',
                                            default=u'Proposal template'),
                                    source=get_proposal_template_vocabulary,
                                    required=True,
                                    columns=({
                                        'column':
                                        'title',
                                        'column_title':
                                        _(u'label_title', default=u'Title'),
                                        'sort_index':
                                        'sortable_title',
                                        'transform':
                                        document_with_icon
                                    }, {
                                        'column':
                                        'Creator',
                                        'column_title':
                                        _(u'label_creator',
                                          default=u'Creator'),
                                        'sort_index':
                                        'document_author'
                                    }, {
                                        'column':
                                        'modified',
                                        'column_title':
                                        _(u'label_modified',
                                          default=u'Modified'),
                                        'transform':
                                        helper.readable_date
                                    }))

    widget(edit_after_creation=SingleCheckBoxFieldWidget)
    edit_after_creation = Bool(title=_(u'label_edit_after_creation',
                                       default=u'Edit after creation'),
                               default=True,
                               required=False)
Esempio n. 11
0
class ICreateDocumentFromOneOffixxTemplate(model.Schema):

    template_group = schema.Choice(
        title=_(u'label_template_group', default=u'Template group'),
        source=list_template_groups,
        required=False,
    )

    template = TableChoice(
        title=_(u"label_template", default=u"Template"),
        source=list_templates,
        required=True,
        show_filter=False,
        vocabulary_depends_on=['form.widgets.template_group'],
        columns=(
            {'column': 'title',
             'column_title': _(u'label_title', default=u'Title'),
             'sort_index': 'sortable_title'},
            )
    )

    title = schema.TextLine(
        title=_(u"label_title", default=u"Title"),
        required=True)