Add row for total balance

This commit is contained in:
Patrick Smith 2019-01-15 17:57:26 -05:00
parent b2782c0b66
commit 26c898da0d
3 changed files with 18 additions and 0 deletions

View File

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

View File

@ -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;
}
}
}

View File

@ -125,6 +125,12 @@
{% if active_task_orders %}
{{ TaskOrderList(active_task_orders, label='success') }}
<div class='panel'>
<div class='panel__content portfolio-total-balance row'>
<span>{{ total_balance | dollars }}</span>
<span class='label label--success'>Total Active Balance</span>
</div>
</div>
{% endif %}
{% if expired_task_orders %}