-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TP2000-885 Use quota origins and exclusions to populate geo data in c…
…reate measure journey (#1032) * Refactor MeasureGeographicalAreaForm * Set up cleaned_data to use quota origins and exclusions * Conditionally show geo areas form * Update form tests * Update view tests * Add help text * Sort cleaned_data in test * Remove duplicate fixture * Simplify dictionary get * Use active origins only * Fix if statement
- Loading branch information
1 parent
e649a80
commit b19f556
Showing
7 changed files
with
237 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{% extends "measures/create-wizard-step.jinja" %} | ||
{% from "components/details/macro.njk" import govukDetails %} | ||
{% from "components/summary-list/macro.njk" import govukSummaryList %} | ||
|
||
{% block breadcrumb %} | ||
{% if request.path != "/" %} | ||
{{ breadcrumbs(request, [{"text": "Review the geographical areas"}]) }} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block page_title_heading %}Review the geographical areas{% endblock %} | ||
|
||
{% block form %} | ||
{% if order_number and origins_and_exclusions %} | ||
|
||
{{ govukDetails({ | ||
"summaryText": "What can I do if the geographical areas are incorrect?", | ||
"text": "The geographical areas are determined by the quota you entered on the previous page. If the geographical areas are incorrect, you will need to edit the quota. You will then need to re-enter the quota to reflect the changes." | ||
}) }} | ||
|
||
{% set row_data = [] %} | ||
{% for data in origins_and_exclusions %} | ||
{% set origin %} | ||
{{ data["origin"].area_id }} - {{ data["origin"].get_description().description }} | ||
{% endset %} | ||
|
||
{{ row_data.append({ | ||
"key": {"text": "Geographical area"}, | ||
"value": {"text": origin}, | ||
"actions": {"items": []} | ||
}) or "" }} | ||
|
||
{% if data.get("exclusions") %} | ||
{% set exclusions %} | ||
{% for exclusion in data["exclusions"] %} | ||
{{ exclusion.area_id }} - {{ exclusion.get_description().description }}{% if not loop.last %}, {% endif %} | ||
{% endfor %} | ||
{% endset %} | ||
|
||
{{ row_data.append({ | ||
"key": {"text": "Geographical area exclusions"}, | ||
"value": {"text": exclusions if data["exclusions"] else "-"}, | ||
"actions": {"items": []} | ||
}) or "" }} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{{ govukSummaryList({ | ||
"rows": row_data, | ||
})}} | ||
|
||
{{ govukButton({"text": "Continue"}) }} | ||
|
||
{% else %} | ||
{{ crispy(form) }} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.