diff --git a/pinaxcon/proposals/forms.py b/pinaxcon/proposals/forms.py index 13da6756..c85a8811 100644 --- a/pinaxcon/proposals/forms.py +++ b/pinaxcon/proposals/forms.py @@ -7,6 +7,8 @@ from .models import TalkProposal, TutorialProposal, MiniconfProposal class ProposalForm(forms.ModelForm): + required_css_class = 'label-required' + def clean_description(self): value = self.cleaned_data["description"] if len(value) > 400: diff --git a/pinaxcon/registrasion/forms.py b/pinaxcon/registrasion/forms.py index b379f335..cc865ec5 100644 --- a/pinaxcon/registrasion/forms.py +++ b/pinaxcon/registrasion/forms.py @@ -9,7 +9,7 @@ class YesNoField(forms.TypedChoiceField): kwargs['required'] = True super(YesNoField, self).__init__( *args, - coerce=lambda x: x == True, + coerce=lambda x: x is True, choices=((None, '--------'), (False, 'No'), (True, 'Yes')), **kwargs ) @@ -18,6 +18,8 @@ class YesNoField(forms.TypedChoiceField): class ProfileForm(forms.ModelForm): ''' A form for requesting badge and profile information. ''' + required_css_class = 'label-required' + class Meta: model = models.AttendeeProfile exclude = ['attendee'] diff --git a/pinaxcon/templates/_form_snippet.html b/pinaxcon/templates/_form_snippet.html index 7d64b937..d39c2b19 100644 --- a/pinaxcon/templates/_form_snippet.html +++ b/pinaxcon/templates/_form_snippet.html @@ -1,6 +1,12 @@ {% load pyconau2017_tags %} {% load bootstrap %} +{% block extra_style %} + +{% endblock %} + {% if form.non_field_errors %}
{{ form.non_field_errors }} diff --git a/static/src/css/app.css b/static/src/css/app.css new file mode 100644 index 00000000..44385f22 --- /dev/null +++ b/static/src/css/app.css @@ -0,0 +1 @@ +.label-required:after { content: '*'; }