|
|
|
@ -20,17 +20,18 @@ class ContactUsForm(RequestNotifiable, forms.ModelForm): |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
self.next = kwargs.pop('next') |
|
|
|
self.next = kwargs.pop('next') |
|
|
|
|
|
|
|
self.field_css = kwargs.pop('field_css_base_class') |
|
|
|
|
|
|
|
|
|
|
|
self.helper = FormHelper() |
|
|
|
self.helper = FormHelper() |
|
|
|
self.helper.form_action = reverse_lazy('contact_us:send') |
|
|
|
self.helper.form_action = reverse_lazy('contact_us:send') |
|
|
|
self.helper.form_method = 'post' |
|
|
|
self.helper.form_method = 'post' |
|
|
|
self.helper.layout = Layout( |
|
|
|
self.helper.layout = Layout( |
|
|
|
Hidden('next', reverse_lazy(self.next)), |
|
|
|
Hidden('next', reverse_lazy(self.next)), |
|
|
|
Field('name', css_class="left-menu__text", placeholder=_("Имя"), template=self.field_template), |
|
|
|
Field('name', css_class=self.field_css+"__text", placeholder=_("Имя"), template=self.field_template), |
|
|
|
Field('email', css_class="left-menu__text", placeholder=_("Email"), template=self.field_template), |
|
|
|
Field('email', css_class=self.field_css+"__text", placeholder=_("Email"), template=self.field_template), |
|
|
|
Field('subject', css_class="left-menu__text", placeholder=_("Название продукта"), template=self.field_template), |
|
|
|
Field('subject', css_class=self.field_css+"__text", placeholder=_("Название продукта"), template=self.field_template), |
|
|
|
Field('phone', css_class="left-menu__text", placeholder=_("+79781234567"), template=self.field_template), |
|
|
|
Field('phone', css_class=self.field_css+"__text", placeholder=_("+79781234567"), template=self.field_template), |
|
|
|
Submit('send', _("Отправить"), css_class="left-menu__btn") |
|
|
|
Submit('send', _("Отправить"), css_class=self.field_css+"__btn") |
|
|
|
) |
|
|
|
) |
|
|
|
super(ContactUsForm, self).__init__(*args, **kwargs) |
|
|
|
super(ContactUsForm, self).__init__(*args, **kwargs) |
|
|
|
self.init_fields(self.fields) |
|
|
|
self.init_fields(self.fields) |
|
|
|
|