Browse Source

Merge last couple of months of work (#45)

* Load webpack only in debug.

* Clean up.

* Pin versions because problems

* Add licence. (#40)

* Disable form until valid. (#42)

* Allow input height to be greater than 24px. (#41)

* Add youth payment type. (#43)
feature/travis-only-master
Drew Larson 7 years ago
committed by GitHub
parent
commit
6764c289ff
  1. 7
      LICENSE
  2. 2
      bikeshop_project/bikeshop/settings/production.py
  3. 20
      bikeshop_project/core/migrations/0004_auto_20170502_0120.py
  4. 1
      bikeshop_project/core/models.py
  5. 9
      bikeshop_project/core/static/scss/screen.scss
  6. 4
      bikeshop_project/package.json
  7. 15
      bikeshop_project/registration/templates/edit_member_form.html
  8. 51
      bikeshop_project/registration/templates/member_form.html
  9. 1
      bikeshop_project/webpack.dev.config.js

7
LICENSE

@ -0,0 +1,7 @@
Copyright 2017 Bridge City Bicycle Co-op Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2
bikeshop_project/bikeshop/settings/production.py

@ -1,5 +1,5 @@
import os
import sys
import rollbar
from .base import * # noqa

20
bikeshop_project/core/migrations/0004_auto_20170502_0120.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-02 01:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20170219_1741'),
]
operations = [
migrations.AlterField(
model_name='payment',
name='type',
field=models.CharField(choices=[('NONE', 'None'), ('CASH', 'Cash'), ('CHEQUE', 'Cheque'), ('VOLUNTEERING', 'Volunteering'), ('SQUARE', 'Square'), ('PAYPAL', 'PayPal'), ('YOUTH', 'Youth'), ('UNKNOWN', 'Unknown')], default='NONE', max_length=12),
),
]

1
bikeshop_project/core/models.py

@ -40,6 +40,7 @@ class Payment(models.Model):
('VOLUNTEERING', 'Volunteering'),
('SQUARE', 'Square'),
('PAYPAL', 'PayPal'),
('YOUTH', 'Youth'),
('UNKNOWN', 'Unknown')
)
type = models.CharField(max_length=12, choices=payment_choices, default='NONE')

9
bikeshop_project/core/static/scss/screen.scss

@ -372,4 +372,11 @@ span.mdl-textfield__error, span.error {
html [type="button"] {
-webkit-appearance: initial !important;
}
}
#member-form {
.mdl-checkbox {
height: auto;
min-height: 24px;
}
}

4
bikeshop_project/package.json

@ -17,7 +17,7 @@
"react": "^15.4.1",
"react-dom": "^15.4.1",
"react-tap-event-plugin": "^2.0.1",
"webpack": "^1.13.1",
"webpack": "1.13.1",
"webpack-bundle-tracker": "0.0.93"
},
"devDependencies": {
@ -44,6 +44,6 @@
"sass-loader": "^3.2.0",
"style-loader": "^0.13.1",
"toolbox-loader": "0.0.3",
"webpack-dev-server": "^1.14.1"
"webpack-dev-server": "1.14.1"
}
}

15
bikeshop_project/registration/templates/edit_member_form.html

@ -4,7 +4,8 @@
{% block scripts %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js"></script>
<script>
dateOfBirthInput = document.getElementById('{{ form.date_of_birth.id_for_label }}');
var dateOfBirthInput = document.getElementById('{{ form.date_of_birth.id_for_label }}');
var submitButton = document.getElementById('submit');
dateOfBirthInput.addEventListener('blur', function(event) {
var input = event.target;
@ -23,6 +24,16 @@
}
});
var form = document.getElementsByTagName('form')[0];
var inputs = Array.prototype.slice.call(document.getElementsByTagName('input'));
var textAreas = Array.prototype.slice.call(document.getElementsByTagName('textarea'));
for (var el of inputs.concat(textAreas)) {
el.addEventListener('change', function() {
submitButton.disabled = !form.checkValidity()
})
}
</script>
{% endblock %}
@ -220,7 +231,7 @@
</div>
<div class="mdl-grid">
<div class="mdl-cell">
<button id="submit" type="submit"
<button disabled id="submit" type="submit"
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored">
Save</button>
</div>

51
bikeshop_project/registration/templates/member_form.html

@ -25,6 +25,15 @@
var waiverCheckBox = document.getElementById('{{ form.waiver_substitute.id_for_label }}');
var submitButton = document.getElementById('submit');
var form = document.getElementsByTagName('form')[0];
var inputs = Array.prototype.slice.call(document.getElementsByTagName('input'));
for (var anInput of inputs) {
anInput.addEventListener('change', function() {
submitButton.disabled = !form.checkValidity()
})
}
var requiredCheckboxes = function() {
return waiverCheckBox.checked;
};
@ -47,7 +56,7 @@
{% endblock %}
{% block content %}
<div class="mdl-cell mdl-cell--8-col">
<div id="member-form" class="mdl-cell mdl-cell--8-col">
<h1>New Contact</h1>
<p>
The Bridge City Bicycle Co-operative (herein referred to as The BCBC and The Community) is a nonprofit,
@ -182,45 +191,17 @@
<p>By signing this form in the space provided below, I hereby assume all of the risks of participating and/or volunteering in the Bridge City Bicycle Co-operative, hereinafter referred to as the BCBC and the Community. I realize that liability may arise from negligence or carelessness on the part of the persons or entities being released, from dangerous or defective equipment or property owned, maintained or controlled by them or because of their possible liability without fault. I acknowledge that this Accident Waiver and Release of Liability form will be used by the Community, sponsors and organizers, in which I may participate and that it will govern my actions and responsibilities during my use of its services. In consideration of my application and permitting me to participate in this program, I hereby take action for myself, my executors, administrators, heirs, next of kin, successors, and assigns as follows:</p>
<p>(A) Waive, Release and Discharge from any and all liability for my death, disability, personal injury, property damage, property theft or actions of any kind which may hereafter accrue to me including my travelling to and from space or using the shop's bicycle, equipment or other facilities, THE FOLLOWING ENTITIES OR PERSONS: The directors, officers, employees, volunteers, representatives, and agents, the event holders, sponsors, volunteers of the Community;</p>
<p>(B) Indemnify and Hold Harmless the entities and persons set forth in (A) above from any and all liabilities and claims arising from my participation in the Community, including my use of a bicycle belonging to the Community, irrespective of whether the cause of the claims or liability arise from the negligence, acts or omissions of me, a third party, or the Community.</p>
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="{{ form.waiver_substitute.id_for_label }}">
{{ form.waiver_substitute }}
<span class="mdl-checkbox__label">{{ form.waiver_substitute.label }}</span>
</label>
</div>
{# <div>#}
{# <h2 class="template__header mdl-typography--title">Privacy Policy</h2>#}
{# <p>Bridge City Bicycle Co-operative (BCBC) values the trust of its volunteers, staff, and members and#}
{# is committed to protecting the privacy of all personal information entrusted to it. BCBC only#}
{# collects the limited personal information needed to deliver high quality services and programming.#}
{# Collected information will be used only for the purpose expressly identified or for other purposes#}
{# which could be reasonably considered to be consistent with out mission. We do not sell, rent or#}
{# trade personal information. The personal information collected will be protected with appropriate#}
{# physical, organizational, and electronic safeguards to prevent unauthorized use and will be#}
{# retained only for as long as needed to achieve the purposes stated above. BCBC may make personal#}
{# information available to others or to appropriate authorities without permission if the information#}
{# is used to take action during an emergency that threatens the life, health or security of an#}
{# individual. Information no longer required will be destroyed or erased. Upon application to the#}
{# Privacy Officer individuals may access their personal information held by BCBC unless the#}
{# information contains references to other individuals or cannot be disclosed for legal or security#}
{# reasons. BCBC commits to promptly correcting any inaccuracies. Complaints should be made in writing#}
{# to the Privacy Officer who will immediately acknowledge receipt and will respond to the complaint#}
{# within 30 days. Unresolved complaints may be taken to the federal Privacy Commissioner.</p>#}
{# <p>Contact BCBC’s Privacy Officer at:#}
{# <br>905 20th Street West Saskatoon, SK S7M 0Y5 or by:#}
{# <br>Email: <a href="mailto:bridgecitybicyclecoop@gmail.com">bridgecitybicyclecoop@gmail.com</a></p>#}
{# </div>#}
{# <div>#}
{# <h2 class="template__header mdl-typography--title">Membership and Privileges</h2>#}
{# <p>I acknowledge that my Membership and Privileges in the Bridge City Bicycle Co-operative is contingent#}
{# upon fulfilling the above responsibilities.</p>#}
{# <label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="{{ form.priveleges.id_for_label }}">#}
{# {{ form.priveleges }}#}
{# <span class="mdl-checkbox__label">{{ form.priveleges.label }}</span>#}
{# </label>#}
{# </div>#}
<div>
<button disabled 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-grid">
<div class="mdl-cell mdl-cell--12-col">
<button disabled id="submit" type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored">Submit</button>
</div>
</div>
</form>
</div>
{% endblock %}
{% endblock %}

1
bikeshop_project/webpack.dev.config.js

@ -3,7 +3,6 @@ const BundleTracker = require('webpack-bundle-tracker');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
require('babel-polyfill');
const config = require('./webpack.base.config.js');
// Use webpack dev server

Loading…
Cancel
Save