def __init__(self, *args, **kwargs): super(ChallengeFileModelForm, self).__init__(*args, **kwargs) self.add_helper = FormHelper() self.add_helper.form_id = 'add-file' self.add_helper.form_method = 'post' self.add_helper.form_action = '' self.update_helper = FormHelper() self.update_helper.form_id = 'update-file' self.update_helper.form_method = 'post' self.update_helper.form_action = '' holder = ButtonHolder( Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right' ) self.add_helper.layout = Layout( Fieldset( 'Add a file', HTML('<p>Original filenames are preserved whenever possible.</p>'), 'file', ), holder ) self.update_helper.layout = Layout( Fieldset( 'Update a file', 'file', ), holder )
def __init__(self, *args, **kwargs): super(SMTPSettingForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_action = '.' self.helper.form_class = 'smtp-setting' self.helper.add_input(Submit('submit', _('Save'), css_class="success float-right")) self.helper.add_input(Reset('reset', _('Reset'), css_class="float-right"))
def __init__(self, *args, **kwargs): self.helper = FormHelper() self.helper.attrs = {'data_abide': ''} self.helper.form_method = 'post' self.helper.add_input(Submit('submit', _('Submit'), css_class="success float-right")) self.helper.add_input(Reset('reset', _('Reset'), css_class="float-right")) super(NewContactForm, self).__init__(*args, **kwargs) self.fields['domain_id'].label = _("Domain ID")
def __init__(self, *args, **kwargs): super(XORForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'xor-form' self.helper.form_method = 'post' self.helper.form_action = reverse("tools_xor") self.helper.layout = Layout( Fieldset('String XOR Tool', 'value', 'key', 'result'), ButtonHolder(Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right'))
def __init__(self, *args, **kwargs): self.kuser = kwargs.pop('kituser') or None super(UserGroupSettingForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_action = '.' self.helper.add_input(Submit('submit', _('Save'), css_class="success float-right")) self.helper.add_input(Reset('reset', _('Reset'), css_class="float-right")) self.fields['kit_users'].queryset = self.fields['kit_users'].queryset.filter(parent=self.kuser)
def __init__(self, *args, **kwargs): super(HashForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'hash-form' self.helper.form_method = 'post' self.helper.form_action = reverse("tools_hash") self.helper.layout = Layout( Fieldset('Hashing Tools', 'hash_type', 'value', 'result'), ButtonHolder(Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right'))
def __init__(self, *args, **kwargs): super(URLUnquoteForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'unquote-form' self.helper.form_method = 'post' self.helper.form_action = reverse('tools_unquote') self.helper.layout = Layout( Fieldset('URL Decoding', 'value', 'result'), ButtonHolder(Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right'))
def __init__(self, *args, **kwargs): super(SystemSettingsForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_action = '.' self.helper.form_tag = True self.helper.add_input( Submit('submit', _('Update'), css_class="success float-right")) self.helper.add_input( Reset('reset', _('Reset'), css_class="float-right")) self.fields['did_number'].disabled = True
def __init__(self, *args, **kwargs): super(BaseConversionForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'base-conversion-form' self.helper.form_method = 'post' self.helper.form_action = reverse("tools_base_conversion") self.helper.layout = Layout( Fieldset('Base Conversion Tool', 'value', 'base', 'currBase', 'result'), ButtonHolder(Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right'))
def __init__(self, *args, **kwargs): super(RotForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'rot-form' self.helper.form_method = 'post' self.helper.form_action = reverse("tools_rot") self.helper.layout = Layout( Fieldset('ROT=* Encoder/Decoder', 'rot_type', 'value', 'encode', 'result'), ButtonHolder(Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right'))
def buttons_crispies(pack=None): box = Panel if pack == 'foundation-6': box = Callout return [ Row( Column(ButtonGroup(Submit('submit', _('Submit'), css_class='success'), Reset('cancel', _('Cancel')), Button('dummy', _('Delete'), css_class='alert'), css_class='radius right'), css_class='clearfix'), ), Row( Column( box(HTML("""<p>As <input/></p>"""), ButtonGroup(Submit('submit', _('Submit'), css_class='success'), Reset('cancel', _('Cancel')), Button('dummy', _('Delete'), css_class='alert'), css_class='radius right'), css_class='clearfix')), ), Row( Column( box(HTML("""<p>As <button/></p>"""), ButtonGroup(ButtonSubmit('submit', _('Submit'), css_class='success'), ButtonReset('cancel', _('Cancel')), ButtonElement( 'button-label', 'button-value', css_class='alert', content="""<span><Doh/></span>"""), css_class='radius right'), css_class='clearfix')), ), ]
def __init__(self, *args, **kwargs): super(LoginForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'login-form' self.helper.attrs = {'data_abide': ''} self.helper.form_method = 'post' self.helper.form_action = '' self.helper.layout = Layout( Fieldset( '', 'username', 'password' ), ButtonHolder( Reset('reset', 'Reset', css_class='secondary'), Submit('submit', 'Submit'), css_class='buttons text-right' ) )
def __init__(self, *args, **kwargs): super(PasswordChangeForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'pw-change-form' self.helper.form_method = 'post' self.helper.form_action = '' self.helper.layout = Layout( Fieldset( 'Change password', 'old_password', 'new_password1', 'new_password2' ), ButtonHolder( Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right' ) )
def __init__(self, *args, **kwargs): super(EmailChangeForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'email-change-form' self.helper.form_method = 'post' self.helper.form_action = '' self.helper.layout = Layout( Fieldset( 'Change email', HTML( '''<p><label class="control-label">Current Email Address: </label><span style="padding-left: 2em;">{{ user.email }}</span></p>'''), 'email', 'password' ), ButtonHolder( Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right' ) )
def __init__(self, *args, **kwargs): self.kuser = kwargs.pop('kituser') or None super(ContactGroupForm, self).__init__(*args, **kwargs) self.fields['contacts'].queryset = self.kuser.get_contacts() self.helper = FormHelper() self.helper.form_action = '.' self.helper.layout = Layout( Div( 'title', 'description', HTML('<a href="#" title="Insert All Contacts" id="sel-all-contacts" class="button tiny" style="float: right; margin-bottom: 3px;">All Contacts</a>'), 'contacts' ), ButtonHolder( Submit('submit', _('Submit'), css_class="success float-right"), Reset('reset', _('Reset'), css_class="float-right") ) )
def __init__(self, *args, **kwargs): super(ChallengeModelForm, self).__init__(*args, **kwargs) self.add_helper = FormHelper() self.add_helper.form_id = 'add-challenge' self.add_helper.form_method = 'post' self.add_helper.form_action = '' self.update_helper = FormHelper() self.update_helper.form_id = 'update-challenge' self.update_helper.form_method = 'post' self.update_helper.form_action = '' holder = ButtonHolder( Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right' ) self.add_helper.layout = Layout( Fieldset( 'Add a challenge', 'name', 'point_value', 'progress', 'num_progress' ), holder ) self.update_helper.layout = Layout( Fieldset( 'Update a challenge', 'name', 'point_value', 'progress', 'num_progress' ), holder )
def __init__(self, *args, **kwargs): super(MessageTemplateForm, self).__init__(*args, **kwargs) #self.fields['cou_group'].label = "Group Availability" self.helper = FormHelper() self.helper.form_action = '.' self.helper.add_input(Submit('submit', _('Save'), css_class="success float-right")) self.helper.add_input(Reset('reset', _('Reset'), css_class="float-right")) self.helper.layout = Layout( Row(Column('title')), Row(Column('email_template'), css_class = "email-template"), Row(Column('sms_template')), HTML(''' <div class="sms-textarea-status-bar row columns"> <div class="column small-4">Length: <span class="length"></span></div> <div class="column small-4">Messages: <span class="messages"></span></div> <div class="column small-4">Remaining: <span class="remaining"></span></div> </div>''' ), Row(Column('active')), Fieldset( ugettext('Delivery settings'), Row(Column('cou_group')), Div( Row( Column('send_sms', css_class="float-left small-6"), Column('insert_optout', css_class="float-left small-6"), ), Row(Column('sms_sender')), ), Row( Column('send_email', css_class="float-left small-6") ), Row(Column('email_reply_to')), Row(Column('smtp_setting')), css_class = "new-template-settings-fieldset" ), )
def __init__(self, *args, **kwargs): super(RegistrationForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'registration-form' self.helper.form_method = 'post' self.helper.form_action = reverse("register") self.helper.layout = Layout( Fieldset( '', 'username', 'first_name', 'last_name', 'email', 'password1', 'password2' ), ButtonHolder( Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right' ) )
def __init__(self, *args, **kwargs): super(CompetitionModelForm, self).__init__(*args, **kwargs) self.add_helper = FormHelper() self.add_helper.form_id = 'add-ctf' self.add_helper.form_method = 'post' self.add_helper.form_action = '' self.update_helper = FormHelper() self.update_helper.form_id = 'update-ctf' self.update_helper.form_method = 'post' self.update_helper.form_action = '' button_holder = ButtonHolder( Submit('submit', 'Submit'), Reset('reset', 'Reset'), css_class='text-right' ) self.add_helper.layout = Layout( Fieldset( 'Add a competition', 'name', 'url', 'start_time', 'end_time' ), button_holder ) self.update_helper.layout = Layout( Fieldset( 'Update competition', 'name', 'url', 'start_time', 'end_time' ), button_holder )