From 95c07ff1f49e2dac9ac0b995247654e71b57288b Mon Sep 17 00:00:00 2001 From: Luis Cielak Date: Mon, 30 Jul 2018 10:43:32 -0400 Subject: [PATCH] Add read-only fields for poc and org details --- atst/forms/org.py | 32 ++--- atst/forms/poc.py | 8 +- templates/requests/screen-4.html.to | 212 ++++++++++++++++++++-------- templates/requests_new.html.to | 40 +++--- 4 files changed, 194 insertions(+), 98 deletions(-) diff --git a/atst/forms/org.py b/atst/forms/org.py index ade4859b..b2bad0ee 100644 --- a/atst/forms/org.py +++ b/atst/forms/org.py @@ -10,27 +10,27 @@ from .validators import DateRange, PhoneNumber, Alphabet class OrgForm(ValidatedForm): fname_request = StringField( "First Name", - # validators=[Required(), Alphabet()] + validators=[Required(), Alphabet()] ) lname_request = StringField( "Last Name", - # validators=[Required(), Alphabet()] + validators=[Required(), Alphabet()] ) email_request = EmailField( "Email Address", - # validators=[Required(), Email()] + validators=[Required(), Email()] ) phone_number = TelField( "Phone Number", - # validators=[Required(), PhoneNumber()] + validators=[Required(), PhoneNumber()] ) service_branch = StringField( "Service Branch or Agency", - # validators=[Required()] + validators=[Required()] ) citizenship = RadioField( @@ -39,7 +39,7 @@ class OrgForm(ValidatedForm): ("Foreign National", "Foreign National"), ("Other", "Other"), ], - # validators=[Required()], + validators=[Required()], ) designation = RadioField( @@ -49,17 +49,17 @@ class OrgForm(ValidatedForm): ("civilian", "Civilian"), ("contractor", "Contractor"), ], - # validators=[Required()], + validators=[Required()], ) date_latest_training = DateField( - "Latest Information Assurance (IA) Training completion date.", - # validators=[ - # Required(), - # DateRange( - # lower_bound=pendulum.duration(years=1), - # upper_bound=pendulum.duration(days=0), - # message="Must be a date within the last year.", - # ), - # ], + "Latest Information Assurance (IA) Training completion date", + validators=[ + Required(), + DateRange( + lower_bound=pendulum.duration(years=1), + upper_bound=pendulum.duration(days=0), + message="Must be a date within the last year.", + ), + ], ) diff --git a/atst/forms/poc.py b/atst/forms/poc.py index 7d5388f2..48ab749b 100644 --- a/atst/forms/poc.py +++ b/atst/forms/poc.py @@ -8,20 +8,20 @@ from .validators import IsNumber, Alphabet class POCForm(ValidatedForm): fname_poc = StringField( "POC First Name", - # validators=[Required(), Alphabet()] + validators=[Required(), Alphabet()] ) lname_poc = StringField( "POC Last Name", - # validators=[Required(), Alphabet()] + validators=[Required(), Alphabet()] ) email_poc = EmailField( "POC Email Address", - # validators=[Required(), Email()] + validators=[Required(), Email()] ) dodid_poc = StringField( "DOD ID", - # validators=[Required(), Length(min=10), IsNumber()] + validators=[Required(), Length(min=10), IsNumber()] ) diff --git a/templates/requests/screen-4.html.to b/templates/requests/screen-4.html.to index 50760b7d..a1bec13b 100644 --- a/templates/requests/screen-4.html.to +++ b/templates/requests/screen-4.html.to @@ -1,86 +1,182 @@ {% extends '../requests_new.html.to' %} {% block subtitle %} -

Review & Submit

+

Review & Submit

{% end %} {% block form_action %} -
-{% end %} + + {% end %} -{% block form %} + {% block form %} -{% autoescape None %} -{% if f.errors %} -There were some errors, see below. -{% end %} + {% autoescape None %} + {% if f.errors %} + There were some errors, see below. + {% end %} -

Before you can submit your request, please take a moment to review the information entered in the form. You may make changes by clicking the edit link on each section. When all information looks right, go ahead and submit.

+

Before you can submit your request, please take a moment to review the information entered in the form. You may make changes by clicking the edit link on each section. When all information looks right, go ahead and submit.

+ +

Details of Use Edit

+ +
+
DoD Component
+
{{data['details_of_use']['dod_component']}}
+
+ +
+
JEDI Usage
+
{{data['details_of_use']['jedi_usage']}}
+
+ +
+
Number of software systems
+
{{data['details_of_use']['num_software_systems']}}
+
+ +
+
JEDI Migration
+
{{data['details_of_use']['jedi_migration']}}
+
+ +
+
Rationalization of Software Systems
+
{{data['details_of_use']['rationalization_software_systems']}}
+
+ +
+
Technical Support Team
+
{{data['details_of_use']['technical_support_team']}}
+
+ +
+
Organization Providing Assistance
+
{{data['details_of_use']['organization_providing_assistance']}}
+
+ +
+
Engineering Assessment
+
{{data['details_of_use']['engineering_assessment']}}
+
+ +
+
Data Transfers
+
{{data['details_of_use']['data_transfers']}}
+
+ +
+
Expected Completion Date
+
{{data['details_of_use']['expected_completion_date']}}
+
+ +
+
Cloud Native
+
{{data['details_of_use']['cloud_native']}}
+
+ +
+
Estimated Monthly Spend
+
{{data['details_of_use']['estimated_monthly_spend']}}
+
+ +
+
Total Spend
+
{{data['details_of_use']['total_spend']}}
+
+ +
+
Number of User Sessions
+
{{data['details_of_use']['number_user_sessions']}}
+
+ +
+
Average Daily Traffic
+
{{data['details_of_use']['average_daily_traffic']}}
+
+ +
+
Start Date
+
{{data['details_of_use']['start_date']}}
+
+

Information About You Edit

-

Details of Use Edit

+
+
First Name
+
{{data['information_about_you']['fname_request']}}
+
+ +
+
Last Name
+
{{data['information_about_you']['lname_request']}}
+
+ +
+
Email Address
+
{{data['information_about_you']['email_request']}}
+
+ +
+
Phone Number
+
{{data['information_about_you']['phone_number']}}
+
+ +
+
Service Branch or Agency
+
{{data['information_about_you']['service_branch']}}
+
+ +
+
Citizenship
+
{{data['information_about_you']['citizenship']}}
+
+ +
+
Designation of Person
+
{{data['information_about_you']['designation']}}
+
+ +
+
Latest Information Assurance (IA) Training completion date
+
{{data['information_about_you']['date_latest_training']}}
+
- -{{data['details_of_use']['dod_component']}} +

Primary Point of Contact Edit

- -{{data['details_of_use']['jedi_usage']}} +
+
POC First Name
+
+
- -{{data['details_of_use']['num_software_systems']}} - - -{{data['details_of_use']['jedi_migration']}} - - -{{data['details_of_use']['rationalization_software_systems']}} - - -{{data['details_of_use']['technical_support_team']}} - - -{{data['details_of_use']['organization_providing_assistance']}} - - -{{data['details_of_use']['engineering_assessment']}} - - -{{data['details_of_use']['data_transfers']}} - - -{{data['details_of_use']['expected_completion_date']}} - - -{{data['details_of_use']['cloud_native']}} - - -{{data['details_of_use']['estimated_monthly_spend']}} - - -{{data['details_of_use']['total_spend']}} - - -{{data['details_of_use']['number_user_sessions']}} - - -{{data['details_of_use']['average_daily_traffic']}} - - -{{data['details_of_use']['start_date']}} - -
+
+
POC Last Name
+
+
+
+
POC Email Address
+
+
+
+
DOD ID
+
+
+fname_poc +lname_poc +email_poc +dodid_poc +
{% end %} {% block next %} {% if not can_submit %} - Please complete all required fields before submitting. +Please complete all required fields before submitting. {% end %} {% end %} diff --git a/templates/requests_new.html.to b/templates/requests_new.html.to index 8cd9194a..c38a036c 100644 --- a/templates/requests_new.html.to +++ b/templates/requests_new.html.to @@ -8,30 +8,30 @@
-
-
-

New Request

-
{% block subtitle %}{% end %}
-
+
+

New Request

+
{% block subtitle %}{% end %}
+
- {% block form_action %} - {% if request_id %} -
- {% else %} - - {% end %} +
+ {% block form_action %} + {% if request_id %} + + {% else %} + {% end %} + {% end %} - {% module xsrf_form_html() %} - {% block form %} - form goes here - {% end %} - {% block next %} - - {% end %} - + {% module xsrf_form_html() %} + {% block form %} + form goes here + {% end %} + {% block next %} + + {% end %} + -
+