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 %} +
+

New Membership

+
+ {% csrf_token %} +

The Bridge City Bicycle Co­operative aims to be a safe and respectful environment geared towards education, empowerment and community­building. In order to do so we need your input and support.

+ +

Member Privileges

+ + {% if form.non_field_errors %} +
+ {{ form.errors }} +
+ {% endif %} +
+

Member Responsibilities

+
Respect and Maintaining a Safe Space
+
    +
  • Respect others and self
  • +
  • Help others
  • +
  • Racist, ableist, ageist, homophobic, sexist, and classist behavior and language will not be tolerated
  • +
  • The BCBC seeks to build a healthy lifestyle community, and behavior seen as hindering this objective will not be tolerated
  • +
  • Ask for help: With tools, processes, and even emotions
  • +
+ +
+
+
Respect the Community
+
    +
  • Build positive relationships with Community Members
  • +
  • Build positive relationships with CNYC employees, volunteers, and patrons
  • +
+ +
+
+
Giving back
+

+ Our services are free and Members are encouraged to contribute in any way they can. Our vibrancy comes from the volunteer work of a large community with diverse skills and passions. There are so many ways to be a part of this community, regardless of whether or not you know how to change a tire (yet!). Ask how you can help out or get in touch with our volunteer coordinator (volunteer@bridgecitybicyclecoop.com) +

+ +
+
+
Respect the Space
+
    +
  • Replace tools when not using them so that others can play too.
  • +
  • Do not steal or borrow articles within the space for personal use.
  • +
  • If you don't know what it is, how to use it, or where it goes, ask someone
  • +
  • Ensure you always leave time to clean up after yourself and others, and then do so
  • +
  • If you have to leave in the middle of a project, put pieces into a small bag and attach it to the bike
  • +
  • Personal projects may be kept at the BCBC for a maximum of one day; however, this is highly discouraged due to lack of space and the concern for theft.
  • +
  • Label your bike with your name, phone number, and the last date you worked on it.
  • +
  • Do not force tools and use them only for their intended use. If you need help or guidance, ask someone! It’s what we’re here for!
  • +
+ +
+
+

Voluntary Self Identification

+

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 %} +
+
+ {{ form.self_ident_other }} + + {% if form.self_ident_other.errors %} + {{ form.self_ident_other.errors }} + {% endif %} +
+
+

Gender Identification

+ {% for checkbox in form.gender %} + + {% endfor %} +
+
+ {{ form.gender_other }} + + {% if form.gender_other.errors %} + {{ form.gender_other.errors }} + {% endif %} +
+
+ {{ form.renewed_at }} + + {% if form.renewed_at %} + {{ form.renewed_at.errors }} + {% else %} + Incorrect date. + {% endif %} +
+
+ +
+
+
+{% endblock %} + +{% block scripts %} + + + + + {% endblock %} \ No newline at end of file diff --git a/bikeshop_project/core/urls.py b/bikeshop_project/core/urls.py index f7687bd..1863202 100644 --- a/bikeshop_project/core/urls.py +++ b/bikeshop_project/core/urls.py @@ -1,6 +1,7 @@ from django.conf.urls import url -from .views import DashboardView +from .views import DashboardView, NewMembershipView urlpatterns = [ + url(r'^membership/new/$', NewMembershipView.as_view()), url(r'^$', DashboardView.as_view()), ] diff --git a/bikeshop_project/core/views.py b/bikeshop_project/core/views.py index aa475e1..c94c5a5 100644 --- a/bikeshop_project/core/views.py +++ b/bikeshop_project/core/views.py @@ -1,7 +1,16 @@ from django.template.response import TemplateResponse from django.views.generic import View +from core.forms import MembershipForm + class DashboardView(View): def get(self, request): - return TemplateResponse(request, 'dashboard.html') \ No newline at end of file + return TemplateResponse(request, 'dashboard.html') + + +class NewMembershipView(View): + def get(self, request): + form = MembershipForm() + + return TemplateResponse(request, 'membership_form.html', {'form': form}) diff --git a/bikeshop_project/registration/forms.py b/bikeshop_project/registration/forms.py index bcc7694..ccc1b43 100644 --- a/bikeshop_project/registration/forms.py +++ b/bikeshop_project/registration/forms.py @@ -4,24 +4,11 @@ from registration.models import Member class MemberForm(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'})) - # priveleges = BooleanField(label='I acknowledge', widget=CheckboxInput(attrs={'class': 'mdl-checkbox__input'})) waiver_substitute = BooleanField(label='I have read and agree to the above terms & conditions.', widget=CheckboxInput(attrs={'class': 'mdl-checkbox__input'})) class Meta: model = Member - 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') - ) + exclude = ('waiver',) fields = ['email', 'email_consent', 'first_name', 'last_name', 'preferred_name', 'date_of_birth', 'guardian_name', 'phone', 'street', 'city', 'province', 'country', 'post_code', 'waiver'] @@ -40,9 +27,6 @@ class MemberForm(ModelForm): 'country': TextInput(attrs={'class': 'mdl-textfield__input'}), 'post_code': TextInput(attrs={'class': 'mdl-textfield__input', 'pattern': '[A-Za-z][0-9][A-Za-z] [0-9][A-Za-z][0-9]'}), - # 'self_identification': CheckboxSelectMultiple(choices=self_ident_choices, - # attrs={'class': 'mdl-checkbox__input'}), - # 'gender': CheckboxSelectMultiple(choices=gender_choices, attrs={'class': 'mdl-checkbox__input'}), } labels = { diff --git a/bikeshop_project/registration/templates/member_form.html b/bikeshop_project/registration/templates/member_form.html index caf00b1..0858db6 100644 --- a/bikeshop_project/registration/templates/member_form.html +++ b/bikeshop_project/registration/templates/member_form.html @@ -184,48 +184,7 @@ {{ form.country.errors }} {% endif %} -{#
#} -{#

Voluntary Self Identification

#} -{#

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 %}#} -{#
#} -{#
#} -{# {{ form.self_ident_other }}#} -{# #} -{# {% if form.self_ident_other.errors %}#} -{# {{ form.self_ident_other.errors }}#} -{# {% endif %}#} -{#
#} -{#
#} -{#

Gender Identification

#} -{# {% for checkbox in form.gender %}#} -{# #} -{# {% endfor %}#} -{#
#} -{#
#} -{# {{ form.gender_other }}#} -{# #} -{# {% if form.gender_other.errors %}#} -{# {{ form.gender_other.errors }}#} -{# {% endif %}#} -{#
#} +
Liability Waiver

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" } }