Ejemplo n.º 1
0
Archivo: forum.py Proyecto: lslaz1/karl
 def form_widgets(self, fields):
     widgets = {
         'title':
         formish.Input(empty=''),
         'tags':
         karlwidgets.TagsAddWidget(),
         'text':
         karlwidgets.RichTextWidget(empty=''),
         'attachments':
         karlwidgets.AttachmentsSequence(sortable=False,
                                         min_start_fields=0),
         'attachments.*':
         karlwidgets.FileUpload2(filestore=self.filestore),
         'sendalert':
         karlwidgets.SendAlertCheckbox()
     }
     security_states = self._get_security_states()
     schema = dict(fields)
     if 'security_state' in schema:
         security_states = self._get_security_states()
         widgets['security_state'] = formish.RadioChoice(options=[
             (s['name'], s['title']) for s in security_states
         ],
                                                         none_option=None)
     return widgets
Ejemplo n.º 2
0
 def form_widgets(self, fields):
     widgets = {
         'add_comment': karlwidgets.CommentWidget(empty=''),
         'attachments': karlwidgets.AttachmentsSequence(sortable=False,
                                                        min_start_fields=0),
         'attachments.*': karlwidgets.FileUpload2(filestore=self.filestore),
         }
     if self.show_sendalert:
         widgets['sendalert'] = karlwidgets.SendAlertCheckbox()
     return widgets
Ejemplo n.º 3
0
Archivo: forum.py Proyecto: lslaz1/karl
 def form_widgets(self, fields):
     widgets = {
         'title': formish.Input(empty=''),
         'description': formish.TextArea(cols=60, rows=10, empty=''),
         'sendalert': karlwidgets.SendAlertCheckbox()
     }
     security_states = self._get_security_states()
     schema = dict(fields)
     if 'security_state' in schema:
         security_states = self._get_security_states()
         widgets['security_state'] = formish.RadioChoice(options=[
             (s['name'], s['title']) for s in security_states
         ],
                                                         none_option=None)
     return widgets
Ejemplo n.º 4
0
 def form_widgets(self, fields):
     widgets = {
         'title': formish.Hidden(empty=''),
         'tags': karlwidgets.TagsAddWidget(),
         'text': karlwidgets.RichTextWidget(empty=''),
         'sendalert': karlwidgets.SendAlertCheckbox(),
     }
     security_states = self._get_security_states()
     schema = dict(fields)
     if 'security_state' in schema:
         security_states = self._get_security_states()
         widgets['security_state'] = formish.RadioChoice(options=[
             (s['name'], s['title']) for s in security_states
         ],
                                                         none_option=None)
     return widgets