From c31fb78a47b8e18f2cb2504209bd8ae8b4d19726 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Thu, 29 Aug 2019 12:51:20 -0400 Subject: [PATCH] Require fields in user profile form --- templates/components/phone_input.html | 6 +++--- templates/fragments/edit_user_form.html | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/components/phone_input.html b/templates/components/phone_input.html index 62a1c18a..74200436 100644 --- a/templates/components/phone_input.html +++ b/templates/components/phone_input.html @@ -1,12 +1,12 @@ {% from "components/text_input.html" import TextInput %} -{% macro PhoneInput(phone_number, phone_ext, placeholder_phone="") %} +{% macro PhoneInput(phone_number, phone_ext, placeholder_phone="", phone_optional=True, extension_optional=True) %}
- {{ TextInput(phone_number, placeholder=placeholder_phone, validation='usPhone') }} + {{ TextInput(phone_number, placeholder=placeholder_phone, validation='usPhone', optional=phone_optional) }}
- {{ TextInput(phone_ext, validation='phoneExt')}} + {{ TextInput(phone_ext, validation='phoneExt', optional=extension_optional) }}
{%- endmacro %} diff --git a/templates/fragments/edit_user_form.html b/templates/fragments/edit_user_form.html index 56f61b80..473b8d3f 100644 --- a/templates/fragments/edit_user_form.html +++ b/templates/fragments/edit_user_form.html @@ -11,16 +11,16 @@
- {{ TextInput(form.first_name, validation='requiredField') }} + {{ TextInput(form.first_name, validation='requiredField', optional=False) }}
- {{ TextInput(form.last_name, validation='requiredField') }} + {{ TextInput(form.last_name, validation='requiredField', optional=False) }}
- {{ TextInput(form.email, validation='email') }} - {{ PhoneInput(form.phone_number, form.phone_ext) }} + {{ TextInput(form.email, validation='email', optional=False) }} + {{ PhoneInput(form.phone_number, form.phone_ext, phone_optional=False) }} {{ OptionsInput(form.service_branch) }} {{ OptionsInput(form.citizenship) }}