Merge pull request #556 from dod-ccpo/navigate-to-form-review-page

Navigate to Task Order Form review page
This commit is contained in:
leigh-mil 2019-01-22 14:11:00 -05:00 committed by GitHub
commit b5ee92025f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 99 additions and 113 deletions

View File

@ -19,6 +19,14 @@ def dollars(value):
return "${:,.0f}".format(numberValue)
def dollarsWithCents(value):
try:
numberValue = float(value)
except ValueError:
numberValue = 0
return "${:,.2f}".format(numberValue)
def usPhone(number):
phone = re.sub(r"\D", "", number)
return "+1 ({}) {} - {}".format(phone[0:3], phone[3:6], phone[6:])
@ -113,6 +121,7 @@ def normalizeOrder(title):
def register_filters(app):
app.jinja_env.filters["iconSvg"] = iconSvg
app.jinja_env.filters["dollars"] = dollars
app.jinja_env.filters["dollarsWithCents"] = dollarsWithCents
app.jinja_env.filters["usPhone"] = usPhone
app.jinja_env.filters["readableInteger"] = readableInteger
app.jinja_env.filters["getOptionLabel"] = getOptionLabel

View File

@ -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(

View File

@ -18,56 +18,57 @@
{% endif %}
{% endmacro %}
{% if task_order.defense_component %}
{% set defense_component_description = task_order.defense_component | normalizeOrder %}
{% endif %}
{% macro ReviewField(heading, field, filter=None) %}
<div class="col col--grow">
<h4 class='task-order-form__heading'>{{ heading }}</h4>
{% if field %}
<p>{{ field | findFilter(filter) }}</p>
{% else %}
{{ RequiredLabel() }}
{% endif %}
{% if caller %}
{{ caller() }}
{% endif %}
</div>
{% endmacro %}
{% if task_order.app_migration %}
{% set app_migration_description = "forms.task_order.app_migration.{}".format(task_order.app_migration) | translate | removeHtml %}
{% endif %}
{% if task_order.native_apps %}
{% set native_apps_description = "task_orders.new.review.{}_native".format(task_order.native_apps) | translate %}
{% endif %}
{% if task_order.team_experience %}
{% set team_experience_description = "forms.task_order.team_experience.{}".format(task_order.team_experience) | translate %}
{% endif %}
{% 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 %}
<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_description or RequiredLabel() }}</p>
</div>
{{ ReviewField(("task_orders.new.review.portfolio" | translate), task_order.portfolio_name) }}
{{ ReviewField(("task_orders.new.review.dod" | translate), task_order.defense_component, filter="normalizeOrder") }}
</div>
<div class="row">
{{ ReviewField(("task_orders.new.review.scope" | translate), 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_description 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_description or RequiredLabel() }}</p>
</div>
{{ ReviewField(("forms.task_order.app_migration.label" | translate), ("forms.task_order.app_migration.{}".format(task_order.app_migration) | translate), filter="removeHtml") }}
{{ ReviewField(("forms.task_order.native_apps.label" | translate), ("forms.task_order.native_apps.{}".format(task_order.native_apps))| translate) }}
</div>
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.complexity"| translate }}</h4>
@ -95,7 +96,6 @@
{% else %}
{{ Icon('ok', classes='icon--gray icon--medium') }}{{ "forms.task_order.dev_team.{}".format(item) | translate }}
{% endif %}
</li>
{% endfor %}
</ul>
@ -104,10 +104,7 @@
{% endif %}
</div>
<div class="col col--grow">
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.experience"| translate }}</h4>
<p>{{ team_experience_description or RequiredLabel() }}</p>
</div>
{{ ReviewField(("forms.task_order.team_experience.label" |translate), ("forms.task_order.team_experience.{}".format(task_order.team_experience)) | translate) }}
</div>
<hr>
@ -115,22 +112,30 @@
<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>
{{ task_order.performance_length | translateDuration 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>
{% call ReviewField(("task_orders.new.review.performance_period" | translate), task_order.performance_length, filter="translateDuration") %}
<p><a href="#" class='icon-link icon-link--left' download>{{ Icon('download') }} {{ "task_orders.new.review.usage_est_link" | translate }}</a></p>
{% endcall %}
<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">{{ '${:,.2f}'.format(task_order.budget) }}</td>
<td class="table-cell--align-right">
{% if task_order.budget %}
{{ task_order.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">{{ '${:,.2f}'.format(task_order.clin_01) }}</td>
<td class="table-cell--align-right">
{% if task_order.clin_01 %}
{{ task_order.clin_01 | dollarsWithCents }}
{% else %}
{{ RequiredLabel() }}
{% endif %}
</td>
</tr>
<tr>
<td><h4 class="task-order-form__heading funding-summary__td{% if not config.CLASSIFIED %} inactive{% endif %}">
@ -140,27 +145,33 @@
{% endif %}
</h4></td>
<td class="table-cell--align-right">
{% if config.CLASSIFIED %}
{{ '${:,.2f}'.format(task_order.clin_02) }}
{% if task_order.clin_02 and config.CLASSIFIED %}
{{ task_order.clin_02 | 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">{{ '${:,.2f}'.format(task_order.clin_03) }}</td>
<td class="table-cell--align-right">
{% if task_order.clin_03 %}
{{ task_order.clin_03 | 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 config.CLASSIFIED %}
{{ '${:,.2f}'.format(task_order.clin_04) }}
{% endif %}
</td>
<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 task_order.clin_04 and config.CLASSIFIED %}
{{ task_order.clin_04 | dollarsWithCents or RequiredLabel() }}
{% endif %}
</td>
<tr>
</tbody>
</table>
@ -172,45 +183,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>
{{ task_order.ko_phone_number | usPhone }}<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>
{{ task_order.cor_phone_number | usPhone }}<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>
{{ task_order.so_phone_number | usPhone }}<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 %}
@ -222,5 +199,7 @@
{% endblock %}
{% block form_action %}
<form method='POST' action="{{ url_for('task_orders.invite', task_order_id=task_order_id) }}" autocomplete="off">
{% if task_order_id %}
<form method='POST' action="{{ url_for('task_orders.invite', task_order_id=task_order_id) }}" autocomplete="off">
{% endif %}
{% endblock %}

View File

@ -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)