|
@@ -45,9 +45,17 @@ class PublicContribForm(forms.ModelForm):
|
|
|
'floor_total': forms.TextInput(
|
|
|
attrs={'placeholder': "Nb. d'étages du bâtiment"}),
|
|
|
}
|
|
|
+
|
|
|
# Widget rendering is managed by hand in template for orientions.
|
|
|
orientations = forms.MultipleChoiceField(choices=ORIENTATIONS)
|
|
|
|
|
|
+ def __init__(self, *args, **kwargs):
|
|
|
+ super(PublicContribForm, self).__init__(*args, **kwargs)
|
|
|
+ for f in self.errors:
|
|
|
+ field = self.fields[f]
|
|
|
+ classes = ["error", (field.widget.attrs['class'] if 'class' in field.widget.attrs else "")]
|
|
|
+ field.widget.attrs['class'] = classes
|
|
|
+
|
|
|
_privacy_fieldnames = (
|
|
|
'privacy_name', 'privacy_email', 'privacy_coordinates',
|
|
|
'privacy_place_details', 'privacy_comment',
|