Display TOs grouped by status

This commit is contained in:
leigh-mil
2019-12-04 17:01:22 -05:00
parent 2af99da9cf
commit e32bad0d30
7 changed files with 65 additions and 91 deletions

View File

@@ -28,14 +28,8 @@ def review_task_order(task_order_id):
@user_can(Permissions.VIEW_PORTFOLIO_FUNDING, message="view portfolio funding")
def portfolio_funding(portfolio_id):
portfolio = Portfolios.get(g.current_user, portfolio_id)
task_orders = TaskOrders.sort(portfolio.task_orders)
label_colors = {
TaskOrderStatus.DRAFT: "warning",
TaskOrderStatus.ACTIVE: "success",
TaskOrderStatus.UPCOMING: "info",
TaskOrderStatus.EXPIRED: "error",
TaskOrderStatus.UNSIGNED: "purple",
}
task_orders = TaskOrders.sort_by_status(portfolio.task_orders)
# TODO: Get expended amount from the CSP
return render_template(
"task_orders/index.html", task_orders=task_orders, label_colors=label_colors
"task_orders/index.html", task_orders=task_orders
)