diff --git a/bikeshop_project/core/forms.py b/bikeshop_project/core/forms.py new file mode 100644 index 0000000..59dde4f --- /dev/null +++ b/bikeshop_project/core/forms.py @@ -0,0 +1,44 @@ +from django.forms import ModelForm, TextInput, DateInput, CheckboxSelectMultiple, CharField, BooleanField, CheckboxInput + +from core.models import Membership + + +class MembershipForm(ModelForm): + self_ident_other = CharField(required=False, label='Self identification', widget=TextInput(attrs={'class': 'mdl-textfield__input'})) + gender_other = CharField(required=False, label='Other', widget=TextInput(attrs={'class': 'mdl-textfield__input'})) + safe_space = BooleanField(required=True, widget=CheckboxInput( + attrs={'class': 'mdl-checkbox__input'} + )) + respect_community = BooleanField(required=True, widget=CheckboxInput( + attrs={'class': 'mdl-checkbox__input'} + )) + give_back = BooleanField(required=True, widget=CheckboxInput( + attrs={'class': 'mdl-checkbox__input'} + )) + respect_shop = BooleanField(required=True, widget=CheckboxInput( + attrs={'class': 'mdl-checkbox__input'} + )) + + class Meta: + model = Membership + fields = ['renewed_at', 'self_identification', 'gender'] + + self_ident_choices = ( + ('First Nations; Métis; or Inuit', 'First Nations; Métis; or Inuit'), + ('visible minority', 'Visible Minority'), + ('caucasian', 'Caucasian'), + ('Other', 'Other') + ) + + gender_choices = ( + ('male', 'Male'), + ('female', 'Female'), + ('other', 'other') + ) + + widgets = { + 'self_identification': CheckboxSelectMultiple(choices=self_ident_choices, + attrs={'class': 'mdl-checkbox__input'}), + 'gender': CheckboxSelectMultiple(choices=gender_choices, attrs={'class': 'mdl-checkbox__input'}), + 'renewed_at': TextInput(attrs={'class': 'mdl-textfield__input'}), + } diff --git a/bikeshop_project/core/migrations/0007_auto_20160501_2253.py b/bikeshop_project/core/migrations/0007_auto_20160501_2253.py new file mode 100644 index 0000000..1219ac9 --- /dev/null +++ b/bikeshop_project/core/migrations/0007_auto_20160501_2253.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2016-05-01 22:53 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0006_auto_20160410_1833'), + ] + + operations = [ + migrations.RemoveField( + model_name='membership', + name='acknowledgement', + ), + migrations.RemoveField( + model_name='membership', + name='community', + ), + migrations.RemoveField( + model_name='membership', + name='give_back', + ), + migrations.RemoveField( + model_name='membership', + name='safe_space', + ), + ] diff --git a/bikeshop_project/core/models.py b/bikeshop_project/core/models.py index fb9b364..8cd0d6a 100644 --- a/bikeshop_project/core/models.py +++ b/bikeshop_project/core/models.py @@ -11,11 +11,6 @@ class Membership(models.Model): on_delete=models.CASCADE, related_name='membership' ) - safe_space = models.BooleanField(default=False) - community = models.BooleanField(default=False) - give_back = models.BooleanField(default=False) - # this should be a form field that requires the new member to type out there full name - acknowledgement = models.BooleanField(default=False) self_identification = models.CharField(max_length=255, null=True, blank=True) gender = models.CharField(max_length=255, null=True, blank=True) involvement = models.CharField(max_length=255, null=True, blank=True) diff --git a/bikeshop_project/core/templates/membership_form.html b/bikeshop_project/core/templates/membership_form.html new file mode 100644 index 0000000..91f7165 --- /dev/null +++ b/bikeshop_project/core/templates/membership_form.html @@ -0,0 +1,158 @@ +{% extends 'base.html' %} +{% load staticfiles %} + +{% block styles %} + +{% endblock %} + +{% block content %} +
We want to make sure that all members of our community, regardless of race, ethnicity, and gender#} -{# are able to participate fully in the BCBC. Please share information about your race and/or#} -{# ethnicity so that we can track how well we are including all communities and whether there may be#} -{# barriers to certain groups’ participation. Thank you! Do you identify as: (In each category, check#} -{# all that apply)
#} -{# {% for checkbox in form.self_identification %}#} -{# #} -{# {% endfor %}#} -{# {% if form.self_identification.errors %}#} -{# {{ form.self_identification.errors }}#} -{# {% else %}#} -{# Hmm#} -{# {% endif %}#} -{#Children under the age of 18 must have a parent or guardian co-sign the following waiver form. diff --git a/bower.json b/bower.json index 3f5bc4c..7c4a3af 100644 --- a/bower.json +++ b/bower.json @@ -17,6 +17,7 @@ "tests" ], "dependencies": { - "material-design-lite": "^1.1.3" + "material-design-lite": "^1.1.3", + "md-date-time-picker": "https://github.com/puranjayjain/md-date-time-picker.git#master" } }