示例#1
0
class TagForm(ListForm):
    template = 'admin/tags_and_categories_form.html'
    id = None
    css_classes = ['form', 'tag-form']
    submit_text = None

    event = events.Admin.TagForm

    # required to support multiple named buttons to differentiate between Save & Delete?
    _name = 'vf'

    fields = [
        TextField('name',
                  label_text=N_('Name'),
                  css_classes=['tag-name'],
                  validator=TagNameValidator(not_empty=True)),
        TextField('slug',
                  label_text=N_('Permalink'),
                  css_classes=['tag-slug'],
                  validator=NotEmpty),
        ResetButton('cancel',
                    default=N_('Cancel'),
                    css_classes=['btn', 'f-lft', 'btn-cancel']),
        SubmitButton('save',
                     default=N_('Save'),
                     css_classes=['f-rgt', 'btn', 'blue', 'btn-save']),
    ]
示例#2
0
文件: comments.py 项目: isaleem/cumin
 class fields(WidgetsList):
     body = TextArea(validator=NotEmpty,
                     label_text=N_('Comment'),
                     attrs=dict(rows=5, cols=25))
     submit = SubmitButton(default=N_('Save'),
                           css_classes=['btn', 'btn-save', 'blue', 'f-rgt'])
     cancel = ResetButton(default=N_('Cancel'),
                          css_classes=['btn', 'btn-cancel'])
示例#3
0
 class fields(WidgetsList):
     name = TextField(validator=TextField.validator(not_empty=True),
                      label_text=N_('Name'))
     slug = TextField(validator=NotEmpty, label_text=N_('Permalink'))
     parent_id = SingleSelectField(label_text=N_('Parent Category'),
                                   options=category_options)
     cancel = ResetButton(default=N_('Cancel'),
                          css_classes=['btn', 'f-lft', 'btn-cancel'])
     save = SubmitButton(default=N_('Save'),
                         named_button=True,
                         css_classes=['f-rgt', 'btn', 'blue', 'btn-save'])