Create macros for displaying form fields on review page
This commit is contained in:
parent
635c301db4
commit
b7d101c1fa
@ -45,8 +45,8 @@ class AppInfoForm(CacheableForm):
|
||||
default="",
|
||||
)
|
||||
native_apps = RadioField(
|
||||
translate("forms.task_order.native_apps_label"),
|
||||
description=translate("forms.task_order.native_apps_description"),
|
||||
translate("forms.task_order.native_apps.label"),
|
||||
description=translate("forms.task_order.native_apps.description"),
|
||||
choices=[("yes", "Yes"), ("no", "No"), ("not_sure", "Not Sure")],
|
||||
)
|
||||
complexity = SelectMultipleField(
|
||||
|
119
templates/task_orders/new/_review_fields.html
Normal file
119
templates/task_orders/new/_review_fields.html
Normal file
@ -0,0 +1,119 @@
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/required_label.html" import RequiredLabel %}
|
||||
|
||||
{% macro ReviewTextField(heading, field, filter=None) %}
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ heading | translate }}</h4>
|
||||
{% if field %}
|
||||
<p>{{ field | findFilter(filter) }}</p>
|
||||
{% else %}
|
||||
{{ RequiredLabel() }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro ReviewTextFieldWithDownload(heading, field, url, link_text, filter=None) %}
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ heading | translate }}</h4>
|
||||
{% if field %}
|
||||
<p>{{ field | findFilter(filter) }}</p>
|
||||
{% else %}
|
||||
{{ RequiredLabel() }}
|
||||
{% endif %}
|
||||
<p><a href="{{ url }}" class='icon-link icon-link--left' download>{{ Icon('download') }} {{ link_text | translate }}</a></p>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro ReviewSelectField(heading, field, filter=None) %}
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "{}.label".format(heading) | translate }}</h4>
|
||||
{% if field %}
|
||||
<p>{{ "{}.{}".format(heading, field) | translate | findFilter(filter) }}</p>
|
||||
{% else %}
|
||||
{{ RequiredLabel() }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro ReviewTOValueTable(budget, clin_1, clin_2, clin_3, clin_4) %}
|
||||
<div class="col col--grow">
|
||||
<table class="funding-summary__table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><h4>{{ "task_orders.new.review.to_value"| translate }}</h4></td>
|
||||
<td class="table-cell--align-right">
|
||||
{% if budget %}
|
||||
{{ budget | dollarsWithCents }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4 class='task-order-form__heading funding-summary__td'>{{ "task_orders.new.review.clin_1"| translate }}</h4></td>
|
||||
<td class="table-cell--align-right">
|
||||
{% if clin_1 %}
|
||||
{{ clin_1 | dollarsWithCents }}
|
||||
{% else %}
|
||||
{{ RequiredLabel() }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4 class="task-order-form__heading funding-summary__td{% if not config.CLASSIFIED %} inactive{% endif %}">
|
||||
{{ "task_orders.new.review.clin_2"| translate }}
|
||||
{% if not config.CLASSIFIED %}
|
||||
<div>{{ "task_orders.new.review.classified_inactive"| translate }}</div>
|
||||
{% endif %}
|
||||
</h4></td>
|
||||
<td class="table-cell--align-right">
|
||||
{% if clin_2 and config.CLASSIFIED %}
|
||||
{{ clin_2 | dollarsWithCents or RequiredLabel() }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4 class='task-order-form__heading funding-summary__td'>{{ "task_orders.new.review.clin_3"| translate }}</h4></td>
|
||||
<td class="table-cell--align-right">
|
||||
{% if clin_3 %}
|
||||
{{ clin_3 | dollarsWithCents or RequiredLabel() }}
|
||||
{% else %}
|
||||
{{ RequiredLabel() }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4 class="task-order-form__heading funding-summary__td{% if not config.CLASSIFIED %} inactive{% endif %}">
|
||||
{{ "task_orders.new.review.clin_4"| translate }}
|
||||
{% if not config.CLASSIFIED %}
|
||||
<div>{{ "task_orders.new.review.classified_inactive"| translate }}</div>
|
||||
{% endif %}
|
||||
</h4></td>
|
||||
<td class="table-cell--align-right">
|
||||
{% if clin_4 and config.CLASSIFIED %}
|
||||
{{ clin_4 | dollarsWithCents or RequiredLabel() }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro ReviewOfficerInfo(heading, first_name, last_name, email, phone_number, dod_id, invite) %}
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ heading | translate }}</h4>
|
||||
{{ first_name }} {{ last_name }}<br>
|
||||
{{ email }}<br>
|
||||
{% if phone_number %}
|
||||
{{ phone_number | usPhone }}
|
||||
{% else %}
|
||||
{{ RequiredLabel() }}
|
||||
{% endif %}
|
||||
<br>
|
||||
{{ "task_orders.new.review.dod_id" | translate }} {{ dod_id}}<br>
|
||||
{% if invite %}
|
||||
{{ Icon('ok', classes='icon--green') }} <span class="task-order-invite-message sent">{{ "task_orders.new.review.invited"| translate }}</<span>
|
||||
{% else %}
|
||||
{{ Icon('alert', classes='icon--red') }} <span class="task-order-invite-message not-sent">{{ "task_orders.new.review.not_invited"| translate }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
@ -3,6 +3,7 @@
|
||||
{% from "components/edit_link.html" import EditLink %}
|
||||
{% from "components/required_label.html" import RequiredLabel %}
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "task_orders/new/_review_fields.html" import ReviewTextField, ReviewTextFieldWithDownload, ReviewSelectField, ReviewTOValueTable, ReviewOfficerInfo %}
|
||||
|
||||
{% block heading %}
|
||||
{{ "task_orders.new.review.section_title"| translate }}
|
||||
@ -18,92 +19,23 @@
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% if task_order.defense_component %}
|
||||
{% set defense_component = task_order.defense_component | normalizeOrder %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.app_migration %}
|
||||
{% set app_migration = "forms.task_order.app_migration.{}".format(task_order.app_migration) | translate | removeHtml %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.native_apps %}
|
||||
{% set native_apps = "task_orders.new.review.{}_native".format(task_order.native_apps) | translate %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.team_experience %}
|
||||
{% set team_experience = "forms.task_order.team_experience.{}".format(task_order.team_experience) | translate %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.performance_period %}
|
||||
{% set performance_length = task_order.performance_length | translateDuration %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.budget %}
|
||||
{% set budget = task_order.budget | dollarsWithCents %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.clin_01 %}
|
||||
{% set clin_01 = task_order.clin_01 | dollarsWithCents %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.clin_02 %}
|
||||
{% set clin_02 = task_order.clin_02 | dollarsWithCents %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.clin_03 %}
|
||||
{% set clin_03 = task_order.clin_03 | dollarsWithCents %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.clin_04 %}
|
||||
{% set clin_04 = task_order.clin_04 | dollarsWithCents %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.ko_phone_number %}
|
||||
{% set ko_phone_number = task_order.ko_phone_number | usPhone %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.cor_phone_number %}
|
||||
{% set cor_phone_number = task_order.cor_phone_number | usPhone %}
|
||||
{% endif %}
|
||||
|
||||
{% if task_order.so_phone_number %}
|
||||
{% set so_phone_number = task_order.so_phone_number | usPhone %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<h3 class="subheading">{{ "task_orders.new.review.app_info"| translate }} {{ TOEditLink(screen=1) }}</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.portfolio"| translate }}</h4>
|
||||
<p>{{ task_order.portfolio_name or RequiredLabel() }}</p>
|
||||
</div>
|
||||
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.dod"| translate }}</h4>
|
||||
<p>{{ defense_component or RequiredLabel() }}</p>
|
||||
</div>
|
||||
{{ ReviewTextField("task_orders.new.review.portfolio", task_order.portfolio_name) }}
|
||||
{{ ReviewTextField("task_orders.new.review.dod", task_order.defense_component, filter="normalizeOrder") }}
|
||||
</div>
|
||||
<div class="row">
|
||||
{{ ReviewTextField("task_orders.new.review.scope", task_order.scope) }}
|
||||
</div>
|
||||
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.scope"| translate }}</h4>
|
||||
<p>
|
||||
{{ task_order.scope or RequiredLabel() }}
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3 class="subheading">{{ "task_orders.new.review.reporting"| translate }} {{ TOEditLink(screen=1, anchor="reporting") }}</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.migration"| translate }}</h4>
|
||||
<p>{{ app_migration or RequiredLabel() }}</p>
|
||||
</div>
|
||||
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.native_apps"| translate }}</h4>
|
||||
<p>{{ native_apps or RequiredLabel() }}</p>
|
||||
</div>
|
||||
{{ ReviewSelectField("forms.task_order.app_migration", task_order.app_migration, filter="removeHtml") }}
|
||||
{{ ReviewSelectField("forms.task_order.native_apps", task_order.native_apps) }}
|
||||
</div>
|
||||
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.complexity"| translate }}</h4>
|
||||
@ -131,7 +63,6 @@
|
||||
{% else %}
|
||||
{{ Icon('ok', classes='icon--gray icon--medium') }}{{ "forms.task_order.dev_team.{}".format(item) | translate }}
|
||||
{% endif %}
|
||||
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@ -140,10 +71,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.experience"| translate }}</h4>
|
||||
<p>{{ team_experience or RequiredLabel() }}</p>
|
||||
</div>
|
||||
{{ ReviewSelectField("forms.task_order.team_experience", task_order.team_experience) }}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -151,56 +79,8 @@
|
||||
<h3 class="subheading">{{ "task_orders.new.review.funding"| translate }} {{ TOEditLink(screen=2) }}</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.performance_period"| translate }}</h4>
|
||||
{{ performance_length or RequiredLabel() }}
|
||||
<p><a href="#" class='icon-link icon-link--left' download>{{ Icon('download') }} {{ "task_orders.new.review.usage_est_link"| translate }}</a></p>
|
||||
</div>
|
||||
|
||||
<div class="col col--grow">
|
||||
<table class="funding-summary__table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><h4>{{ "task_orders.new.review.to_value"| translate }}</h4></td>
|
||||
<td class="table-cell--align-right">{{ budget or RequiredLabel() }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4 class='task-order-form__heading funding-summary__td'>{{ "task_orders.new.review.clin_1"| translate }}</h4></td>
|
||||
<td class="table-cell--align-right">{{ clin_1 or RequiredLabel() }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4 class="task-order-form__heading funding-summary__td{% if not config.CLASSIFIED %} inactive{% endif %}">
|
||||
{{ "task_orders.new.review.clin_2"| translate }}
|
||||
{% if not config.CLASSIFIED %}
|
||||
<div>{{ "task_orders.new.review.classified_inactive"| translate }}</div>
|
||||
{% endif %}
|
||||
</h4></td>
|
||||
<td class="table-cell--align-right">
|
||||
{% if config.CLASSIFIED %}
|
||||
{{ clin_02 or RequiredLabel() }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4 class='task-order-form__heading funding-summary__td'>{{ "task_orders.new.review.clin_3"| translate }}</h4></td>
|
||||
<td class="table-cell--align-right">{{ clin_03 or RequiredLabel() }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4 class="task-order-form__heading funding-summary__td{% if not config.CLASSIFIED %} inactive{% endif %}">
|
||||
{{ "task_orders.new.review.clin_4"| translate }}
|
||||
{% if not config.CLASSIFIED %}
|
||||
<div>{{ "task_orders.new.review.classified_inactive"| translate }}</div>
|
||||
{% endif %}
|
||||
</h4></td>
|
||||
<td class="table-cell--align-right">
|
||||
{% if config.CLASSIFIED %}
|
||||
{{ clin_04 or RequiredLabel() }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ ReviewTextFieldWithDownload("task_orders.new.review.performance_period", task_order.performance_length, url="#", link_text="task_orders.new.review.usage_est_link", filter="translateDuration") }}
|
||||
{{ ReviewTOValueTable(task_order.budget, task_order.clin_01, task_order.clin_02, task_order.clin_03, task_order.clin_04) }}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -208,45 +88,11 @@
|
||||
<h3 class="subheading">{{ "task_orders.new.review.oversight"| translate }} {{ TOEditLink(screen=3) }}</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.ko"| translate }}</h4>
|
||||
{{ task_order.ko_first_name }} {{ task_order.ko_last_name }}<br>
|
||||
{{ task_order.ko_email }}<br>
|
||||
{{ ko_phone_number or RequiredLabel() }}<br>
|
||||
{{ "task_orders.new.review.dod_id"| translate }} {{ task_order.ko_dod_id}}<br>
|
||||
{% if task_order.ko_invite %}
|
||||
{{ Icon('ok', classes='icon--green') }} <span class="task-order-invite-message sent">{{ "task_orders.new.review.invited"| translate }}</<span>
|
||||
{% else %}
|
||||
{{ Icon('alert', classes='icon--red') }} <span class="task-order-invite-message not-sent">{{ "task_orders.new.review.not_invited"| translate }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.cor"| translate }}</h4>
|
||||
{{ task_order.cor_first_name }} {{ task_order.cor_last_name }}<br>
|
||||
{{ task_order.cor_email }}<br>
|
||||
{{ cor_phone_number or RequiredLabel() }}<br>
|
||||
{{ "task_orders.new.review.dod_id"| translate }} {{ task_order.cor_dod_id}}<br>
|
||||
{% if task_order.cor_invite %}
|
||||
{{ Icon('ok', classes='icon--green') }} <span class="task-order-invite-message sent">{{ "task_orders.new.review.invited"| translate }}</<span>
|
||||
{% else %}
|
||||
{{ Icon('alert', classes='icon--red') }} <span class="task-order-invite-message not-sent">{{ "task_orders.new.review.not_invited"| translate }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ ReviewOfficerInfo("task_orders.new.review.ko", task_order.ko_first_name, task_order.ko_last_name, task_order.ko_email, task_order.ko_phone_number, task_order.ko_dod_id, task_order.ko_invite) }}
|
||||
{{ ReviewOfficerInfo("task_orders.new.review.cor", task_order.cor_first_name, task_order.cor_last_name, task_order.cor_email, task_order.cor_phone_number, task_order.cor_dod_id, task_order.cor_invite) }}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col col--grow">
|
||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.so"| translate }}</h4>
|
||||
{{ task_order.so_first_name }} {{ task_order.so_last_name }}<br>
|
||||
{{ task_order.so_email }}<br>
|
||||
{{ so_phone_number or RequiredLabel() }}<br>
|
||||
{{ "task_orders.new.review.dod_id"| translate }} {{ task_order.so_dod_id}}<br>
|
||||
{% if task_order.so_invite %}
|
||||
{{ Icon('ok', classes='icon--green') }} <span class="task-order-invite-message sent">{{ "task_orders.new.review.invited"| translate }}</<span>
|
||||
{% else %}
|
||||
{{ Icon('alert', classes='icon--red') }} <span class="task-order-invite-message not-sent">{{ "task_orders.new.review.not_invited"| translate }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ ReviewOfficerInfo("task_orders.new.review.so", task_order.so_first_name, task_order.so_last_name, task_order.so_email, task_order.so_phone_number, task_order.so_dod_id, task_order.so_invite) }}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -177,8 +177,12 @@ forms:
|
||||
both: Yes, migrating from an <strong>on-premise data center</strong> and <strong>another cloud provider</strong>
|
||||
none: Not planning to migrate any applications
|
||||
not_sure: "Not Sure"
|
||||
native_apps_label: Native Apps
|
||||
native_apps_description: Do you plan to develop application(s) natively in the cloud?
|
||||
native_apps:
|
||||
label: Native Apps
|
||||
description: Do you plan to develop application(s) natively in the cloud?
|
||||
'yes': Yes, planning to develop natively in the cloud
|
||||
'no': No, not planning to develop natively in the cloud
|
||||
not_sure: Not sure, unsure if planning to develop natively in the cloud
|
||||
complexity:
|
||||
label: Project Complexity
|
||||
description: Which of these describes how complex your team's use of the cloud will be? Select all that apply.
|
||||
@ -414,14 +418,8 @@ task_orders:
|
||||
dod: DoD Component
|
||||
scope: Scope (Statement of Work)
|
||||
reporting: Reporting
|
||||
migration: App Migration
|
||||
native_apps: Native Apps
|
||||
yes_native: Yes, planning to develop natively in the cloud
|
||||
no_native: No, not planning to develop natively in the cloud
|
||||
not_sure_native: Not sure, unsure if planning to develop natively in the cloud
|
||||
complexity: Project Complexity
|
||||
team: Development Team
|
||||
experience: Team Experience
|
||||
funding: Funding
|
||||
performance_period: Period of Performance length
|
||||
usage_est_link: View Usage Estimate
|
||||
@ -429,7 +427,7 @@ task_orders:
|
||||
clin_1: 'CLIN #1: Unclassified Cloud'
|
||||
clin_2: 'CLIN #2: Classified Cloud'
|
||||
clin_3: 'CLIN #3: Unclassified Cloud'
|
||||
clin_4: 'CLIN $4: Classified Cloud'
|
||||
clin_4: 'CLIN #4: Classified Cloud'
|
||||
classified_inactive: (Available Soon)
|
||||
oversight: Oversight
|
||||
ko: Contracting Officer (KO)
|
||||
|
Loading…
x
Reference in New Issue
Block a user