From e25f519243040797d06540ced134460bc03b476d Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Mon, 23 Dec 2019 11:44:53 -0500 Subject: [PATCH] Change TO fragment to a macro to make it reusable in the builder and view page, final tweaks to review and view pages --- templates/task_orders/builder_base.html | 2 +- .../fragments/task_order_view.html | 162 +++++++++--------- templates/task_orders/step_1.html | 1 + templates/task_orders/step_2.html | 1 + templates/task_orders/step_3.html | 1 + templates/task_orders/step_4.html | 7 +- templates/task_orders/step_5.html | 1 + templates/task_orders/view.html | 3 +- translations.yaml | 3 +- 9 files changed, 97 insertions(+), 84 deletions(-) diff --git a/templates/task_orders/builder_base.html b/templates/task_orders/builder_base.html index 70bc20c9..f5b88c3a 100644 --- a/templates/task_orders/builder_base.html +++ b/templates/task_orders/builder_base.html @@ -9,7 +9,7 @@ {{ form.csrf_token }} {{ StickyCTA( - text='task_orders.form.sticky_header_text' | translate, + text=sticky_cta_text, context=('task_orders.form.sticky_header_context' | translate({"step": step}) )) }} {% call Modal(name='cancel', dismissable=True) %} diff --git a/templates/task_orders/fragments/task_order_view.html b/templates/task_orders/fragments/task_order_view.html index 70d4c385..08e4b718 100644 --- a/templates/task_orders/fragments/task_order_view.html +++ b/templates/task_orders/fragments/task_order_view.html @@ -2,86 +2,90 @@ {% from "components/semi_collapsible_text.html" import SemiCollapsibleText %} {% from "components/tooltip.html" import Tooltip %} +{% macro TaskOrderView(task_order, portfolio, builder_mode=False) %} + {% set obligated_funds = task_order.total_obligated_funds %} + {% set contract_amount = task_order.total_contract_amount %} + {% set expended_funds = task_order.invoiced_funds %} -{% set obligated_funds = task_order.total_obligated_funds %} -{% set contract_amount = task_order.total_contract_amount %} -{% set expended_funds = task_order.invoiced_funds %} - -
-
-
-

- Total obligated funds - {{ Tooltip(("task_orders.review.tooltip.obligated_funds" | translate), title="", classes="reporting-summary-item__header-icon") }} -

-

- {{ obligated_funds | dollars }} -

-
-
-

- Total Task Order value - {{ Tooltip(("task_orders.review.tooltip.total_value" | translate), title="", classes="reporting-summary-item__header-icon") }} -

- {% set earliest_pop_start_date, latest_pop_end_date = portfolio.funding_duration %} - {% if earliest_pop_start_date and latest_pop_end_date %} +
+
+
+

+ Total obligated funds + {{ Tooltip(("task_orders.review.tooltip.obligated_funds" | translate), title="", classes="reporting-summary-item__header-icon") }} +

- {{ contract_amount | dollars }} + {{ obligated_funds | dollars }}

- {% else %} -

-

- {% endif %} -
-
-

- Total expended funds - {{ Tooltip(("task_orders.review.tooltip.expended_funds" | translate), title="", classes="reporting-summary-item__header-icon") }} -

-

- {{ expended_funds | dollars }} -

-
-
-
-
-

Documents

- -
-
-
-

CLIN summary

- - - - - - - - - - - + +
+

+ Total Task Order value + {{ Tooltip(("task_orders.review.tooltip.total_value" | translate), title="", classes="reporting-summary-item__header-icon") }} +

+ {% set earliest_pop_start_date, latest_pop_end_date = portfolio.funding_duration %} + {% if earliest_pop_start_date and latest_pop_end_date %} +

+ {{ contract_amount | dollars }} +

+ {% else %} +

-

+ {% endif %} +
+
+

+ Total expended funds + {{ Tooltip(("task_orders.review.tooltip.expended_funds" | translate), title="", classes="reporting-summary-item__header-icon") }} +

+

+ {{ expended_funds | dollars }} +

+
+ +
+
+

Documents

+
+ {% if builder_mode %} + {{ Icon('ok', classes="icon--green icon--medium") }} + {% endif %} + + {{ task_order.pdf.filename }} + {{ Icon('link', classes="icon--primary icon--medium") }} + +
+
+
+
+

CLIN summary

+
{{ "task_orders.review.clins.number" | translate }}{{ "task_orders.review.clins.type" | translate }}{{ "task_orders.review.clins.idiq_clin_description" | translate }}{{ "task_orders.review.clins.pop" | translate }}{{ "task_orders.review.clins.total_amount" | translate }}{{ "task_orders.review.clins.obligated" | translate }}
+ + + + + + + + + + - - {% for clin in task_order.sorted_clins %} - - - - - - {# TODO: Swap in total CLIN amount #} - - - - {% endfor %} - -
{{ "task_orders.review.clins.number" | translate }}{{ "task_orders.review.clins.type" | translate }}{{ "task_orders.review.clins.idiq_clin_description" | translate }}{{ "task_orders.review.clins.pop" | translate }}{{ "task_orders.review.clins.total_amount" | translate }}{{ "task_orders.review.clins.obligated" | translate }}
{{ clin.number }}{{ clin.type }}{{ "{}".format(clin.jedi_clin_type) | translate}} - {{ clin.start_date | formattedDate }} - {{ clin.end_date | formattedDate }} - {{ clin.total_amount | dollars }}{{ clin.obligated_amount | dollars }}
-
-
+ + {% for clin in task_order.sorted_clins %} + + {{ clin.number }} + {{ clin.type }} + {{ "{}".format(clin.jedi_clin_type) | translate}} + + {{ clin.start_date | formattedDate }} - {{ clin.end_date | formattedDate }} + + {# TODO: Swap in total CLIN amount #} + {{ clin.total_amount | dollars }} + {{ clin.obligated_amount | dollars }} + + {% endfor %} + + +
+
+{% endmacro %} diff --git a/templates/task_orders/step_1.html b/templates/task_orders/step_1.html index 59e88a89..59c0df70 100644 --- a/templates/task_orders/step_1.html +++ b/templates/task_orders/step_1.html @@ -12,6 +12,7 @@ {% set next_button_text = "Next: Add TO Number" %} {% set step = "1" %} +{% set sticky_cta_text = 'task_orders.form.sticky_header_text' | translate %} {% block to_builder_form_field %} {{ TOFormStepHeader( diff --git a/templates/task_orders/step_2.html b/templates/task_orders/step_2.html index 86e9bf5b..1a5b0c42 100644 --- a/templates/task_orders/step_2.html +++ b/templates/task_orders/step_2.html @@ -7,6 +7,7 @@ {% set next_button_text = "Next: Add Base CLIN" %} {% set previous_button_link = url_for("task_orders.form_step_one_add_pdf", task_order_id=task_order_id) %} {% set step = "2" %} +{% set sticky_cta_text = 'task_orders.form.sticky_header_text' | translate %} {% block to_builder_form_field %} {{ TOFormStepHeader( diff --git a/templates/task_orders/step_3.html b/templates/task_orders/step_3.html index e5c96581..b1788b51 100644 --- a/templates/task_orders/step_3.html +++ b/templates/task_orders/step_3.html @@ -8,6 +8,7 @@ {% set next_button_text = "task_orders.form.step_3.next_button" | translate %} {% set previous_button_link = url_for("task_orders.form_step_two_add_number", task_order_id=task_order_id) %} {% set step = "3" %} +{% set sticky_cta_text = 'task_orders.form.sticky_header_text' | translate %} {% block to_builder_form_field %} diff --git a/templates/task_orders/step_4.html b/templates/task_orders/step_4.html index c76c0c73..c862ad94 100644 --- a/templates/task_orders/step_4.html +++ b/templates/task_orders/step_4.html @@ -1,17 +1,20 @@ {% extends "task_orders/builder_base.html" %} +{% from "task_orders/fragments/task_order_view.html" import TaskOrderView %} + {% set action = url_for('task_orders.form_step_five_confirm_signature', task_order_id=task_order_id) %} {% set previous_button_link = url_for("task_orders.form_step_three_add_clins", task_order_id=task_order_id) %} {% set step = "4" %} +{% set sticky_cta_text = 'task_orders.form.sticky_header_review_text' | translate %} {% block next_button %} - Next: Submit Task Order + Next: Confirm {% endblock %} {% block to_builder_form_field %} - {% include "task_orders/fragments/task_order_view.html" %} + {{ TaskOrderView(task_order, portfolio, builder_mode=True) }} {% endblock %} diff --git a/templates/task_orders/step_5.html b/templates/task_orders/step_5.html index 1b998ad9..ac40993a 100644 --- a/templates/task_orders/step_5.html +++ b/templates/task_orders/step_5.html @@ -8,6 +8,7 @@ {% set next_button_text = 'task_orders.form.step_5.next_button' | translate %} {% set previous_button_link = url_for("task_orders.form_step_four_review", task_order_id=task_order_id) %} {% set step = "5" %} +{% set sticky_cta_text = 'task_orders.form.sticky_header_text' | translate %} {% block to_builder_form_field %} {{ TOFormStepHeader( diff --git a/templates/task_orders/view.html b/templates/task_orders/view.html index 0681dfae..e5662472 100644 --- a/templates/task_orders/view.html +++ b/templates/task_orders/view.html @@ -1,4 +1,5 @@ {% from "components/sticky_cta.html" import StickyCTA %} +{% from "task_orders/fragments/task_order_view.html" import TaskOrderView %} {% extends 'portfolios/base.html' %} @@ -11,6 +12,6 @@ {% endcall %}
- {% include "task_orders/fragments/task_order_view.html" %} + {{ TaskOrderView(task_order, portfolio) }}
{% endblock %} diff --git a/translations.yaml b/translations.yaml index d14a378b..e25078a6 100644 --- a/translations.yaml +++ b/translations.yaml @@ -531,7 +531,8 @@ task_orders: description: Prior to submitting the Task Order, you must acknowledge, by marking the appropriate box below, that the uploaded Task Order is signed by an appropriate, duly warranted Contracting Officer who has the authority to execute the uploaded Task Order on your Agency’s behalf and has authorized you to upload the Task Order in accordance with Agency policy and procedures. You must further acknowledge, by marking the appropriate box below, that all information entered herein matches that of the submitted Task Order. alert_message: All task orders require a Contracting Officer signature. next_button: 'Confirm & Submit' - sticky_header_text: 'Add Task Order' + sticky_header_text: 'Add a Task Order' + sticky_header_review_text: Review Changes sticky_header_context: 'Step {step} of 5' empty_state: header: Add approved task orders