Browse Source

Merge pull request #22 from BridgeCityBicycleCoop/feature/add-asterix-to-required-fields

Add asterisk to required fields on membership form.
feature/python-error-tracking
Drew Larson 8 years ago
committed by GitHub
parent
commit
8f3c316596
  1. 4
      Dockerfile-webpack
  2. 2
      bikeshop_project/bikeshop/settings/base.py
  3. 6
      bikeshop_project/registration/models.py
  4. 6
      bikeshop_project/registration/templates/member_form.html

4
Dockerfile-webpack

@ -1,9 +1,9 @@
FROM node:7.3.0
RUN mkdir /code
WORKDIR /code
ADD ./bikeshop_project /code
ADD ./bikeshop_project/package.json package.json
RUN npm install
RUN npm install -g bower
COPY ./bower.json .
ADD ./bikeshop_project/bower.json bower.json
RUN bower install --allow-root
EXPOSE 3000:3000

2
bikeshop_project/bikeshop/settings/base.py

@ -143,7 +143,7 @@ WEBPACK_LOADER = {
'DEFAULT': {
'CACHE': False,
'BUNDLE_DIR_NAME': 'bundles/', # must end with slash
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'),
'STATS_FILE': os.path.join(BASE_DIR, '../webpack-stats.json'),
'POLL_INTERVAL': 0.1,
'IGNORE': ['.+\.hot-update.js', '.+\.map']
}

6
bikeshop_project/registration/models.py

@ -79,9 +79,9 @@ class Member(models.Model):
null=True,
blank=True,
)
email_consent = models.BooleanField(default=False)
first_name = models.CharField(max_length=255, null=False)
last_name = models.CharField(max_length=255, null=False)
email_consent = models.BooleanField(default=False, blank=False)
first_name = models.CharField(max_length=255, null=False, blank=False)
last_name = models.CharField(max_length=255, null=False, blank=False)
preferred_name = models.CharField(max_length=255, null=True, blank=True)
date_of_birth = models.DateField(null=True, blank=True)
guardian_name = models.CharField(max_length=255, null=True, blank=True)

6
bikeshop_project/registration/templates/member_form.html

@ -97,7 +97,7 @@
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.first_name.errors %}is-invalid{% endif %}">
{{ form.first_name }}
<label class="mdl-textfield__label" for="{{ form.first_name.id_for_label }}">{{ form.first_name.label }}</label>
<label class="mdl-textfield__label" for="{{ form.first_name.id_for_label }}">{{ form.first_name.label }}{% if form.first_name.field.required %} <sup>*</sup>{% endif %}</label>
{% if form.first_name.errors %}
<span class="mdl-textfield__error">{{ form.first_name.errors }}</span>
{% else %}
@ -106,7 +106,7 @@
</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>
<label class="mdl-textfield__label" for="{{ form.last_name.id_for_label }}">{{ form.last_name.label }}{% if form.last_name.field.required %} <sup>*</sup>{% endif %}</label>
{% if form.last_name.errors %}
<span class="mdl-textfield__error">{{ form.last_name.errors }}</span>
{% else %}
@ -151,7 +151,7 @@
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.post_code.errors %}is-invalid{% endif %}">
{{ form.post_code }}
<label class="mdl-textfield__label" for="{{ form.post_code.id_for_label }}">{{ form.post_code.label }}</label>
<label class="mdl-textfield__label" for="{{ form.post_code.id_for_label }}">{{ form.post_code.label }}{% if form.post_code.field.required %} <sup>*</sup>{% endif %}</label>
{% if form.post_code.errors %}
<span class="mdl-textfield__error">{{ form.post_code.errors }}</span>
{% else %}

Loading…
Cancel
Save