From 967a9b8411422a6109071a3ac2edd63cbb8ff572 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Tue, 31 May 2016 09:21:06 -0600 Subject: [PATCH] Add `Payment` to `Membership`. --- bikeshop_project/core/forms.py | 13 ++- .../core/templates/membership_form.html | 85 +++++++++++-------- bikeshop_project/core/views.py | 19 +++-- 3 files changed, 72 insertions(+), 45 deletions(-) diff --git a/bikeshop_project/core/forms.py b/bikeshop_project/core/forms.py index de016a7..2fce3f8 100644 --- a/bikeshop_project/core/forms.py +++ b/bikeshop_project/core/forms.py @@ -1,9 +1,9 @@ import logging -from django.forms import BooleanField, CharField, CheckboxInput, RadioSelect, ModelForm, TextInput, HiddenInput +from django.forms import BooleanField, CharField, CheckboxInput, RadioSelect, ModelForm, TextInput, HiddenInput, ChoiceField from registration.models import Member -from .models import Membership +from .models import Membership, Payment logger = logging.getLogger('bikeshop') @@ -66,3 +66,12 @@ class MembershipForm(ModelForm): instance.save() return instance + + +class PaymentForm(ModelForm): + class Meta: + model = Payment + fields = ['type'] + widgets = { + 'type': RadioSelect(attrs={'class': 'mdl-radio__button'}) + } diff --git a/bikeshop_project/core/templates/membership_form.html b/bikeshop_project/core/templates/membership_form.html index 3028d45..df5d49a 100644 --- a/bikeshop_project/core/templates/membership_form.html +++ b/bikeshop_project/core/templates/membership_form.html @@ -9,8 +9,9 @@

New Membership

+ {% csrf_token %} - {{ form.member }} + {{ membership_form.member }}

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

@@ -20,9 +21,9 @@
  • Opportunity to engage in decisions and help to build and develop the community's vision
  • The 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. As such, collected information will be used in accordance with our privacy policy outlined on our website and in our shop.
  • - {% if form.non_field_errors %} + {% if membership_form.non_field_errors %}
    - {{ form.errors }} + {{ membership_form.errors }}
    {% endif %}
    @@ -35,8 +36,8 @@
  • 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
  • -
    @@ -46,8 +47,8 @@
  • Build positive relationships with Community Members
  • Build positive relationships with CNYC employees, volunteers, and patrons
  • -
    @@ -56,8 +57,8 @@

    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)

    -