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)
def fields(self): fields = [ ew.Checkbox(name='EnableVoting', label='Enable voting on tickets'), ew.Checkbox(name='AllowEmailPosting', label='Allow posting replies via email'), ew.TextField(name='TicketMonitoringEmail', label='Email ticket notifications to', validator=fev.Email(), grid_width='7'), ew.SingleSelectField( name='TicketMonitoringType', label='Send notifications for', grid_width='7', options=[ ew.Option(py_value='NewTicketsOnly', label='New tickets only'), ew.Option(py_value='NewPublicTicketsOnly', label='New public tickets only'), ew.Option(py_value='AllTicketChanges', label='All ticket changes'), ew.Option(py_value='AllPublicTicketChanges', label='All public ticket changes'), ]), ffw.MarkdownEdit(name='TicketHelpNew', label='Help text to display on new ticket page', validator=v.String(), attrs={'style': 'width: 95%'}), ffw.MarkdownEdit( name='TicketHelpSearch', label='Help text to display on ticket list pages (index page,' ' search results, milestone lists)', validator=v.String(), attrs={'style': 'width: 95%'}), ] return fields
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' }
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' }
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)), ])
def fields(self): result = [ ew.TextField(name='summary', attrs={'style': 'width: 93.5%;'}), ew.SingleSelectField(name='source_branch', label='Source Branch', options=self.source_branches), ew.SingleSelectField(name='target_branch', label='Target Branch', options=self.target_branches), ffw.MarkdownEdit(name='description') ] return result
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()
def fields(self): fields = ew_core.NameList() fields.append(ffw.MarkdownEdit(name='text')) fields.append(ew.HiddenField(name='forum', if_missing=None)) if ew_core.widget_context.widget: # we are being displayed if ew_core.widget_context.render_context.get('show_subject', self.show_subject): fields.append( ew.TextField(name='subject', attrs=dict(style="width:97%"))) else: # We are being validated validator = fev.UnicodeString(not_empty=True, if_missing='') fields.append(ew.TextField(name='subject', validator=validator)) fields.append(NullValidator(name=self.att_name)) return fields
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()
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')
def resources(self): for r in ew.TextField(name='subject').resources(): yield r for r in ffw.MarkdownEdit(name='text').resources(): yield r yield ew.JSScript('''$(document).ready(function () { $("a.attachment_form_add_button").click(function(evt){ $(this).hide(); $(".attachment_form_fields", this.parentNode).show(); evt.preventDefault(); }); $("a.cancel_edit_post").click(function(evt){ $("textarea", this.parentNode).val($("input.original_value", this.parentNode).val()); $(".attachment_form_fields input", this.parentNode).val(''); evt.preventDefault(); }); });''')