def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', 'total_work', indented_without_label('overseer'), Fieldset('Työtodistus', indented_without_label('want_certificate'), 'certificate_delivery_address', ), Fieldset('Lisätiedot', # 'shirt_size', 'special_diet', 'special_diet_other', 'lodging_needs', 'prior_experience', 'shift_wishes', 'free_text', ), # TODO remove when copy-pasting Fieldset('Kaatajaiset', 'afterparty_participation', 'outward_coach_departure_time', 'return_coach_departure_time', 'afterparty_coaches_changed', ) )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', 'total_work', indented_without_label('overseer'), Fieldset( 'Työtodistus', indented_without_label('want_certificate'), 'certificate_delivery_address', ), Fieldset( 'Lisätiedot', # 'shirt_size', 'special_diet', 'special_diet_other', 'lodging_needs', 'prior_experience', 'shift_wishes', 'free_text', ), # TODO remove when copy-pasting Fieldset( 'Kaatajaiset', 'afterparty_participation', 'outward_coach_departure_time', 'return_coach_departure_time', 'afterparty_coaches_changed', ))
def __init__(self, *args, **kwargs): super(PasswordResetRequestForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.layout = Layout( 'email', indented_without_label( Submit('submit', _('Submit'), css_class='btn-success')))
def __init__(self, *args, **kwargs): assert 'initial' not in kwargs self.event = kwargs.pop('event') self.user = kwargs.pop('user') self.active_apps = self.event.intra_event_meta.get_active_apps() kwargs['initial'] = dict( (app_label, self.event.get_app_event_meta( app_label).is_user_in_admin_group(self.user)) for app_label in self.active_apps) super(PrivilegesForm, self).__init__(*args, **kwargs) for app_label in SUPPORTED_APPS: if app_label not in self.active_apps: del self.fields[app_label] self.helper = horizontal_form_helper() self.helper.form_tag = False layout_fields = [ indented_without_label(app_label) for app_label in self.active_apps ] self.helper.layout = Layout(Fieldset(_('Privileges'), *layout_fields))
def __init__(self, *args, **kwargs): event = kwargs.pop('event') self.active_apps = self.get_active_apps(event) if 'instance' in kwargs: assert 'initial' not in kwargs team_member = kwargs.pop('instance') initial = dict((app_label, event.app_event_meta( app_label).is_user_in_admin_group(team_member.person.user)) for app_label in self.active_apps) kwargs['initial'] = initial super(PrivilegesForm, self).__init__(*args, **kwargs) for app_label in SUPPORTED_APPS: if app_label not in self.active_apps: del self.fields[app_label] self.helper = horizontal_form_helper() self.helper.form_tag = False layout_fields = [ indented_without_label(app_label) for app_label in self.active_apps ] self.helper.layout = Layout(Fieldset(_('Privileges'), *layout_fields))
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', 'total_work', indented_without_label('construction'), indented_without_label('want_certificate'), Fieldset( 'Lisätiedot', 'special_diet', 'special_diet_other', 'lodging_needs', 'prior_experience', 'shift_wishes', 'free_text', ))
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', 'total_work', # 'night_work', # indented_without_label('construction'), # indented_without_label('overseer'), 'work_days', indented_without_label('want_certificate'), # 'certificate_delivery_address', Fieldset('Lisätiedot', 'shirt_size', 'special_diet', 'special_diet_other', # indented_without_label('need_lodging'), 'prior_experience', 'shift_wishes', 'free_text', ) ) self.fields['work_days'].help_text = 'Minä päivinä olet halukas työskentelemään?'
def __init__(self, *args, **kwargs): super(PasswordResetRequestForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.layout = Layout( 'email', indented_without_label(Submit('submit', _(u'Submit'), css_class='btn-success')) )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', 'total_work', # 'night_work', # indented_without_label('construction'), # indented_without_label('overseer'), 'work_days', indented_without_label('want_certificate'), # 'certificate_delivery_address', Fieldset( 'Lisätiedot', 'shirt_size', 'special_diet', 'special_diet_other', # indented_without_label('need_lodging'), 'prior_experience', 'shift_wishes', 'free_text', )) self.fields[ 'work_days'].help_text = 'Minä päivinä olet halukas työskentelemään?'
def __init__(self, *args, **kwargs): super(PasswordResetForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.layout = Layout( 'new_password', 'new_password_again', indented_without_label(Submit('submit', _(u'Change password'), css_class='btn-success')) )
def __init__(self, *args, **kwargs): super(PasswordResetForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.layout = Layout( 'new_password', 'new_password_again', indented_without_label( Submit('submit', _('Change password'), css_class='btn-success')))
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', indented_without_label('night_work'), Fieldset( 'Lisätiedot', indented_without_label('need_lodging'), indented_without_label('want_certificate'), 'shirt_size', 'special_diet', 'special_diet_other', 'more_info', 'prior_experience', 'free_text', ))
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', indented_without_label('night_work'), Fieldset('Lisätiedot', indented_without_label('need_lodging'), indented_without_label('want_certificate'), 'shirt_size', 'special_diet', 'special_diet_other', 'more_info', 'prior_experience', 'free_text', ) )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', 'total_work', Fieldset( 'Työtodistus', indented_without_label('want_certificate'), 'certificate_delivery_address', ), Fieldset( 'Lisätiedot', 'special_diet', 'special_diet_other', indented_without_label('need_lodging'), 'prior_experience', 'free_text', ))
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', 'total_work', indented_without_label('construction'), indented_without_label('want_certificate'), Fieldset('Lisätiedot', 'special_diet', 'special_diet_other', 'lodging_needs', 'prior_experience', 'shift_wishes', 'free_text', ) )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', 'total_work', Fieldset('Työtodistus', indented_without_label('want_certificate'), 'certificate_delivery_address', ), Fieldset('Lisätiedot', 'special_diet', 'special_diet_other', indented_without_label('need_lodging'), 'prior_experience', 'free_text', ) )
def __init__(self, *args, **kwargs): super(SearchForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.layout = Layout( 'id', 'first_name', 'last_name', 'email', indented_without_label(Submit('submit', 'Hae tilauksia', css_class='btn-primary')), )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( "shift_type", # 'shirt_size', Fieldset( u"Lisätiedot", "desu_amount", indented_without_label("night_work"), "prior_experience", "free_text" ), )
def __init__(self, *args, **kwargs): super(SearchForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.layout = Layout( 'id', 'first_name', 'last_name', 'email', indented_without_label( Submit('submit', 'Hae tilauksia', css_class='btn-primary')), )
def __init__(self, *args, **kwargs): super(ProgrammePersonFormHelper, self).__init__(*args, **kwargs) make_horizontal_form_helper(self) self.form_tag = False self.layout = Layout( 'first_name', 'surname', 'nick', 'preferred_name_display_style', 'phone', 'email', indented_without_label('may_send_info'), )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( Fieldset('Lisätiedot', 'special_diet', 'special_diet_other', 'prior_experience', 'y_u', 'free_text', indented_without_label('want_certificate'), ) )
def __init__(self, *args, **kwargs): super(CustomerForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'first_name', 'last_name', 'address', 'zip_code', 'city', 'phone_number', 'email', indented_without_label('allow_marketing_email'), )
def __init__(self, *args, **kwargs): self.request = kwargs.pop('the_request') super(PasswordForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.layout = Layout( Fieldset(_('Change password'), 'old_password', 'new_password', 'new_password_again', ), indented_without_label(Submit('submit', _('Change password'), css_class='btn-primary')) )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', # 'shirt_size', Fieldset( 'Lisätiedot', 'desu_amount', indented_without_label('night_work'), 'prior_experience', 'free_text', ))
def __init__(self, *args, **kwargs): self.request = kwargs.pop('the_request') super(PasswordForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.layout = Layout( Fieldset(_(u'Change password'), 'old_password', 'new_password', 'new_password_again', ), indented_without_label(Submit('submit', _(u'Change password'), css_class='btn-primary')) )
def __init__(self, *args, **kwargs): if 'submit_button' in kwargs: submit_button = kwargs.pop('submit_button') else: submit_button = True super(PersonForm, self).__init__(*args, **kwargs) for field_name in [ 'email', 'phone' ]: self.fields[field_name].required = True self.helper = horizontal_form_helper() if self.instance.pk is None: save_button_text = _(u'Sign up') else: save_button_text = _(u'Save') layout_parts = [ Fieldset(_(u'Basic information'), 'first_name', 'surname', 'nick', 'preferred_name_display_style', 'birth_date', ), Fieldset(_(u'Membership roster information'), 'official_first_names', 'muncipality', ), Fieldset(_(u'Contact information'), 'phone', 'email', ), Fieldset(_(u'Privacy'), 'may_send_info', 'allow_work_history_sharing', ) ] if submit_button: layout_parts.append( indented_without_label(Submit('submit', save_button_text, css_class='btn-success')) ) self.helper.layout = Layout(*layout_parts)
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'shift_type', # 'shirt_size', Fieldset( 'Lisätiedot', 'desu_amount', indented_without_label('night_work'), 'prior_experience', 'free_text', ) )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'total_work', Fieldset('Kortittomien järjestyksenvalvojien lisätiedot', 'personal_identification_number', ), Fieldset('Työtodistus', indented_without_label('want_certificate'), 'certificate_delivery_address', ), Fieldset('Lisätiedot', 'special_diet', 'special_diet_other', 'lodging_needs', 'prior_experience', 'free_text', ) )
def __init__(self, *args, **kwargs): super(SignupExtraForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self.helper.form_tag = False self.helper.layout = Layout( 'total_work', Fieldset(u'Kortittomien järjestyksenvalvojien lisätiedot', 'personal_identification_number', ), Fieldset(u'Työtodistus', indented_without_label('want_certificate'), 'certificate_delivery_address', ), Fieldset(u'Lisätiedot', 'special_diet', 'special_diet_other', 'lodging_needs', 'prior_experience', 'free_text', ) )
def __init__(self, *args, **kwargs): event = kwargs.pop('event') super(AdminPersonForm, self).__init__(*args, **kwargs) self.fields['age_now'].initial = calculate_age(self.instance.birth_date, date.today()) self.fields['age_now'].widget.attrs['readonly'] = True if event.start_time: self.fields['age_event_start'].initial = calculate_age(self.instance.birth_date, event.start_time.date()) self.fields['age_event_start'].widget.attrs['readonly'] = True # XXX copypasta self.helper.layout = Layout( 'first_name', 'surname', 'nick', 'preferred_name_display_style', 'birth_date', 'age_now', # not in PersonForm 'age_event_start', # not in PersonForm 'phone', 'email', indented_without_label('may_send_info'), )
def __init__(self, *args, **kwargs): assert 'initial' not in kwargs self.event = kwargs.pop('event') self.user = kwargs.pop('user') self.active_apps = self.event.intra_event_meta.get_active_apps() kwargs['initial'] = dict( (app_label, self.event.app_event_meta(app_label).is_user_in_admin_group(self.user)) for app_label in self.active_apps ) super(PrivilegesForm, self).__init__(*args, **kwargs) for app_label in SUPPORTED_APPS: if app_label not in self.active_apps: del self.fields[app_label] self.helper = horizontal_form_helper() self.helper.form_tag = False layout_fields = [indented_without_label(app_label) for app_label in self.active_apps] self.helper.layout = Layout(Fieldset(_('Privileges'), *layout_fields))