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 _user(field): return ffw.ProjectUserCombo(label=field.label, name=str(field.name))