Exemplo n.º 1
0
class CephalopodForm(IndicoForm):
    joined = BooleanField('Join the community', widget=SwitchWidget())
    contact_name = StringField('Contact Name', [UsedIfChecked('joined'), DataRequired()],
                               description=_('Name of the person responsible for your Indico server.'))
    contact_email = EmailField('Contact Email',
                               [UsedIfChecked('joined'), DataRequired(), Email()],
                               description=_('Email address of the person responsible for your Indico server.'))
Exemplo n.º 2
0
class BootstrapForm(LocalRegistrationForm):
    first_name = StringField('First Name', [DataRequired()])
    last_name = StringField('Last Name', [DataRequired()])
    email = EmailField(_('Email address'), [DataRequired()])
    affiliation = StringField('Affiliation', [DataRequired()])
    enable_tracking = BooleanField('Join the community', widget=SwitchWidget())
    contact_name = StringField('Contact Name', [UsedIfChecked('enable_tracking'), DataRequired()])
    contact_email = EmailField('Contact Email Address',  [UsedIfChecked('enable_tracking'), DataRequired(), Email()])
Exemplo n.º 3
0
class CephalopodForm(IndicoForm):
    joined = BooleanField('Join the community', widget=SwitchWidget())
    contact_name = TextField(
        'Contact Name',
        [UsedIfChecked('enable_tracking'),
         validators.Required()],
        description=_(
            'Name of the person responsible for your Indico server.'))
    contact_email = EmailField(
        'Contact Email', [
            UsedIfChecked('enable_tracking'),
            validators.Required(),
            validators.Email()
        ],
        description=_(
            'Email address of the person responsible for your Indico server.'))
Exemplo n.º 4
0
class BootstrapForm(LocalRegistrationForm):
    first_name = TextField('First Name', [validators.Required()])
    last_name = TextField('Last Name', [validators.Required()])
    email = EmailField(_('Email address'), [validators.Required()])
    language = SelectField('Language', [validators.Required()])
    affiliation = TextField('Affiliation', [validators.Required()])
    enable_tracking = BooleanField('Join the community', widget=SwitchWidget())
    contact_name = TextField(
        'Contact Name',
        [UsedIfChecked('enable_tracking'),
         validators.Required()])
    contact_email = EmailField('Contact Email Address', [
        UsedIfChecked('enable_tracking'),
        validators.Required(),
        validators.Email()
    ])

    def __init__(self, *args, **kwargs):
        super(BootstrapForm, self).__init__(*args, **kwargs)
        self.language.choices = sorted(get_all_locales().items(),
                                       key=itemgetter(1))