From 26c898da0de295b92e9dc33be82bbbe06dd7c95c Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Tue, 15 Jan 2019 17:57:26 -0500 Subject: [PATCH] Add row for total balance --- atst/routes/portfolios/task_orders.py | 2 ++ styles/components/_portfolio_layout.scss | 10 ++++++++++ templates/portfolios/task_orders/index.html | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/atst/routes/portfolios/task_orders.py b/atst/routes/portfolios/task_orders.py index d5c6b78f..9155c4f0 100644 --- a/atst/routes/portfolios/task_orders.py +++ b/atst/routes/portfolios/task_orders.py @@ -41,6 +41,7 @@ def portfolio_task_orders(portfolio_id): if active_task_orders else None ) + total_balance = sum([task_order["balance"] for task_order in active_task_orders]) return render_template( "portfolios/task_orders/index.html", @@ -49,6 +50,7 @@ def portfolio_task_orders(portfolio_id): active_task_orders=active_task_orders, expired_task_orders=task_orders_by_status.get(TaskOrderStatus.EXPIRED, []), funding_end_date=funding_end_date, + total_balance=total_balance, ) diff --git a/styles/components/_portfolio_layout.scss b/styles/components/_portfolio_layout.scss index ca546914..853efc4c 100644 --- a/styles/components/_portfolio_layout.scss +++ b/styles/components/_portfolio_layout.scss @@ -83,4 +83,14 @@ .view-task-order-link { margin-left: $gap * 2; } + + .portfolio-total-balance { + flex-direction: row-reverse; + margin: 2 * $gap 0; + padding-right: 14rem; + + .label { + margin: 0 2 * $gap; + } + } } diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index ea5ad818..52172327 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -125,6 +125,12 @@ {% if active_task_orders %} {{ TaskOrderList(active_task_orders, label='success') }} +
+
+ {{ total_balance | dollars }} + Total Active Balance +
+
{% endif %} {% if expired_task_orders %}