mirror of https://github.com/fspc/workstand.git
Drew Larson
9 years ago
9 changed files with 249 additions and 67 deletions
@ -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'}), |
||||
|
} |
@ -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', |
||||
|
), |
||||
|
] |
@ -0,0 +1,158 @@ |
|||||
|
{% extends 'base.html' %} |
||||
|
{% load staticfiles %} |
||||
|
|
||||
|
{% block styles %} |
||||
|
<link rel="stylesheet" href="{% static 'vendor/md-date-time-picker/dist/css/mdDateTimePicker.min.css' %}"> |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block content %} |
||||
|
<div class="mdl-cell mdl-cell--8-col"> |
||||
|
<h1>New Membership</h1> |
||||
|
<form method="post"> |
||||
|
{% csrf_token %} |
||||
|
<p>The Bridge City Bicycle Cooperative aims to be a safe and respectful environment geared towards education, empowerment and communitybuilding. In order to do so we need your input and support.</p> |
||||
|
|
||||
|
<h4>Member Privileges</h4> |
||||
|
<ul> |
||||
|
<li>Access to the BCBC tools, stands, and workspace</li> |
||||
|
<li>Access to friendly mechanical assistance and education when available</li> |
||||
|
<li>Opportunity to engage in decisions and help to build and develop the community's vision</li> |
||||
|
<li>The Bridge City Bicycle Cooperative (BCBC) values the trust of its volunteers, staff and members and is committed to protecting the privacy of all personal information entrusted to it. As such, collected information will be used in accordance with our privacy policy outlined on our website and in our shop.</li> |
||||
|
</ul> |
||||
|
{% if form.non_field_errors %} |
||||
|
<div> |
||||
|
<span class="error">{{ form.errors }}</span> |
||||
|
</div> |
||||
|
{% endif %} |
||||
|
<div> |
||||
|
<h4>Member Responsibilities</h4> |
||||
|
<h5>Respect and Maintaining a Safe Space</h5> |
||||
|
<ul> |
||||
|
<li>Respect others and self</li> |
||||
|
<li>Help others</li> |
||||
|
<li>Racist, ableist, ageist, homophobic, sexist, and classist behavior and language will not be tolerated</li> |
||||
|
<li>The BCBC seeks to build a healthy lifestyle community, and behavior seen as hindering this objective will not be tolerated</li> |
||||
|
<li>Ask for help: With tools, processes, and even emotions</li> |
||||
|
</ul> |
||||
|
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="{{ form.safe_space.id_for_label }}"> |
||||
|
{{ form.safe_space }} |
||||
|
<span class="mdl-checkbox__label">I acknowledge the BCBC is a safe space and agree to maintain it.</span> |
||||
|
</label> |
||||
|
</div> |
||||
|
<div> |
||||
|
<h5>Respect the Community</h5> |
||||
|
<ul> |
||||
|
<li>Build positive relationships with Community Members</li> |
||||
|
<li>Build positive relationships with CNYC employees, volunteers, and patrons</li> |
||||
|
</ul> |
||||
|
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="{{ form.respect_community.id_for_label }}"> |
||||
|
{{ form.respect_community }} |
||||
|
<span class="mdl-checkbox__label">I will respect the community.</span> |
||||
|
</label> |
||||
|
</div> |
||||
|
<div> |
||||
|
<h5>Giving back</h5> |
||||
|
<p> |
||||
|
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 (<a href="mailto:volunteer@bridgecitybicyclecoop.com">volunteer@bridgecitybicyclecoop.com</a>) |
||||
|
</p> |
||||
|
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="{{ form.give_back.id_for_label }}"> |
||||
|
{{ form.give_back }} |
||||
|
<span class="mdl-checkbox__label">I acknowledge that giving back is important</span> |
||||
|
</label> |
||||
|
</div> |
||||
|
<div> |
||||
|
<h5>Respect the Space</h5> |
||||
|
<ul> |
||||
|
<li>Replace tools when not using them so that others can play too.</li> |
||||
|
<li>Do not steal or borrow articles within the space for personal use.</li> |
||||
|
<li>If you don't know what it is, how to use it, or where it goes, ask someone</li> |
||||
|
<li>Ensure you always leave time to clean up after yourself and others, and then do so</li> |
||||
|
<li>If you have to leave in the middle of a project, put pieces into a small bag and attach it to the bike</li> |
||||
|
<li>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.</li> |
||||
|
<li>Label your bike with your name, phone number, and the last date you worked on it.</li> |
||||
|
<li>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!</li> |
||||
|
</ul> |
||||
|
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="{{ form.respect_shop.id_for_label }}"> |
||||
|
{{ form.respect_shop }} |
||||
|
<span class="mdl-checkbox__label">I will respect the shop.</span> |
||||
|
</label> |
||||
|
</div> |
||||
|
<div class=""> |
||||
|
<h2 class="template__header mdl-typography--title">Voluntary Self Identification</h2> |
||||
|
<p>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)</p> |
||||
|
{% for checkbox in form.self_identification %} |
||||
|
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="{{ checkbox.id_for_label }}"> |
||||
|
{{ checkbox }} |
||||
|
<span class="mdl-checkbox__label">{{ checkbox.label }}</span> |
||||
|
</label> |
||||
|
{% endfor %} |
||||
|
{% if form.self_identification.errors %} |
||||
|
<span class="mdl-textfield__error">{{ form.self_identification.errors }}</span> |
||||
|
{% else %} |
||||
|
<span class="mdl-textfield__error">Hmm</span> |
||||
|
{% endif %} |
||||
|
</div> |
||||
|
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.gender_other.errors %}is-invalid{% endif %}"> |
||||
|
{{ form.self_ident_other }} |
||||
|
<label class="mdl-textfield__label" for="{{ form.self_ident_other.id_for_label }}">{{ form.self_ident_other.label }}</label> |
||||
|
{% if form.self_ident_other.errors %} |
||||
|
<span class="mdl-textfield__error">{{ form.self_ident_other.errors }}</span> |
||||
|
{% endif %} |
||||
|
</div> |
||||
|
<div class=""> |
||||
|
<h3 class="template__header mdl-typography--body-2">Gender Identification</h3> |
||||
|
{% for checkbox in form.gender %} |
||||
|
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="{{ checkbox.id_for_label }}"> |
||||
|
{{ checkbox }} |
||||
|
<span class="mdl-checkbox__label">{{ checkbox.label }}</span> |
||||
|
</label> |
||||
|
{% endfor %} |
||||
|
</div> |
||||
|
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.gender_other.errors %}is-invalid{% endif %}"> |
||||
|
{{ form.gender_other }} |
||||
|
<label class="mdl-textfield__label" for="{{ form.gender_other.id_for_label }}">{{ form.gender_other.label }}</label> |
||||
|
{% if form.gender_other.errors %} |
||||
|
<span class="mdl-textfield__error">{{ form.gender_other.errors }}</span> |
||||
|
{% endif %} |
||||
|
</div> |
||||
|
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.renewed_at.errors %}is-invalid{% endif %}"> |
||||
|
{{ form.renewed_at }} |
||||
|
<label class="mdl-textfield__label" for="{{ form.renewed_at.id_for_label }}">{{ form.renewed_at.label }}</label> |
||||
|
{% if form.renewed_at %} |
||||
|
<span class="mdl-textfield__error">{{ form.renewed_at.errors }}</span> |
||||
|
{% else %} |
||||
|
<span class="mdl-textfield__error">Incorrect date.</span> |
||||
|
{% endif %} |
||||
|
</div> |
||||
|
<div> |
||||
|
<button disabled="true" id="submit" type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored">Submit</button> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block scripts %} |
||||
|
<script src="{% static 'vendor/moment/min/moment.min.js' %}"></script> |
||||
|
<script src="{% static 'vendor/draggabilly/dist/draggabilly.pkgd.min.js' %}"></script> |
||||
|
<script src="{% static 'vendor/md-date-time-picker/dist/js/mdDateTimePicker.min.js' %}"></script> |
||||
|
<script> |
||||
|
var renewedAt = new mdDateTimePicker.default({ |
||||
|
type: 'date', |
||||
|
past: moment().subtract(100, 'years'), |
||||
|
trigger: document.getElementById('{{ form.renewed_at.id_for_label }}') |
||||
|
}); |
||||
|
document.getElementById('{{ form.renewed_at.id_for_label }}').addEventListener('focus', function() { |
||||
|
console.log('Toggle!'); |
||||
|
renewedAt.toggle(); |
||||
|
}); |
||||
|
document.getElementById('{{ form.renewed_at.id_for_label }}').addEventListener('onOk', function () { |
||||
|
console.log('onOk'); |
||||
|
this.parentNode.classList.add('is-dirty'); |
||||
|
this.value = renewedAt.time.format('YYYY-MM-DD'); |
||||
|
}) |
||||
|
</script> |
||||
|
{% endblock %} |
@ -1,6 +1,7 @@ |
|||||
from django.conf.urls import url |
from django.conf.urls import url |
||||
|
|
||||
from .views import DashboardView |
from .views import DashboardView, NewMembershipView |
||||
urlpatterns = [ |
urlpatterns = [ |
||||
|
url(r'^membership/new/$', NewMembershipView.as_view()), |
||||
url(r'^$', DashboardView.as_view()), |
url(r'^$', DashboardView.as_view()), |
||||
] |
] |
||||
|
@ -1,7 +1,16 @@ |
|||||
from django.template.response import TemplateResponse |
from django.template.response import TemplateResponse |
||||
from django.views.generic import View |
from django.views.generic import View |
||||
|
|
||||
|
from core.forms import MembershipForm |
||||
|
|
||||
|
|
||||
class DashboardView(View): |
class DashboardView(View): |
||||
def get(self, request): |
def get(self, request): |
||||
return TemplateResponse(request, 'dashboard.html') |
return TemplateResponse(request, 'dashboard.html') |
||||
|
|
||||
|
|
||||
|
class NewMembershipView(View): |
||||
|
def get(self, request): |
||||
|
form = MembershipForm() |
||||
|
|
||||
|
return TemplateResponse(request, 'membership_form.html', {'form': form}) |
||||
|
Loading…
Reference in new issue