Use a selectbox for of_legal_age
To me, this registeres to a user as a required field better than a radio-button. As well, we now signal it as "required = True"
This commit is contained in:
parent
a291d17466
commit
079f87b1d2
6 changed files with 14 additions and 16 deletions
|
@ -20,7 +20,7 @@ def do_monkey_patch():
|
||||||
def patch_speaker_profile_form():
|
def patch_speaker_profile_form():
|
||||||
''' Replaces textarea widgets with markdown editors. '''
|
''' Replaces textarea widgets with markdown editors. '''
|
||||||
|
|
||||||
import widgets
|
from . import widgets
|
||||||
from symposion.speakers.forms import SpeakerForm
|
from symposion.speakers.forms import SpeakerForm
|
||||||
|
|
||||||
fields = SpeakerForm.base_fields
|
fields = SpeakerForm.base_fields
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
import models
|
from . import models
|
||||||
from symposion.proposals import models as symposion_models
|
from symposion.proposals import models as symposion_models
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import models
|
from . import models
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
|
|
||||||
|
|
||||||
class YesNoField(forms.TypedChoiceField):
|
class YesNoField(forms.TypedChoiceField):
|
||||||
|
|
||||||
def __init__(self, *a, **k):
|
def __init__(self, *args, **kwargs):
|
||||||
|
kwargs['required'] = True
|
||||||
super(YesNoField, self).__init__(
|
super(YesNoField, self).__init__(
|
||||||
*a,
|
*args,
|
||||||
coerce=lambda x: x == 'True',
|
coerce=lambda x: x == True,
|
||||||
choices=((False, 'No'), (True, 'Yes')),
|
choices=((None, '--------'), (False, 'No'), (True, 'Yes')),
|
||||||
widget=forms.RadioSelect,
|
**kwargs
|
||||||
**k
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,12 +21,12 @@ class ProfileForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.AttendeeProfile
|
model = models.AttendeeProfile
|
||||||
exclude = ['attendee']
|
exclude = ['attendee']
|
||||||
|
widgets = {
|
||||||
|
'past_lca': forms.widgets.CheckboxSelectMultiple
|
||||||
|
}
|
||||||
field_classes = {
|
field_classes = {
|
||||||
"of_legal_age": YesNoField,
|
"of_legal_age": YesNoField,
|
||||||
}
|
}
|
||||||
widgets = {
|
|
||||||
"past_lca": forms.widgets.CheckboxSelectMultiple(),
|
|
||||||
}
|
|
||||||
|
|
||||||
class Media:
|
class Media:
|
||||||
js = ("lca2017/js/profile_form.js", )
|
js = ("lca2017/js/profile_form.js", )
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Migration(migrations.Migration):
|
||||||
('free_text_2', models.CharField(blank=True, max_length=64, verbose_name=b'Free text line 2')),
|
('free_text_2', models.CharField(blank=True, max_length=64, verbose_name=b'Free text line 2')),
|
||||||
('name_per_invoice', models.CharField(blank=True, help_text=b"If your legal name is different to the name on your badge, fill this in, and we'll put it on your invoice. Otherwise, leave it blank.", max_length=256, verbose_name=b'Your legal name (for invoicing purposes)')),
|
('name_per_invoice', models.CharField(blank=True, help_text=b"If your legal name is different to the name on your badge, fill this in, and we'll put it on your invoice. Otherwise, leave it blank.", max_length=256, verbose_name=b'Your legal name (for invoicing purposes)')),
|
||||||
('address', models.TextField(blank=True, help_text=b'This address, if provided, will appear on your invoices.', verbose_name=b'Invoicing address')),
|
('address', models.TextField(blank=True, help_text=b'This address, if provided, will appear on your invoices.', verbose_name=b'Invoicing address')),
|
||||||
('of_legal_age', models.BooleanField(default=False, help_text=b'Being under 18 will not stop you from attending the conference. We need to know whether you are over 18 to allow us to cater for you at venues that serve alcohol.', verbose_name=b'Are you over 18?')),
|
('of_legal_age', models.BooleanField(help_text=b'Being under 18 will not stop you from attending the conference. We need to know whether you are over 18 to allow us to cater for you at venues that serve alcohol.', verbose_name=b'Are you over 18?')),
|
||||||
('dietary_restrictions', models.TextField(blank=True, max_length=256, verbose_name=b'Food allergies, intolerances, or dietary restrictions')),
|
('dietary_restrictions', models.TextField(blank=True, max_length=256, verbose_name=b'Food allergies, intolerances, or dietary restrictions')),
|
||||||
('accessibility_requirements', models.TextField(blank=True, verbose_name=b'Accessibility-related requirements')),
|
('accessibility_requirements', models.TextField(blank=True, verbose_name=b'Accessibility-related requirements')),
|
||||||
('gender', models.CharField(blank=True, help_text=b'Gender data will only be used for demographic purposes.', max_length=64)),
|
('gender', models.CharField(blank=True, help_text=b'Gender data will only be used for demographic purposes.', max_length=64)),
|
||||||
|
|
|
@ -172,9 +172,7 @@ The linux.conf.au 2016 attendees mailing listName
|
||||||
)
|
)
|
||||||
|
|
||||||
of_legal_age = models.BooleanField(
|
of_legal_age = models.BooleanField(
|
||||||
default=False,
|
|
||||||
verbose_name="Are you over 18?",
|
verbose_name="Are you over 18?",
|
||||||
blank=True,
|
|
||||||
help_text="Being under 18 will not stop you from attending the "
|
help_text="Being under 18 will not stop you from attending the "
|
||||||
"conference. We need to know whether you are over 18 to "
|
"conference. We need to know whether you are over 18 to "
|
||||||
"allow us to cater for you at venues that serve alcohol.",
|
"allow us to cater for you at venues that serve alcohol.",
|
||||||
|
|
|
@ -7,7 +7,7 @@ from django.shortcuts import redirect
|
||||||
from registrasion import models as rego
|
from registrasion import models as rego
|
||||||
from registrasion.controllers.invoice import InvoiceController
|
from registrasion.controllers.invoice import InvoiceController
|
||||||
|
|
||||||
import models
|
from . import models
|
||||||
|
|
||||||
|
|
||||||
def demopay(request, invoice_id, access_code):
|
def demopay(request, invoice_id, access_code):
|
||||||
|
|
Loading…
Reference in a new issue