From 3d879cf1bdf385802f1445db09a7fb80597d3a26 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Wed, 6 Mar 2019 17:04:52 -0500 Subject: [PATCH] set whether or not buttons for officers should be displayed in variables --- templates/portfolios/task_orders/show.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/templates/portfolios/task_orders/show.html b/templates/portfolios/task_orders/show.html index 0aaa4cd4..990f3589 100644 --- a/templates/portfolios/task_orders/show.html +++ b/templates/portfolios/task_orders/show.html @@ -6,6 +6,10 @@ {% block portfolio_content %} +{% set show_dd_254_button = is_so and to_form_complete %} +{% set show_to_info_button = (is_cor or is_ko) and to_form_complete %} +{% set show_sign_to_button = is_ko and dd_254_complete and not is_to_signed %} + {% macro officer_name(officer) -%} {%- if not officer -%} Not specified @@ -32,7 +36,7 @@
- {% if not task_order.is_active and complete and button_text and button_url %} + {% if not task_order.is_active and button_text and button_url %} @@ -136,8 +140,8 @@ }} {{ Step( - button_text=is_so and ("common.edit" | translate), - button_url=is_so and url_for("portfolios.so_review", portfolio_id=portfolio.id, task_order_id=task_order.id), + button_text=show_dd_254_button and ("common.edit" | translate), + button_url=show_dd_254_button and url_for("portfolios.so_review", portfolio_id=portfolio.id, task_order_id=task_order.id), complete=dd_254_complete, description="task_orders.view.steps.security" | translate({ "security_officer": officer_name(task_order.security_officer) @@ -149,12 +153,12 @@ "contracting_officer": officer_name(task_order.contracting_officer), "contracting_officer_representative": officer_name(task_order.contracting_officer_representative) }) | safe, - button_url=url_for( + button_url=show_to_info_button and url_for( "portfolios.ko_review", portfolio_id=portfolio.id, task_order_id=task_order.id, ), - button_text=(is_cor or is_ko) and ("common.edit" | translate), + button_text=show_to_info_button and ("common.edit" | translate), complete=False) %}
@@ -166,8 +170,8 @@ {% endcall %} {{ Step( - button_text=is_ko and not is_to_signed and ("common.sign" | translate), - button_url=is_ko and url_for( + button_text=show_sign_to_button and ("common.sign" | translate), + button_url=show_sign_to_button and url_for( "portfolios.ko_review", portfolio_id=portfolio.id, task_order_id=task_order.id,