class Meta: """ Meta-info for the form. """ model = ContactSubmission # our_notes is only to be used by staff/admin exclude = ('our_notes', ) help_texts = { 'message': None, } widgets = { 'first_name': UnifyTextInput(attrs={'placeholder': 'First Name*'}, left_icon='fas fa-user'), 'last_name': UnifyTextInput(attrs={'placeholder': 'Last Name*'}, left_icon='fas fa-user'), 'email': UnifyTextInput(attrs={'placeholder': 'E-mail Address*'}, left_icon='fas fa-envelope'), 'phone': UnifyPhoneInput(attrs={'placeholder': 'Phone'}), 'message': UnifyTextarea(attrs={ 'placeholder': 'Message*', 'rows': '5' }), 'mailing_list': UnifyCheckboxInput( label='I would like to join the Club mailing list'), }
class Meta: model = CshcUser fields = ('email', 'first_name', 'last_name') widgets = { 'first_name': UnifyTextInput(left_icon='fas fa-user'), 'last_name': UnifyTextInput(left_icon='fas fa-user'), 'email': forms.HiddenInput(), }
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['email'].widget = UnifyTextInput( attrs={ 'type': 'email', 'placeholder': 'E-mail address' }, left_icon='fas fa-envelope')
class Meta: """ Meta-info for the form.""" model = Member widgets = { 'first_name': UnifyTextInput(left_icon='fas fa-user'), 'known_as': UnifyTextInput(left_icon='fas fa-user'), 'last_name': UnifyTextInput(left_icon='fas fa-user'), 'profile_pic': CshcCropWidget, 'pref_position': UnifySelect, 'phone': UnifyPhoneInput, 'addr_street': UnifyTextInput(attrs={'placeholder': 'Street'}), 'addr_line2': UnifyTextInput(), 'addr_town': UnifyTextInput(attrs={'placeholder': 'Town/city'}), 'addr_postcode': UnifyTextInput(attrs={'placeholder': 'Post code'}), 'addr_position': GeopositionWidget, 'dob': UnifyDateInput, 'emergency_contact': UnifyTextInput(), 'emergency_relationship': UnifySelect, 'emergency_phone': UnifyPhoneInput, 'medical_notes': UnifyTextarea(attrs={'rows': '5'}), 'email': forms.HiddenInput(), } labels = { 'addr_street': 'Address', } help_texts = { 'emergency_relationship': 'Your emergency contact\'s relationship to you', } fields = ( 'email', 'first_name', 'known_as', 'last_name', 'profile_pic', 'profile_pic_cropping', # Personal # Playing 'pref_position', # Contact 'phone', 'addr_street', 'addr_line2', 'addr_town', 'addr_postcode', 'addr_position', 'dob', 'emergency_contact', 'emergency_relationship', 'emergency_phone', 'medical_notes', # Medical )
class Meta: """ Meta-info for the form. """ model = JuniorsContactSubmission # our_notes is only to be used by staff/admin exclude = ('our_notes', ) help_texts = { 'message': None, } labels = { 'trigger': 'How did you hear about Cambridge South Junior Hockey?', } widgets = { 'first_name': UnifyTextInput(attrs={'placeholder': 'First Name*'}, left_icon='fas fa-user'), 'last_name': UnifyTextInput(attrs={'placeholder': 'Last Name*'}, left_icon='fas fa-user'), 'email': UnifyTextInput(attrs={'placeholder': 'E-mail Address*'}, left_icon='fas fa-envelope'), 'phone': UnifyPhoneInput(attrs={'placeholder': 'Phone'}), 'child_name': UnifyTextInput(attrs={'placeholder': 'Name*'}, left_icon='fas fa-user'), 'child_gender': UnifySelect, 'child_age': UnifySelect, 'message': UnifyTextarea(attrs={ 'placeholder': 'Message*', 'rows': '5' }), 'mailing_list': UnifyCheckboxInput( label='I would like to join the Club mailing list'), 'trigger': UnifySelect, }
class SignupFormExtra(forms.Form): """ Custom form for additional sign-up information """ first_name = forms.CharField(max_length=30, label='First name', widget=UnifyTextInput( attrs={ 'placeholder': 'First name', 'class': 'g-py-15 g-pr-15', }, left_icon='fas fa-user')) last_name = forms.CharField(max_length=30, label='Last name', widget=UnifyTextInput(attrs={ 'placeholder': 'Last name', 'class': 'g-py-15 g-pr-15', }, left_icon='fas fa-user')) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['email'].widget = UnifyTextInput( attrs={ 'placeholder': 'E-mail address', 'class': 'g-py-15 g-pr-15', }, left_icon='fas fa-envelope') def signup(self, request, user): """ Required method that is called by the django-allauth's form when saving a new user. """ user.first_name = self.cleaned_data['first_name'] user.last_name = self.cleaned_data['last_name'] user.save()
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['login'].widget = UnifyTextInput( attrs={ 'type': 'email', 'placeholder': 'E-mail address', 'class': 'g-py-15 g-pr-15', }, left_icon='fas fa-envelope') self.fields['password'].widget = UnifyPasswordInput( attrs={ 'placeholder': 'Password', 'class': 'g-py-15 g-pr-15', }, left_icon='fas fa-lock')