示例#1
0
 def __init__(self, *args, **kwargs):
     super(HelpForm, self).__init__(*args, **kwargs)
     self.helper.form_action = reverse(contact_form)
     self.helper.layout = Layout(
         'admin_class',
         'issue',
         'subject',
         'message',
         FormActions(
             StrictButton('<span class="glyphicon glyphicon-remove"></span> Cancel', css_class='btn-default backbutton'),
             StrictButton('<span class="glyphicon glyphicon-send"></span> Send e-mail', css_class='btn-primary', type="submit")
         )
     )
示例#2
0
def createButtons(back_icon="remove",
                  back_label="Cancel",
                  back_class="btn-danger backbutton",
                  icon="ok",
                  label="Save",
                  class_="btn-success"):
    return FormActions(
        StrictButton('<span class="glyphicon glyphicon-%s"></span> %s' %
                     (back_icon, back_label),
                     css_class=back_class),
        StrictButton('<span class="glyphicon glyphicon-%s"></span> %s' %
                     (icon, label),
                     css_class=class_,
                     type="submit"),
        css_class="col-sm-offset-4")
示例#3
0
	def __init__(self, *args, **kwargs):
		super(AnnouncementForm, self).__init__(*args, **kwargs)
		self.helper.form_action = reverse(announcement_form)
		ref_conf = [(k, entity_to_label(k)) for k in reference_config().iterkeys()]
		ref_conf.insert(0, ("", "--No Reference--"))
		self.fields['ref_type'].widget = forms.widgets.Select(choices=ref_conf)
		self.helper.layout = Layout(
			'title',
			'message',
			'show_sender',
			'ref_type',
			'ref_id',
			FormActions(
				StrictButton('<span class="glyphicon glyphicon-remove"></span> Cancel', css_class='btn-default backbutton'),
				StrictButton('<span class="glyphicon glyphicon-send"></span> Publish', css_class='btn-primary', type="submit"),
				css_class="col-sm-offset-4"
			)
		)
示例#4
0
 def __init__(self, *args, **kwargs):
     super(LoginForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = 'form-horizontal'
     self.helper.form_action = reverse(login)
     self.helper.form_method = "post"
     self.helper.label_class = 'col-lg-2 col-md-2 col-sm-2'
     self.helper.field_class = 'col-lg-4 col-md-5 col-sm-6'
     self.helper.layout = Layout(
         'username', 'password', 'long_session',
         FormActions(
             StrictButton('Log in',
                          css_class='col-sm-offset-2 btn-primary',
                          type="submit")))