From 1cb673af538aeba6e77bf951d5bc223f17afb708 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Mon, 10 Jun 2019 13:17:00 -0400 Subject: [PATCH] Proper colors for TO statuses --- atst/models/task_order.py | 2 +- atst/routes/task_orders/index.py | 10 +++++++++- styles/elements/_labels.scss | 4 ++++ styles/sections/_task_order.scss | 3 +++ templates/portfolios/task_orders/index.html | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/atst/models/task_order.py b/atst/models/task_order.py index eda19ce1..1fc70da3 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -15,7 +15,7 @@ class Status(Enum): ACTIVE = "Active" UPCOMING = "Upcoming" EXPIRED = "Expired" - UNSIGNED = "Unsigned" + UNSIGNED = "Not signed" SORT_ORDERING = { diff --git a/atst/routes/task_orders/index.py b/atst/routes/task_orders/index.py index 1c85dab4..c62573f5 100644 --- a/atst/routes/task_orders/index.py +++ b/atst/routes/task_orders/index.py @@ -4,6 +4,7 @@ from . import task_orders_bp from atst.domain.authz.decorator import user_can_access_decorator as user_can from atst.domain.portfolios import Portfolios from atst.domain.task_orders import TaskOrders +from atst.models.task_order import Status from atst.models import Permissions @@ -32,4 +33,11 @@ def review_task_order(task_order_id): def portfolio_funding(portfolio_id): portfolio = Portfolios.get(g.current_user, portfolio_id) task_orders = TaskOrders.sort(portfolio.task_orders) - return render_template("portfolios/task_orders/index.html", task_orders=task_orders) + label_colors = { + Status.DRAFT: "warning", + Status.ACTIVE: "success", + Status.UPCOMING: "info", + Status.EXPIRED: "error", + Status.UNSIGNED: "purple" + } + return render_template("portfolios/task_orders/index.html", task_orders=task_orders, label_colors=label_colors) diff --git a/styles/elements/_labels.scss b/styles/elements/_labels.scss index d28ab484..15758fe2 100644 --- a/styles/elements/_labels.scss +++ b/styles/elements/_labels.scss @@ -33,4 +33,8 @@ &.label--success { background-color: $color-green; } + + &.label--purple { + background-color: $color-purple; + } } diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index 7a0186b4..dc97dfc1 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -73,6 +73,9 @@ .task-order-card .label { font-size: $small-font-size; margin-right: 2 * $gap; + min-width: 7rem; + display: flex; + justify-content: space-around; } .task-order-card__buttons .usa-button { diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index 598bbc5f..0e4c52b8 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -45,7 +45,7 @@ {% for task_order in task_orders %}
- {{ task_order.display_status }} + {{ task_order.display_status }} {{ TaskOrderDate(task_order) }}