Exemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     super(CityInfoFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'name',
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     self.form.helper = helper
Exemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     super(CityInfoFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'name',
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     self.form.helper = helper
Exemplo n.º 3
0
 def helper(self):
     helper = FormHelper()
     helper.form_method = 'GET'
     helper.form_class = 'form-inline well'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'q',
         StrictButton(_('Search'), type='submit', css_class='btn-primary'),
     )
     return helper
Exemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     super(DataCardFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'card_type',
         'reference_number',
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     self.form.helper = helper
Exemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     super(DataCardFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'card_type',
         'reference_number',
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     self.form.helper = helper
Exemplo n.º 6
0
 def helper(self):
     helper = FormHelper()
     helper.form_tag = False
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'pwkmc',
         'xz',
         'prhlmc',
         'zzqk',
         'psqk',
     )
     return helper
Exemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     super(BusinessPartnerFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'email',
         'mobile_number',
         'city',
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     self.form.helper = helper
Exemplo n.º 8
0
 def __init__(self, *args, **kwargs):
     super(BusinessPartnerFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'email',
         'mobile_number',
         'city',
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     self.form.helper = helper
Exemplo n.º 9
0
 def helper(self):
     helper = FormHelper()
     helper.form_tag = False
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'pwkmc',
         'xz',
         HTML('<span>开始日期:</span>'),
         'start_date',
         HTML('<span>结束日期:</span>'),
         'end_date',
     )
     return helper
Exemplo n.º 10
0
 def __init__(self, *args, **kwargs):
     super(AppInfoFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'package_name',
         'name',
         Field('active', css_class='nullbooleanselect select', label='', labelclass='hidden'),
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     helper.form_show_labels = False
     self.form.helper = helper
Exemplo n.º 11
0
    def __init__(self, *args, **kwargs):
        super(InviteForm, self).__init__(*args, **kwargs)
        helper = FormHelper()
        helper.form_method = 'post'
        helper.form_class = 'navbar-form navbar-right'
        helper.field_template = 'bootstrap3/layout/inline_field.html'
        helper.form_show_labels = False

        helper.layout = Layout(
            Field('email', placeholder='email', required='required'),
            StrictButton(u'Пригласить', css_class='btn-default', type='submit', name='invite')
        )
        self.helper = helper
Exemplo n.º 12
0
 def __init__(self, *args, **kwargs):
     super(AgentInfoFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.form_show_labels = False
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'city',
         'location__partner',
         'first_name',
         'mobile_number',
         Field('last_present_date', placeholder='Select Date'),
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     self.form.helper = helper
Exemplo n.º 13
0
 def __init__(self, *args, **kwargs):
     super(AgentInfoFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.form_show_labels = False
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'city',
         'location__partner',
         'first_name',
         'mobile_number',
         Field('last_present_date', placeholder='Select Date'),
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     self.form.helper = helper
Exemplo n.º 14
0
 def __init__(self, *args, **kwargs):
     super(AppInfoFilter, self).__init__(*args, **kwargs)
     helper = FormHelper()
     helper.form_class = 'form-inline'
     helper.field_template = 'bootstrap3/layout/inline_field.html'
     helper.layout = Layout(
         'package_name',
         'name',
         Field('active',
               css_class='nullbooleanselect select',
               label='',
               labelclass='hidden'),
         Submit('submit', 'Filter', css_class='btn-primary'),
     )
     helper.form_show_labels = False
     self.form.helper = helper
Exemplo n.º 15
0
    def helper(self):
        """Default helper that is used by crispy forms"""
        helper = FormHelper()
        helper.form_tag = False
        helper.form_style = self.form_style
        helper.field_template = self.field_template
        layout = self.get_layout()

        if layout:
            helper.layout = layout

        # add 'select2-default 'class to all fields
        # specified in form.select2_fields
        select2_fields = getattr(self, 'select2_fields', None)
        if select2_fields:
            for field in select2_fields:
                helper[field].wrap(Field,
                                   css_class="select2-default form-control")

        return helper