Exemplo n.º 1
0
class W:
    thread = w.Thread(page=None,
                      limit=None,
                      page_size=None,
                      count=None,
                      style='linear')
    markdown_editor = ffw.MarkdownEdit()
    confirmation = ffw.Lightbox(
        name='confirm',
        trigger='a.post-link',
        options="{ modalCSS: { minHeight: 0, width: 'inherit', top: '150px'}}")
    label_edit = ffw.LabelEdit()
    attachment_add = ffw.AttachmentAdd()
    attachment_list = ffw.AttachmentList()
    subscribe_form = SubscribeForm()
    page_subscribe_form = SubscribeForm(thing='page')
    page_list = ffw.PageList()
    page_size = ffw.PageSize()
    search_results = SearchResults()
    help_modal = SearchHelp()
    icons = {
        24: 'images/wiki_24.png',
        32: 'images/wiki_32.png',
        48: 'images/wiki_48.png'
    }
Exemplo n.º 2
0
 def fields(self):
     fields = [
         ew.TextField(name='summary', label='Title',
             attrs={'style':'width: 425px','placeholder':'Title'},
             validator=fev.UnicodeString(not_empty=True, messages={'empty':"You must provide a Title"})),
         ffw.MarkdownEdit(label='Description',name='description',
                 attrs={'style':'width: 95%'}),
         ew.SingleSelectField(name='status', label='Status',
             options=lambda: c.app.globals.all_status_names.split()),
         ffw.ProjectUserCombo(name='assigned_to', label='Owner'),
         ffw.LabelEdit(label='Labels',name='labels', className='ticket_form_tags'),
         ew.Checkbox(name='private', label='Mark as Private', attrs={'class':'unlabeled'}),
         ew.InputField(name='attachment', label='Attachment', field_type='file', attrs={'multiple': 'True'}, validator=fev.FieldStorageUploadConverter(if_missing=None)),
         ffw.MarkdownEdit(name='comment', label='Comment',
                     attrs={'style':'min-height:7em; width:97%'}),
         ew.SubmitButton(label=self.submit_text,name='submit',
             attrs={'class':"ui-button ui-widget ui-state-default ui-button-text-only"}),
         ew.HiddenField(name='ticket_num', validator=fev.Int(if_missing=None)),
     ]
     # milestone is kind of special because of the layout
     # add it to the main form rather than handle with the other customs
     if c.app.globals.custom_fields:
         for cf in c.app.globals.custom_fields:
             if cf.name == '_milestone':
                 fields.append(TicketCustomField.make(cf))
                 break
     return ew_core.NameList(fields)
Exemplo n.º 3
0
class W:
    thread = w.Thread(
        page=None, limit=None, page_size=None, count=None,
        style='linear')
    markdown_editor = ffw.MarkdownEdit()
    confirmation = ffw.Lightbox(name='confirm',
                                trigger='a.post-link',
                                options="{ modalCSS: { minHeight: 0, width: 'inherit', top: '150px'}}")
    label_edit = ffw.LabelEdit()
    attachment_add = ffw.AttachmentAdd()
    attachment_list = ffw.AttachmentList()
    subscribe_form = SubscribeForm()
    page_subscribe_form = SubscribeForm(thing='page')
    page_list = ffw.PageList()
    page_size = ffw.PageSize()
    search_results = SearchResults()
    help_modal = SearchHelp(fields={'title': 'title',
                                    'text': '"Page text"',
                                    'mod_date_dt': 'Last modified.  Example: mod_date_dt:[2018-01-01T00:00:00Z TO *]',
                                    'labels_t': 'labels',
                                    'author_user_name_t': 'username (for comments only)',
                                    })
    icons = {
        24: 'images/wiki_24.png',
        32: 'images/wiki_32.png',
        48: 'images/wiki_48.png'
    }
Exemplo n.º 4
0
class W:
    thread = w.Thread(page=None,
                      limit=None,
                      page_size=None,
                      count=None,
                      style='linear')
    pager = widgets.BlogPager()
    new_post_form = widgets.NewPostForm()
    edit_post_form = widgets.EditPostForm()
    view_post_form = widgets.ViewPostForm()
    label_edit = ffw.LabelEdit()
    attachment_add = ffw.AttachmentAdd()
    attachment_list = ffw.AttachmentList()
    preview_post_form = widgets.PreviewPostForm()
    subscribe_form = SubscribeForm(thing='post')
    search_results = SearchResults()
    help_modal = SearchHelp(
        fields={
            'title': 'Title',
            'text': '"Post text"',
            'labels_t': 'Labels',
            'mod_date_dt':
            'Last modified.  Example: mod_date_dt:[2018-01-01T00:00:00Z TO *]',
            'author_user_name_t': 'username (for comments only)',
        })
Exemplo n.º 5
0
 def fields(self):
     return ew_core.NameList([
         ew.TextField(name='title',
                      validator=fev.UnicodeString(
                          not_empty=True,
                          messages={'empty': "You must provide a Title"}),
                      attrs=dict(placeholder='Enter your title here',
                                 title='Enter your title here',
                                 style='width: 425px')),
         ffw.MarkdownEdit(name='text',
                          show_label=False,
                          attrs=dict(placeholder='Enter your content here',
                                     title='Enter your content here')),
         ew.SingleSelectField(name='state',
                              options=[
                                  ew.Option(py_value='draft',
                                            label='Draft'),
                                  ew.Option(py_value='published',
                                            label='Published')
                              ]),
         ffw.LabelEdit(name='labels',
                       placeholder='Add labels here',
                       title='Add labels here'),
         ew.InputField(
             name='attachment',
             label='Attachment',
             field_type='file',
             attrs={'multiple': 'True'},
             validator=fev.FieldStorageUploadConverter(if_missing=None)),
     ])
Exemplo n.º 6
0
class W:
    label_edit = ffw.LabelEdit()
    group_card = aw.GroupCard()
    permission_card = aw.PermissionCard()
    new_group_settings = aw.NewGroupSettings()
    screenshot_admin = aw.ScreenshotAdmin()
    screenshot_list = ProjectScreenshots(draggable=True)
    metadata_admin = aw.MetadataAdmin()
    audit = aw.AuditLog()
    page_list = ffw.PageList()
Exemplo n.º 7
0
class W:
    thread=w.Thread(
        page=None, limit=None, page_size=None, count=None,
        style='linear')
    create_page_lightbox = CreatePageWidget(name='create_wiki_page', trigger='#sidebar a.add_wiki_page')
    markdown_editor = ffw.MarkdownEdit()
    label_edit = ffw.LabelEdit()
    attachment_add = ffw.AttachmentAdd()
    attachment_list = ffw.AttachmentList()
    subscribe_form = SubscribeForm()
    page_subscribe_form = SubscribeForm(thing='page')
    page_list = ffw.PageList()
    page_size = ffw.PageSize()
    search_results = SearchResults()
Exemplo n.º 8
0
class TagPost(ff.ForgeForm):

    # this ickiness is to override the default submit button
    def __call__(self, **kw):
        result = super(TagPost, self).__call__(**kw)
        submit_button = ffw.SubmitButton(label=result['submit_text'])
        result['extra_fields'] = [submit_button]
        result['buttons'] = [submit_button]
        return result

    fields = [ffw.LabelEdit(label='Labels', name='labels', className='title')]

    def resources(self):
        for r in ffw.LabelEdit(name='labels').resources():
            yield r
Exemplo n.º 9
0
class W:
    thread = w.Thread(page=None,
                      limit=None,
                      page_size=None,
                      count=None,
                      style='linear')
    pager = widgets.BlogPager()
    new_post_form = widgets.NewPostForm()
    edit_post_form = widgets.EditPostForm()
    view_post_form = widgets.ViewPostForm()
    label_edit = ffw.LabelEdit()
    attachment_add = ffw.AttachmentAdd()
    attachment_list = ffw.AttachmentList()
    preview_post_form = widgets.PreviewPostForm()
    subscribe_form = SubscribeForm()
Exemplo n.º 10
0
class W:
    markdown_editor = ffw.MarkdownEdit()
    label_edit = ffw.LabelEdit()
    mount_delete = ffw.Lightbox(name='mount_delete',trigger='a.mount_delete')
    admin_modal = ffw.Lightbox(name='admin_modal',trigger='a.admin_modal')
    install_modal = ffw.Lightbox(name='install_modal',trigger='a.install_trig')
    group_card = aw.GroupCard()
    permission_card = aw.PermissionCard()
    group_settings = aw.GroupSettings()
    new_group_settings = aw.NewGroupSettings()
    screenshot_admin = aw.ScreenshotAdmin()
    screenshot_list = ProjectScreenshots()
    metadata_admin = aw.MetadataAdmin()
    audit = aw.AuditLog()
    page_list=ffw.PageList()
Exemplo n.º 11
0
 class fields(ew_core.NameList):
     title = ew.TextField(validator=fev.UnicodeString(
         not_empty=True, messages={'empty': "You must provide a Title"}),
                          attrs=dict(placeholder='Enter your title here',
                                     title='Enter your title here',
                                     style='width: 425px'))
     text = ffw.MarkdownEdit(show_label=False,
                             attrs=dict(
                                 placeholder='Enter your content here',
                                 title='Enter your content here'))
     state = ew.SingleSelectField(options=[
         ew.Option(py_value='draft', label='Draft'),
         ew.Option(py_value='published', label='Published')
     ])
     labels = ffw.LabelEdit(placeholder='Add labels here',
                            title='Add labels here')
Exemplo n.º 12
0
 def resources(self):
     for r in ffw.LabelEdit(name='labels').resources():
         yield r