Add review route and template

This commit is contained in:
leigh-mil 2019-07-16 13:43:36 -04:00
parent b2db53096f
commit 68e0d261f6
4 changed files with 135 additions and 1 deletions

View File

@ -115,7 +115,7 @@ def add_clins(task_order_id):
@user_can(Permissions.CREATE_TASK_ORDER, message="view new task order form")
def update_clins(task_order_id):
form_data = {**http_request.form}
next_page = "task_orders.review_task_order"
next_page = "task_orders.review"
current_template = "task_orders/step_3.html"
return update_task_order(
@ -123,6 +123,14 @@ def update_clins(task_order_id):
)
@task_orders_bp.route("/task_orders/<task_order_id>/step_4")
@user_can(Permissions.CREATE_TASK_ORDER, message="view new task order form")
def review(task_order_id):
return render_task_orders_edit(
"task_orders/step_4.html", task_order_id=task_order_id
)
@task_orders_bp.route("/portfolios/<portfolio_id>/task_orders/new")
@task_orders_bp.route("/task_orders/<task_order_id>/edit")
@user_can(Permissions.CREATE_TASK_ORDER, message="view new task order form")

View File

@ -2,6 +2,7 @@
{% from 'components/date_picker.html' import DatePicker %}
{% from 'components/icon.html' import Icon %}
{% from 'components/options_input.html' import OptionsInput %}
{% from "components/sticky_cta.html" import StickyCTA %}
{% from 'components/text_input.html' import TextInput %}

View File

@ -0,0 +1,119 @@
{% extends "portfolios/base.html" %}
{% from "components/icon.html" import Icon %}
{% from "components/semi_collapsible_text.html" import SemiCollapsibleText %}
{% from "components/sticky_cta.html" import StickyCTA %}
{% from "components/totals_box.html" import TotalsBox %}
{% block portfolio_content %}
{% set action = url_for("task_orders.update_number", task_order_id=task_order_id) %}
<div id="upload-to-pdf" action='{{ action }}' method="POST" autocomplete="off" enctype="multipart/form-data">
{{ form.csrf_token }}
{% call StickyCTA(text=('task_orders.form.sticky_header_text' | translate )) %}
<span class="action-group">
<a
href="{{ url_for('task_orders.add_pdf', task_order_id=task_order_id)}}"
class="usa-button usa-button-primary">
Next: Submit Task Order
</a>
<input
type="button"
class="usa-button usa-button-secondary"
tabindex="0"
value="Previous"
form="upload-to-pdf"/>
<a
href="{{ cancel_url }}"
class="action-group__action icon-link">
{{ "common.cancel" | translate }}
</a>
</span>
{% endcall %}
{% include "fragments/flash.html" %}
<div class="task-order">
{{ SemiCollapsibleText() }}
<hr>
<div class="h1">
{{ "task_orders.review.review_your_task_order" | translate }}
</div>
<p>
{{ "task_orders.review.check_paragraph" | translate }}
</p>
<div class="row">
<div class="col task-order__details">
<div class="h4">
{{ "task_orders.review.task_order_number" | translate }}
</div>
<div>{{task_order.number}}</div>
<hr>
<div class="h3">
{{ "task_orders.review.funding_summary" | translate }}
</div>
{% for clin in task_order.clins %}
<div>
{{ "{}".format(clin.jedi_clin_type) | translate}}
</div>
<table class="fixed-table-wrapper">
<thead>
<tr>
<th>{{ "task_orders.review.clins.amount" | translate }}</th>
<th>{{ "task_orders.review.clins.obligated" | translate }}</th>
<th>{{ "task_orders.review.clins.pop_start" | translate }}</th>
<th>{{ "task_orders.review.clins.pop_end" | translate }}</th>
<th>{{ "task_orders.review.clins.loa" | translate }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ clin.obligated_amount | dollars }}</td>
<td>
{% if clin.is_obligated() %}
{{ "common.yes" | translate }}
{% else %}
{{ "common.no" | translate }}
{% endif %}
</td>
<td>{{ clin.start_date | formattedDate }}</td>
<td>{{ clin.end_date | formattedDate }}</td>
<td>
{% for loa in clin.loas %}
<span title='{{ loa }}'>
{{ loa }}
</span>
<br />
{% endfor %}
</td>
</tr>
</tbody>
</table>
{% endfor %}
<hr>
<div class="h3">
{{ "task_orders.review.supporting_document.title" | translate }}
</div>
<div class="h4">
<a class="icon-link icon-link--download" href="{{ url_for('task_orders.download_task_order_pdf', task_order_id=task_order.id) }}">
{{ Icon('check-circle-solid') }}
{{ task_order.pdf.filename }}
</a>
</div>
</div>
{{ TotalsBox(task_order=task_order) }}
</div>
</div>
</div>
{% endblock %}

View File

@ -101,6 +101,12 @@ def test_task_orders_update_clins(client, user_session, task_order):
assert len(task_order.clins) == 2
def test_task_orders_review(client, user_session, task_order):
user_session(task_order.creator)
response = client.get(url_for("task_orders.review", task_order_id=task_order.id))
assert response.status_code == 200
def test_task_orders_new_flow():
pass