|
@@ -32,14 +32,48 @@ service_errors = {
|
|
|
|
|
|
|
|
|
|
class OrderForm(forms.Form):
|
|
class OrderForm(forms.Form):
|
|
- name = forms.CharField(label="", widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Имя'}))
|
|
|
|
- surname = forms.CharField(label="",
|
|
|
|
- widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Фамилия'}))
|
|
|
|
- service = forms.MultipleChoiceField(required=True, choices=SERVICE_CHOICES, widget=forms.CheckboxSelectMultiple(),
|
|
|
|
- error_messages=service_errors)
|
|
|
|
- datetime = forms.DateTimeField(initial=datetime.date.today, widget=forms.DateTimeInput(
|
|
|
|
- attrs={'type': 'datetime-local', 'class': 'form-control', 'placeholder': 'form-control'}))
|
|
|
|
- phone = forms.RegexField(regex=r'^\+?1?\d{9,15}$', error_messages=number_errors, widget=forms.TextInput(
|
|
|
|
- attrs={'class': 'form-control', 'type': 'tel', 'placeholder': '+79876543210'}))
|
|
|
|
- comment = forms.CharField(label="", required=False, widget=forms.Textarea(
|
|
|
|
- attrs={'class': 'form-control', 'placeholder': 'Комментарий', 'rows': '5'}))
|
|
|
|
|
|
+ name = forms.CharField(
|
|
|
|
+ label="",
|
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
|
+ 'class': 'form-control',
|
|
|
|
+ 'placeholder': 'Имя'
|
|
|
|
+ })
|
|
|
|
+ )
|
|
|
|
+ surname = forms.CharField(
|
|
|
|
+ label="",
|
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
|
+ 'class': 'form-control',
|
|
|
|
+ 'placeholder': 'Фамилия'
|
|
|
|
+ })
|
|
|
|
+ )
|
|
|
|
+ service = forms.MultipleChoiceField(
|
|
|
|
+ required=True,
|
|
|
|
+ choices=SERVICE_CHOICES,
|
|
|
|
+ widget=forms.CheckboxSelectMultiple(),
|
|
|
|
+ error_messages=service_errors
|
|
|
|
+ )
|
|
|
|
+ datetime = forms.DateTimeField(
|
|
|
|
+ initial=datetime.date.today,
|
|
|
|
+ widget=forms.DateTimeInput(attrs={
|
|
|
|
+ 'type': 'datetime-local',
|
|
|
|
+ 'class': 'form-control',
|
|
|
|
+ 'placeholder': 'form-control'
|
|
|
|
+ })
|
|
|
|
+ )
|
|
|
|
+ phone = forms.RegexField(
|
|
|
|
+ regex=r'^\+?1?\d{9,15}$',
|
|
|
|
+ error_messages=number_errors,
|
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
|
+ 'class': 'form-control',
|
|
|
|
+ 'type': 'tel',
|
|
|
|
+ 'placeholder': '+79876543210'
|
|
|
|
+ })
|
|
|
|
+ )
|
|
|
|
+ comment = forms.CharField(
|
|
|
|
+ label="",
|
|
|
|
+ required=False, widget=forms.Textarea(attrs={
|
|
|
|
+ 'class': 'form-control',
|
|
|
|
+ 'placeholder': 'Комментарий',
|
|
|
|
+ 'rows': '5'
|
|
|
|
+ })
|
|
|
|
+ )
|