Add ' *' required markers back
The bootstrap renderer did not do anything to signify required rows. We can do this by adding a class for CSS to work on, and add this field in a more simplified manner. label-required == append ' *'
This commit is contained in:
parent
b3ac11a66b
commit
8fa8fc4012
4 changed files with 12 additions and 1 deletions
|
@ -7,6 +7,8 @@ from .models import TalkProposal, TutorialProposal, MiniconfProposal
|
||||||
|
|
||||||
class ProposalForm(forms.ModelForm):
|
class ProposalForm(forms.ModelForm):
|
||||||
|
|
||||||
|
required_css_class = 'label-required'
|
||||||
|
|
||||||
def clean_description(self):
|
def clean_description(self):
|
||||||
value = self.cleaned_data["description"]
|
value = self.cleaned_data["description"]
|
||||||
if len(value) > 400:
|
if len(value) > 400:
|
||||||
|
|
|
@ -9,7 +9,7 @@ class YesNoField(forms.TypedChoiceField):
|
||||||
kwargs['required'] = True
|
kwargs['required'] = True
|
||||||
super(YesNoField, self).__init__(
|
super(YesNoField, self).__init__(
|
||||||
*args,
|
*args,
|
||||||
coerce=lambda x: x == True,
|
coerce=lambda x: x is True,
|
||||||
choices=((None, '--------'), (False, 'No'), (True, 'Yes')),
|
choices=((None, '--------'), (False, 'No'), (True, 'Yes')),
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
@ -18,6 +18,8 @@ class YesNoField(forms.TypedChoiceField):
|
||||||
class ProfileForm(forms.ModelForm):
|
class ProfileForm(forms.ModelForm):
|
||||||
''' A form for requesting badge and profile information. '''
|
''' A form for requesting badge and profile information. '''
|
||||||
|
|
||||||
|
required_css_class = 'label-required'
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.AttendeeProfile
|
model = models.AttendeeProfile
|
||||||
exclude = ['attendee']
|
exclude = ['attendee']
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
{% load pyconau2017_tags %}
|
{% load pyconau2017_tags %}
|
||||||
{% load bootstrap %}
|
{% load bootstrap %}
|
||||||
|
|
||||||
|
{% block extra_style %}
|
||||||
|
<style type="text/css">
|
||||||
|
.label-required:after { content: ' *'; }
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% if form.non_field_errors %}
|
{% if form.non_field_errors %}
|
||||||
<div class="has-errors">
|
<div class="has-errors">
|
||||||
{{ form.non_field_errors }}
|
{{ form.non_field_errors }}
|
||||||
|
|
1
static/src/css/app.css
Normal file
1
static/src/css/app.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.label-required:after { content: '*'; }
|
Loading…
Reference in a new issue