@ -2,7 +2,7 @@
{% load staticfiles %}
{% load staticfiles %}
{% block scripts %}
{% block scripts %}
< script src = "{% static 'vendor/moment/min/moment.min.js' %} " > < / script >
< script src = "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js " > < / script >
< script >
< script >
dateOfBirthInput = document.getElementById('{{ form.date_of_birth.id_for_label }}');
dateOfBirthInput = document.getElementById('{{ form.date_of_birth.id_for_label }}');
@ -23,41 +23,14 @@
}
}
});
});
var waiverCheckBox = document.getElementById('{{ form.waiver_substitute.id_for_label }}');
var submitButton = document.getElementById('submit');
var requiredCheckboxes = function() {
return waiverCheckBox.checked;
};
waiverCheckBox.addEventListener('change', function() {
if (requiredCheckboxes()) {
submitButton.disabled = false;
}
else {
submitButton.disabled = true;
}
});
// On page load check on the check boxes
if (requiredCheckboxes()) {
submitButton.disabled = false;
}
< / script >
< / script >
{% endblock %}
{% endblock %}
{% block content %}
{% block content %}
< div class = "mdl-cell mdl-cell--8-col" >
< div class = "mdl-grid" >
< div class = "mdl-cell mdl-cell--12-col" >
< h1 > {{ form.instance.first_name }} {{ form.instance.last_name }}< / h1 >
< h1 > {{ form.instance.first_name }} {{ form.instance.last_name }}< / h1 >
< p >
The Bridge City Bicycle Co-operative (herein referred to as The BCBC and The Community) is a nonprofit,
community bicycle repair education and resource co-operative. We offer our members nonjudgmental repair
space, tools and instruction during business hours (hours on website) by donation, and educational
workshops. We also offer reconditioned/recycled low cost bikes and parts for sale.
The BCBC is operated by volunteers; a medley of professionals, students, bike enthusiasts, activists,
and other community members who share a love for cycling in Saskatoon. Membership is open to all
individuals and costs $20 per year. A receipt will be issued to you once your membership fee has been paid.
< / p >
< form method = "post" >
< form method = "post" >
{% csrf_token %}
{% csrf_token %}
@ -66,118 +39,197 @@
< span class = "error" > {{ form.errors }}< / span >
< span class = "error" > {{ form.errors }}< / span >
< / div >
< / div >
{% endif %}
{% endif %}
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.email.errors %}is-invalid{% endif %}" >
< div class = "mdl-grid" >
{{ form.email }}
< div class = "mdl-cell mdl-cell--12-col" >
< label class = "mdl-textfield__label" for = "{{ form.email.id_for_label }}" > {{ form.email.label }}< / label >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.email.errors %}is-invalid{% endif %}" >
{% if form.email.errors %}
{{ form.email }}
< span class = "mdl-textfield__error" > {{ form.email.errors }}< / span >
< label class = "mdl-textfield__label" for = "{{ form.email.id_for_label }}" > {{ form.email.label }}< / label >
{% else %}
{% if form.email.errors %}
< span class = "mdl-textfield__error" > Invalid email.< / span >
< span class = "mdl-textfield__error" > {{ form.email.errors }}< / span >
{% endif %}
{% else %}
< / div >
< span class = "mdl-textfield__error" > Invalid email.< / span >
< div >
{% endif %}
< label class = "mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for = "{{ form.email_consent.id_for_label }}" >
< / div >
{{ form.email_consent }}
< div >
< span class = "mdl-checkbox__label" > {{ form.email_consent.label }}< / span >
< label class = "mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for = "{{ form.email_consent.id_for_label }}" >
< / label >
{{ form.email_consent }}
< / div >
< span class = "mdl-checkbox__label" > {{ form.email_consent.label }}< / span >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.first_name.errors %}is-invalid{% endif %}" >
< / label >
{{ form.first_name }}
< / div >
< label class = "mdl-textfield__label" for = "{{ form.first_name.id_for_label }}" > {{ form.first_name.label }}< / label >
< / div >
{% if form.first_name.errors %}
< span class = "mdl-textfield__error" > {{ form.first_name.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Name too long.< / span >
{% endif %}
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.last_name.errors %}is-invalid{% endif %}" >
{{ form.last_name }}
< label class = "mdl-textfield__label" for = "{{ form.last_name.id_for_label }}" > {{ form.last_name.label }}< / label >
{% if form.last_name.errors %}
< span class = "mdl-textfield__error" > {{ form.last_name.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Name too long.< / span >
{% endif %}
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.preferred_name.errors %}is-invalid{% endif %}" >
{{ form.preferred_name }}
< label class = "mdl-textfield__label" for = "{{ form.preferred_name.id_for_label }}" > {{ form.preferred_name.label }}< / label >
{% if form.preferred_name.errors %}
< span class = "mdl-textfield__error" > {{ form.preferred_name.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Name too long.< / span >
{% endif %}
< / div >
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.date_of_birth.errors %}is-invalid{% endif %}" >
{{ form.date_of_birth }}
< div class = "mdl-grid" >
< label class = "mdl-textfield__label" for = "{{ form.date_of_birth.id_for_label }}" > {{ form.date_of_birth.label }} (e.g. 1991-08-25)< / label >
< div class = "mdl-cell" >
{% if form.date_of_birth.errors %}
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.first_name.errors %}is-invalid{% endif %}" >
< span class = "mdl-textfield__error" > {{ form.date_of_birth.errors }}< / span >
{{ form.first_name }}
{% else %}
< label class = "mdl-textfield__label" for = "{{ form.first_name.id_for_label }}" > {{ form.first_name.label }}< / label >
< span class = "mdl-textfield__error" > Incorrect date.< / span >
{% if form.first_name.errors %}
{% endif %}
< span class = "mdl-textfield__error" > {{ form.first_name.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Name too long.< / span >
{% endif %}
< / div >
< / div >
< div class = "mdl-cell" >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.last_name.errors %}is-invalid{% endif %}" >
{{ form.last_name }}
< label class = "mdl-textfield__label" for = "{{ form.last_name.id_for_label }}" > {{ form.last_name.label }}< / label >
{% if form.last_name.errors %}
< span class = "mdl-textfield__error" > {{ form.last_name.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Name too long.< / span >
{% endif %}
< / div >
< / div >
< / div >
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.guardian_name.errors %}is-invalid{% endif %}" >
{{ form.guardian_name }}
< div class = "mdl-grid" >
< label class = "mdl-textfield__label" for = "{{ form.guardian_name.id_for_label }}" > {{ form.guardian_name.label }}< / label >
< div class = "mdl-cell" >
{% if form.guardian_name.errors %}
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.preferred_name.errors %}is-invalid{% endif %}" >
< span class = "mdl-textfield__error" > {{ form.guardian_name.errors }}< / span >
{{ form.preferred_name }}
{% else %}
< label class = "mdl-textfield__label" for = "{{ form.preferred_name.id_for_label }}" > {{ form.preferred_name.label }}< / label >
< span class = "mdl-textfield__error" > Name too long.< / span >
{% if form.preferred_name.errors %}
{% endif %}
< span class = "mdl-textfield__error" > {{ form.preferred_name.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Name too long.< / span >
{% endif %}
< / div >
< / div >
< div class = "mdl-cell" >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.phone.errors %}is-invalid{% endif %}" >
{{ form.phone }}
< label class = "mdl-textfield__label" for = "{{ form.phone.id_for_label }}" > {{ form.phone.label }}< / label >
{% if form.phone.errors %}
< span class = "mdl-textfield__error" > {{ form.phone.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Digits only.< / span >
{% endif %}
< / div >
< / div >
< / div >
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.phone.errors %}is-invalid{% endif %}" >
{{ form.phone }}
< div class = "mdl-grid" >
< label class = "mdl-textfield__label" for = "{{ form.phone.id_for_label }}" > {{ form.phone.label }}< / label >
< div class = "mdl-cell" >
{% if form.phone.errors %}
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.date_of_birth.errors %}is-invalid{% endif %}" >
< span class = "mdl-textfield__error" > {{ form.phone.errors }}< / span >
{{ form.date_of_birth }}
{% else %}
< label class = "mdl-textfield__label" for = "{{ form.date_of_birth.id_for_label }}" > {{ form.date_of_birth.label }} (e.g. 1991-08-25)< / label >
< span class = "mdl-textfield__error" > Digits only.< / span >
{% if form.date_of_birth.errors %}
{% endif %}
< span class = "mdl-textfield__error" > {{ form.date_of_birth.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Incorrect date.< / span >
{% endif %}
< / div >
< / div >
< div class = "mdl-cell" >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.guardian_name.errors %}is-invalid{% endif %}" >
{{ form.guardian_name }}
< label class = "mdl-textfield__label" for = "{{ form.guardian_name.id_for_label }}" > {{ form.guardian_name.label }}< / label >
{% if form.guardian_name.errors %}
< span class = "mdl-textfield__error" > {{ form.guardian_name.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Name too long.< / span >
{% endif %}
< / div >
< / div >
< / div >
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.post_code.errors %}is-invalid{% endif %}" >
{{ form.post_code }}
< div class = "mdl-grid" >
< label class = "mdl-textfield__label" for = "{{ form.post_code.id_for_label }}" > {{ form.post_code.label }}< / label >
< div class = "mdl-cell" >
{% if form.post_code.errors %}
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.post_code.errors %}is-invalid{% endif %}" >
< span class = "mdl-textfield__error" > {{ form.post_code.errors }}< / span >
{{ form.post_code }}
{% else %}
< label class = "mdl-textfield__label" for = "{{ form.post_code.id_for_label }}" > {{ form.post_code.label }}< / label >
< span class = "mdl-textfield__error" > Format: A0A 0A0< / span >
{% if form.post_code.errors %}
{% endif %}
< span class = "mdl-textfield__error" > {{ form.post_code.errors }}< / span >
{% else %}
< span class = "mdl-textfield__error" > Format: A0A 0A0< / span >
{% endif %}
< / div >
< / div >
< div class = "mdl-cell" >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.street.errors %}is-invalid{% endif %}" >
{{ form.street }}
< label class = "mdl-textfield__label" for = "{{ form.street.id_for_label }}" > {{ form.street.label }}< / label >
{% if form.street.errors %}
< span class = "mdl-textfield__error" > {{ form.street.errors }}< / span >
{% endif %}
< / div >
< / div >
< / div >
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.street.errors %}is-invalid{% endif %}" >
< div class = "mdl-grid" >
{{ form.street }}
< div class = "mdl-cell" >
< label class = "mdl-textfield__label" for = "{{ form.street.id_for_label }}" > {{ form.street.label }}< / label >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.city.errors %}is-invalid{% endif %}" >
{% if form.street.errors %}
{{ form.city }}
< span class = "mdl-textfield__error" > {{ form.street.errors }}< / span >
< label class = "mdl-textfield__label" for = "{{ form.city.id_for_label }}" > {{ form.city.label }}< / label >
{% endif %}
{% if form.city.errors %}
< span class = "mdl-textfield__error" > {{ form.city.errors }}< / span >
{% endif %}
< / div >
< / div >
< div class = "mdl-cell" >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.province.errors %}is-invalid{% endif %}" >
{{ form.province }}
< label class = "mdl-textfield__label" for = "{{ form.province.id_for_label }}" > {{ form.province.label }}< / label >
{% if form.province.errors %}
< span class = "mdl-textfield__error" > {{ form.province.errors }}< / span >
{% endif %}
< / div >
< / div >
< / div >
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.city.errors %}is-invalid{% endif %}" >
< div class = "mdl-grid" >
{{ form.city }}
< div class = "mdl-cell" >
< label class = "mdl-textfield__label" for = "{{ form.city.id_for_label }}" > {{ form.city.label }}< / label >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.country.errors %}is-invalid{% endif %}" >
{% if form.city.errors %}
{{ form.country }}
< span class = "mdl-textfield__error" > {{ form.city.errors }}< / span >
< label class = "mdl-textfield__label" for = "{{ form.country.id_for_label }}" > {{ form.country.label }}< / label >
{% endif %}
{% if form.country.errors %}
< span class = "mdl-textfield__error" > {{ form.country.errors }}< / span >
{% endif %}
< / div >
< / div >
< / div >
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.province.errors %}is-invalid{% endif %}" >
{{ form.province }}
< div class = "mdl-grid" >
< label class = "mdl-textfield__label" for = "{{ form.province.id_for_label }}" > {{ form.province.label }}< / label >
< div class = "mdl-cell mdl-cell--12-col" >
{% if form.province.errors %}
< h2 > Member Info< / h2 >
< span class = "mdl-textfield__error" > {{ form.province.errors }}< / span >
< h3 > Notes< / h3 >
{% endif %}
< / div >
< div class = "mdl-cell mdl-cell--12-col" >
< div class = "mdl-textfield mdl-js-textfield mdl-cell--12-col" >
{{ form.notes }}
< label class = "mdl-textfield__label" for = "{{ form.notes.id_for_label }}" > {{ form.notes.label }}< / label >
{% if form.notes.errors %}
< span class = "mdl-textfield__error" > {{ form.notes.errors }}< / span >
{% endif %}
< / div >
< / div >
< / div >
< / div >
< div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.country.errors %}is-invalid{% endif %}" >
{{ form.country }}
< div class = "mdl-grid" >
< label class = "mdl-textfield__label" for = "{{ form.country.id_for_label }}" > {{ form.country.label }}< / label >
< div class = "mdl-cell mdl-cell--3-col" >
{% if form.country.errors %}
< label class = "mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for = "{{ form.suspended.id_for_label }}" >
< span class = "mdl-textfield__error" > {{ form.country.errors }}< / span >
{{ form.suspended }}
{% endif %}
< span class = "mdl-checkbox__label" > {{ form.suspended.label }}< / span >
< / label >
< / div >
< div class = "mdl-cell mdl-cell--3-col" >
< label class = "mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for = "{{ form.banned.id_for_label }}" >
{{ form.banned }}
< span class = "mdl-checkbox__label" > {{ form.banned.label }}< / span >
< / label >
< / div >
< / div >
< / div >
< div >
< div class = "mdl-grid" >
< button id = "submit" type = "submit" class = "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored" > Submit< / button >
< div class = "mdl-cell" >
< button id = "submit" type = "submit"
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored">
Save< / button >
< / div >
< / div >
< / div >
< / form >
< / form >
< / div >
< / div >
< div class = "mdl-cell mdl-cell--8-col" >
< / div >
< div class = "mdl-grid" >
< div class = "mdl-cell mdl-cell--8-col" >
{% if form.instance.memberships %}
{% if form.instance.memberships %}
< table class = "mdl-data-table mdl-js-data-table" >
< table class = "mdl-data-table mdl-js-data-table" >
< thead >
< thead >
@ -205,5 +257,7 @@
{% endif %}
{% endif %}
< a class = "mdl-button mdl-js-button mdl-button--flat mdl-js-ripple-effect mdl-button--colored" href = "{% url 'new_membership' member_id=member.id %}" > Add membership< / a >
< a class = "mdl-button mdl-js-button mdl-button--flat mdl-js-ripple-effect mdl-button--colored" href = "{% url 'new_membership' member_id=member.id %}" > Add membership< / a >
< / div >
< / div >
< / div >
{% endblock %}
{% endblock %}