From 804855d4bca35cfd51ab450f7b41a2a780663942 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Tue, 4 Jun 2019 16:05:10 -0400 Subject: [PATCH 01/18] Working on Task Order card --- styles/core/_variables.scss | 1 + styles/sections/_task_order.scss | 32 +++++++++++++++++++++ templates/portfolios/task_orders/index.html | 13 +++++++++ 3 files changed, 46 insertions(+) diff --git a/styles/core/_variables.scss b/styles/core/_variables.scss index 4463f1bd..c9b36104 100644 --- a/styles/core/_variables.scss +++ b/styles/core/_variables.scss @@ -165,6 +165,7 @@ $checkbox-border-radius: 2px; $border-radius: 3px; $button-border-radius: 5px; $box-shadow: 0px 2px 5px 0px $color-shadow; +$box-shadow-big: 0 4px 10px 0 rgba(193,193,193,0.5); $focus-outline: 2px dotted $color-gray-light; $focus-spacing: 3px; $nav-width: 300px; diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index bdcaf40e..fa275d34 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -572,3 +572,35 @@ } } } + +.card { + width: 100%; + box-shadow: $box-shadow-big; + padding: ($gap * 2) ($gap * 2.5) ($gap * 4) ($gap * 3); + margin-bottom: 20px; + + .card__status { + margin-bottom: $gap * 2; + display: flex; + align-items: baseline; + } + + .card__header { + + } + + .card__body { + font-size: $small-font-size; + color: $color-gray-medium; + } +} + +.card { + .label { + margin-left: 0; + } + + .datetime { + font-size: $small-font-size; + } +} diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index 59c0a3f8..469367f6 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -14,6 +14,19 @@ {% endmacro %} {% macro TaskOrderList(task_orders, label='success', expired=False, funded=False) %} +
+
+ Pending + Started May 21, 2019 +
+
+

Task Order #12345

+
+
+ This is a TO description. This is a TO description. This is a TO description. This is a TO description. This is a TO description. This is a TO description. +
+
+ Date: Tue, 4 Jun 2019 16:52:54 -0400 Subject: [PATCH 02/18] Try using new styles in the task orders page --- atst/filters.py | 5 + atst/routes/task_orders/index.py | 26 +--- templates/portfolios/task_orders/index.html | 130 +++++--------------- 3 files changed, 39 insertions(+), 122 deletions(-) diff --git a/atst/filters.py b/atst/filters.py index 02d51c5c..e6104ea5 100644 --- a/atst/filters.py +++ b/atst/filters.py @@ -82,6 +82,10 @@ def normalizeOrder(title): return " ".join(reordered_text) +def task_order_status_label(status): + return {"Pending": "warning", "Active": "success", "Expired": "error"}.get(status, "info") + + def register_filters(app): app.jinja_env.filters["iconSvg"] = iconSvg app.jinja_env.filters["dollars"] = dollars @@ -95,6 +99,7 @@ def register_filters(app): app.jinja_env.filters["renderAuditEvent"] = renderAuditEvent app.jinja_env.filters["normalizeOrder"] = normalizeOrder app.jinja_env.filters["translateDuration"] = translate_duration + app.jinja_env.filters["taskOrderStatusLabel"] = task_order_status_label @contextfilter def translateWithoutCache(context, *kwargs): diff --git a/atst/routes/task_orders/index.py b/atst/routes/task_orders/index.py index db42109d..6b440ea6 100644 --- a/atst/routes/task_orders/index.py +++ b/atst/routes/task_orders/index.py @@ -30,22 +30,6 @@ def review_task_order(task_order_id): return render_template("portfolios/task_orders/review.html", task_order=task_order) -def serialize_task_order(task_order): - return { - key: getattr(task_order, key) - for key in [ - "id", - "budget", - "time_created", - "start_date", - "end_date", - "display_status", - "days_to_expiration", - "balance", - ] - } - - @task_orders_bp.route("/portfolios//task_orders") @user_can(Permissions.VIEW_PORTFOLIO_FUNDING, message="view portfolio funding") def portfolio_funding(portfolio_id): @@ -53,14 +37,9 @@ def portfolio_funding(portfolio_id): task_orders_by_status = defaultdict(list) for task_order in portfolio.task_orders: - serialized_task_order = serialize_task_order(task_order) - serialized_task_order["url"] = url_for( - "task_orders.view_task_order", task_order_id=task_order.id - ) - task_orders_by_status[task_order.status].append(serialized_task_order) + task_orders_by_status[task_order.status].append(task_order) active_task_orders = task_orders_by_status.get(TaskOrderStatus.ACTIVE, []) - total_balance = sum([task_order["balance"] for task_order in active_task_orders]) return render_template( "portfolios/task_orders/index.html", @@ -69,6 +48,5 @@ def portfolio_funding(portfolio_id): + task_orders_by_status.get(TaskOrderStatus.PENDING, []) ), active_task_orders=active_task_orders, - expired_task_orders=task_orders_by_status.get(TaskOrderStatus.EXPIRED, []), - total_balance=total_balance, + expired_task_orders=task_orders_by_status.get(TaskOrderStatus.EXPIRED, []) ) diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index 469367f6..f3e6470f 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -13,93 +13,37 @@ {% endmacro %} -{% macro TaskOrderList(task_orders, label='success', expired=False, funded=False) %} -
-
- Pending - Started May 21, 2019 -
-
-

Task Order #12345

-
-
- This is a TO description. This is a TO description. This is a TO description. This is a TO description. This is a TO description. This is a TO description. -
-
+{% macro TaskOrderDate(task_order) %} + + {% if task_order.is_active %} + Began {{ task_order.start_date }}   |   Ends {{ task_order.end_date }} + {% elif task_order.is_expired %} + Started {{ task_order.start_date }}   |   Ended {{ task_order.end_date }} + {% else %} + Started {{ task_order.start_date }} + {% endif %} + +{% endmacro %} - -
- - - - - - - - - - - - - - - - {{ caller and caller() }} - -
- !{ col.displayName } - -
- !{ taskOrder.display_status } - - - - - - - - - - {{ Icon('ok') }} Period ending in !{ taskOrder.days_to_expiration } days, but new period funded - - - {{ Icon('alert') }} Period ends in !{ taskOrder.days_to_expiration } days, submit a new task order - - - - - - - - - View - {{ Icon("caret_right", classes="icon--tiny") }} - -
-
-
+{% macro TaskOrderList(task_orders) %} +
+ {% for task_order in task_orders %} +
+
+ {{ task_order.display_status }} + {{ TaskOrderDate(task_order) }} + + +
+
+

Task Order {{ task_order.number }}

+
+
+ This is a TO description. This is a TO description. This is a TO description. This is a TO description. This is a TO description. This is a TO description. +
+
+ {% endfor %} +
{% endmacro %}
@@ -144,21 +88,11 @@ {% endif %} {% if active_task_orders %} -
Active
- {% call TaskOrderList(active_task_orders, label='success', funded=funded) %} - - - Total Active Balance - {{ total_balance | dollars }} - -   - - {% endcall %} + {{ TaskOrderList(active_task_orders) }} {% endif %} {% if expired_task_orders %} -
Expired
- {{ TaskOrderList(expired_task_orders, label='expired', expired=True) }} + {{ TaskOrderList(expired_task_orders) }} {% endif %}
From cefa4f90990de9b067c7623b66e83a5c38176d1c Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 11:02:01 -0400 Subject: [PATCH 03/18] Remove Portfolio header line, decrease margin --- styles/components/_portfolio_layout.scss | 4 ++-- templates/portfolios/base.html | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/styles/components/_portfolio_layout.scss b/styles/components/_portfolio_layout.scss index 3416aa08..825bec45 100644 --- a/styles/components/_portfolio_layout.scss +++ b/styles/components/_portfolio_layout.scss @@ -20,7 +20,7 @@ flex-direction: row; } - margin-bottom: $gap * 4; + margin-bottom: $gap * 1; .col--grow { overflow: inherit; @@ -127,7 +127,7 @@ } .portfolio-content { - margin: 6 * $gap $gap 0 $gap; + margin: 1 * $gap $gap 0 $gap; .panel { @include shadow-panel; diff --git a/templates/portfolios/base.html b/templates/portfolios/base.html index 127200c3..685c7057 100644 --- a/templates/portfolios/base.html +++ b/templates/portfolios/base.html @@ -7,7 +7,6 @@ {% block portfolio_header %} {% include "portfolios/header.html" %} {% endblock %} -
{% block portfolio_content %}{% endblock %}
From c9674255d1f70bd8c1898d644b88da2e2a0c4962 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 11:12:38 -0400 Subject: [PATCH 04/18] Display all task orders in the same list --- atst/filters.py | 5 --- atst/models/task_order.py | 3 +- templates/portfolios/task_orders/index.html | 36 +++++---------------- 3 files changed, 10 insertions(+), 34 deletions(-) diff --git a/atst/filters.py b/atst/filters.py index e6104ea5..02d51c5c 100644 --- a/atst/filters.py +++ b/atst/filters.py @@ -82,10 +82,6 @@ def normalizeOrder(title): return " ".join(reordered_text) -def task_order_status_label(status): - return {"Pending": "warning", "Active": "success", "Expired": "error"}.get(status, "info") - - def register_filters(app): app.jinja_env.filters["iconSvg"] = iconSvg app.jinja_env.filters["dollars"] = dollars @@ -99,7 +95,6 @@ def register_filters(app): app.jinja_env.filters["renderAuditEvent"] = renderAuditEvent app.jinja_env.filters["normalizeOrder"] = normalizeOrder app.jinja_env.filters["translateDuration"] = translate_duration - app.jinja_env.filters["taskOrderStatusLabel"] = task_order_status_label @contextfilter def translateWithoutCache(context, *kwargs): diff --git a/atst/models/task_order.py b/atst/models/task_order.py index 049b7d85..bd53b219 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -1,5 +1,6 @@ from enum import Enum from datetime import date +import random from sqlalchemy import Column, DateTime, ForeignKey, String from sqlalchemy.ext.hybrid import hybrid_property @@ -66,7 +67,7 @@ class TaskOrder(Base, mixins.TimestampsMixin): def status(self): # TODO: fix task order -- implement correctly using CLINs # Faked for display purposes - return Status.ACTIVE + return random.choice(list(Status.__members__.values())) @property def start_date(self): diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index f3e6470f..ab8637e0 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -25,12 +25,12 @@ {% endmacro %} -{% macro TaskOrderList(task_orders) %} +{% macro TaskOrderList(task_orders, label='success') %}
{% for task_order in task_orders %}
- {{ task_order.display_status }} + {{ task_order.display_status }} {{ TaskOrderDate(task_order) }} @@ -54,30 +54,6 @@
{% endcall %} - {% for task_order in pending_task_orders %} -
- Pending -
-
- Pending -
-
Started
-
- - -
-
-
-
Value
-
{{ task_order.budget | dollars }}
-
- {{ ViewLink(task_order) }} -
- {% endfor %} - - {% if not active_task_orders and not pending_task_orders %} {{ EmptyState( 'This portfolio doesn’t have any active or pending task orders.', @@ -87,12 +63,16 @@ ) }} {% endif %} + {% if pending_task_orders %} + {{ TaskOrderList(pending_task_orders, label='warning') }} + {% endif %} + {% if active_task_orders %} - {{ TaskOrderList(active_task_orders) }} + {{ TaskOrderList(active_task_orders, label='success') }} {% endif %} {% if expired_task_orders %} - {{ TaskOrderList(expired_task_orders) }} + {{ TaskOrderList(expired_task_orders, label='error') }} {% endif %}
From 2de8f64645ed89da30ec3950b5c3cc6592ceb094 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 11:30:04 -0400 Subject: [PATCH 05/18] More variety in fake TO statuses --- atst/models/task_order.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atst/models/task_order.py b/atst/models/task_order.py index bd53b219..c8e9948d 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -67,7 +67,9 @@ class TaskOrder(Base, mixins.TimestampsMixin): def status(self): # TODO: fix task order -- implement correctly using CLINs # Faked for display purposes - return random.choice(list(Status.__members__.values())) + possible_statuses = list(Status.__members__.values()) + index = self.time_created.microsecond % len(possible_statuses) + return possible_statuses[index] @property def start_date(self): From e2dad0b56faf731ab0b5e8b426149a15028f8d51 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 11:30:29 -0400 Subject: [PATCH 06/18] Use proper timestamp format --- templates/portfolios/task_orders/index.html | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index ab8637e0..ef042edc 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -13,18 +13,32 @@ {% endmacro %} +{% macro TaskOrderDateTime(dt, className="") %} + +{% endmacro %} + {% macro TaskOrderDate(task_order) %} {% if task_order.is_active %} - Began {{ task_order.start_date }}   |   Ends {{ task_order.end_date }} + Began {{ TaskOrderDateTime(task_order.start_date) }}   |   Ends {{ TaskOrderDateTime(task_order.end_date) }} {% elif task_order.is_expired %} - Started {{ task_order.start_date }}   |   Ended {{ task_order.end_date }} + Started {{ TaskOrderDateTime(task_order.start_date) }}   |   Ended {{ TaskOrderDateTime(task_order.end_date) }} {% else %} - Started {{ task_order.start_date }} + Started {{ TaskOrderDateTime(task_order.start_date) }} {% endif %} {% endmacro %} + +{% macro TaskOrderActions(task_order) %} +
+ {% if task_order.is_active %} + {% elif task_order.is_expired %} + {% else %} + {% endif %} +
+{% endmacro %} + {% macro TaskOrderList(task_orders, label='success') %}
{% for task_order in task_orders %} From 667bc3b3c90e6d3a4a10df15516dee2ae3d15005 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 11:55:36 -0400 Subject: [PATCH 07/18] Add task order action buttons --- styles/sections/_task_order.scss | 9 +++++++++ templates/portfolios/task_orders/index.html | 18 +++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index fa275d34..03f80fdb 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -66,6 +66,10 @@ } } +.task-order-card__action { + min-width: 10rem; +} + .task-order-summary { margin: $gap * 4; @@ -583,6 +587,11 @@ margin-bottom: $gap * 2; display: flex; align-items: baseline; + justify-content: space-around; + + .card__status-spacer { + flex-grow: 10; + } } .card__header { diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index ef042edc..05234096 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -6,10 +6,9 @@ {% block portfolio_content %} -{% macro ViewLink(task_order) %} - - View - {{ Icon("caret_right", classes="icon--tiny") }} +{% macro ViewLink(task_order, text="Edit", className="usa-button-primary") %} + + {{ text }} {% endmacro %} @@ -29,12 +28,15 @@ {% endmacro %} - {% macro TaskOrderActions(task_order) %}
- {% if task_order.is_active %} - {% elif task_order.is_expired %} + {% if task_order.is_pending %} + {{ ViewLink(task_order, text="Edit") }} + {% elif task_order.is_active %} + {{ ViewLink(task_order, text="Add Funding", className="usa-button-secondary") }} + {{ ViewLink(task_order, text="Modify") }} {% else %} + {{ ViewLink(task_order, text="View") }} {% endif %}
{% endmacro %} @@ -46,7 +48,9 @@
{{ task_order.display_status }} {{ TaskOrderDate(task_order) }} + + {{ TaskOrderActions(task_order) }}
From 5aa95f60d4b9879415d1e512d5dae0596c191b82 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 12:07:15 -0400 Subject: [PATCH 08/18] Only one action for each task order --- styles/sections/_task_order.scss | 2 +- templates/portfolios/task_orders/index.html | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index 03f80fdb..49b361fb 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -66,7 +66,7 @@ } } -.task-order-card__action { +.task-order-card__buttons .usa-button { min-width: 10rem; } diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index 05234096..8cc5ad4c 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -6,8 +6,8 @@ {% block portfolio_content %} -{% macro ViewLink(task_order, text="Edit", className="usa-button-primary") %} - +{% macro ViewLink(task_order, text="Edit") %} + {{ text }} {% endmacro %} @@ -29,11 +29,10 @@ {% endmacro %} {% macro TaskOrderActions(task_order) %} -
+
{% if task_order.is_pending %} {{ ViewLink(task_order, text="Edit") }} {% elif task_order.is_active %} - {{ ViewLink(task_order, text="Add Funding", className="usa-button-secondary") }} {{ ViewLink(task_order, text="Modify") }} {% else %} {{ ViewLink(task_order, text="View") }} @@ -44,7 +43,7 @@ {% macro TaskOrderList(task_orders, label='success') %}
{% for task_order in task_orders %} -
+
{{ task_order.display_status }} {{ TaskOrderDate(task_order) }} From 1e25c1608cf1801bbb6d763efd2d536bfc951201 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 12:23:46 -0400 Subject: [PATCH 09/18] Reduce left padding --- styles/components/_portfolio_layout.scss | 2 +- styles/components/_sticky_cta.scss | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/styles/components/_portfolio_layout.scss b/styles/components/_portfolio_layout.scss index 825bec45..90b06034 100644 --- a/styles/components/_portfolio_layout.scss +++ b/styles/components/_portfolio_layout.scss @@ -373,7 +373,7 @@ } .portfolio-funding { - padding: 2 * $gap; + padding: (2 * $gap) 0; .panel { @include shadow-panel; diff --git a/styles/components/_sticky_cta.scss b/styles/components/_sticky_cta.scss index d4619c76..14057ac1 100644 --- a/styles/components/_sticky_cta.scss +++ b/styles/components/_sticky_cta.scss @@ -4,12 +4,12 @@ } @include media($medium-screen) { - margin-left: -$gap * 7; + margin-left: -$gap * 5; } } .sticky-cta.js-is-sticky { - width: 78.5%; + width: 80.8%; } .sticky-cta-container { From cbcd8456386692122ec9d7a24d1b5e840cfd9edb Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 12:23:55 -0400 Subject: [PATCH 10/18] Update CTA button copy --- templates/portfolios/task_orders/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index 8cc5ad4c..f7a87808 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -67,7 +67,7 @@ {% call StickyCTA(text="Funding") %} {% endcall %} From 241495cb8ff6f40faba895ed730fc1319304ba5d Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 12:31:41 -0400 Subject: [PATCH 11/18] Spacing tweaks --- styles/sections/_task_order.scss | 9 +++++++++ templates/portfolios/task_orders/index.html | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index 49b361fb..d13934f4 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -66,6 +66,15 @@ } } +.task-order-list { + margin-top: 6 * $gap; +} + +.task-order-card .label { + font-size: $small-font-size; + margin-right: 2 * $gap; +} + .task-order-card__buttons .usa-button { min-width: 10rem; } diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index f7a87808..5ea017de 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -41,7 +41,7 @@ {% endmacro %} {% macro TaskOrderList(task_orders, label='success') %} -
+
{% for task_order in task_orders %}
From e3f21543107ae4ea4af824956dbd18f93e078541 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 12:41:16 -0400 Subject: [PATCH 12/18] Extract card element --- styles/atat.scss | 1 + styles/elements/_card.scss | 34 +++++++++++++++++++++++++++++ styles/sections/_task_order.scss | 37 -------------------------------- 3 files changed, 35 insertions(+), 37 deletions(-) create mode 100644 styles/elements/_card.scss diff --git a/styles/atat.scss b/styles/atat.scss index 3f745e78..5d41ed96 100644 --- a/styles/atat.scss +++ b/styles/atat.scss @@ -22,6 +22,7 @@ @import "elements/kpi"; @import "elements/graphs"; @import "elements/menu"; +@import "elements/card"; @import "components/accordion_table"; @import "components/topbar"; diff --git a/styles/elements/_card.scss b/styles/elements/_card.scss new file mode 100644 index 00000000..28f416da --- /dev/null +++ b/styles/elements/_card.scss @@ -0,0 +1,34 @@ +.card { + width: 100%; + box-shadow: $box-shadow-big; + padding: ($gap * 2) ($gap * 2.5) ($gap * 4) ($gap * 3); + margin-bottom: 20px; + + .card__status { + display: flex; + align-items: baseline; + justify-content: space-around; + + .card__status-spacer { + flex-grow: 10; + } + } + + .card__header h3 { + margin-top: 0; + } + + .card__body { + font-size: $small-font-size; + } +} + +.card { + .label { + margin-left: 0; + } + + .datetime { + font-size: $small-font-size; + } +} diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index d13934f4..445ab557 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -585,40 +585,3 @@ } } } - -.card { - width: 100%; - box-shadow: $box-shadow-big; - padding: ($gap * 2) ($gap * 2.5) ($gap * 4) ($gap * 3); - margin-bottom: 20px; - - .card__status { - margin-bottom: $gap * 2; - display: flex; - align-items: baseline; - justify-content: space-around; - - .card__status-spacer { - flex-grow: 10; - } - } - - .card__header { - - } - - .card__body { - font-size: $small-font-size; - color: $color-gray-medium; - } -} - -.card { - .label { - margin-left: 0; - } - - .datetime { - font-size: $small-font-size; - } -} From f542af06be4b35ace0b652f1d4074486386d2534 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 12:41:40 -0400 Subject: [PATCH 13/18] Use obligated amount for TO description --- templates/portfolios/task_orders/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index 5ea017de..c1431362 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -56,7 +56,7 @@

Task Order {{ task_order.number }}

- This is a TO description. This is a TO description. This is a TO description. This is a TO description. This is a TO description. This is a TO description. + Obligated amount: ${{ task_order.total_obligated_funds }}
{% endfor %} From f227ecf699b8a77054bb73a9ac16131161ec3c6a Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 14:34:56 -0400 Subject: [PATCH 14/18] Fix task order timestamp format --- templates/portfolios/task_orders/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index c1431362..781820c0 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -13,7 +13,7 @@ {% endmacro %} {% macro TaskOrderDateTime(dt, className="") %} - + {% endmacro %} {% macro TaskOrderDate(task_order) %} From 34dd418750c366461eaa9720c5b2ff2baaf8f218 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 14:40:34 -0400 Subject: [PATCH 15/18] Formatting --- atst/routes/task_orders/index.py | 2 +- styles/core/_variables.scss | 2 +- templates/portfolios/task_orders/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atst/routes/task_orders/index.py b/atst/routes/task_orders/index.py index 6b440ea6..b81333c8 100644 --- a/atst/routes/task_orders/index.py +++ b/atst/routes/task_orders/index.py @@ -48,5 +48,5 @@ def portfolio_funding(portfolio_id): + task_orders_by_status.get(TaskOrderStatus.PENDING, []) ), active_task_orders=active_task_orders, - expired_task_orders=task_orders_by_status.get(TaskOrderStatus.EXPIRED, []) + expired_task_orders=task_orders_by_status.get(TaskOrderStatus.EXPIRED, []), ) diff --git a/styles/core/_variables.scss b/styles/core/_variables.scss index c9b36104..4ec4ab39 100644 --- a/styles/core/_variables.scss +++ b/styles/core/_variables.scss @@ -165,7 +165,7 @@ $checkbox-border-radius: 2px; $border-radius: 3px; $button-border-radius: 5px; $box-shadow: 0px 2px 5px 0px $color-shadow; -$box-shadow-big: 0 4px 10px 0 rgba(193,193,193,0.5); +$box-shadow-big: 0 4px 10px 0 rgba(193, 193, 193, 0.5); $focus-outline: 2px dotted $color-gray-light; $focus-spacing: 3px; $nav-width: 300px; diff --git a/templates/portfolios/task_orders/index.html b/templates/portfolios/task_orders/index.html index 781820c0..328c8994 100644 --- a/templates/portfolios/task_orders/index.html +++ b/templates/portfolios/task_orders/index.html @@ -53,7 +53,7 @@
-

Task Order {{ task_order.number }}

+

Task Order #{{ task_order.number }}

Obligated amount: ${{ task_order.total_obligated_funds }} From e6d103a34533193649b495853b14af9569fac1fe Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 14:56:52 -0400 Subject: [PATCH 16/18] Remove a test --- tests/routes/task_orders/test_index.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/routes/task_orders/test_index.py b/tests/routes/task_orders/test_index.py index 08f74608..c1b435fa 100644 --- a/tests/routes/task_orders/test_index.py +++ b/tests/routes/task_orders/test_index.py @@ -29,22 +29,6 @@ def user(): class TestPortfolioFunding: - def test_portfolio_with_no_task_orders(self, app, user_session, portfolio): - user_session(portfolio.owner) - - with captured_templates(app) as templates: - response = app.test_client().get( - url_for("task_orders.portfolio_funding", portfolio_id=portfolio.id) - ) - - assert response.status_code == 200 - _, context = templates[0] - assert context["funding_end_date"] is None - assert context["total_balance"] == 0 - assert context["pending_task_orders"] == [] - assert context["active_task_orders"] == [] - assert context["expired_task_orders"] == [] - @pytest.mark.skip(reason="Update later when CLINs are implemented") def test_funded_portfolio(self, app, user_session, portfolio): user_session(portfolio.owner) From c3911c89a358264b00729b740535e5cf77e47b5a Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 15:08:07 -0400 Subject: [PATCH 17/18] Tests should be deterministic --- atst/models/task_order.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/atst/models/task_order.py b/atst/models/task_order.py index c8e9948d..d3f8005d 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -67,9 +67,7 @@ class TaskOrder(Base, mixins.TimestampsMixin): def status(self): # TODO: fix task order -- implement correctly using CLINs # Faked for display purposes - possible_statuses = list(Status.__members__.values()) - index = self.time_created.microsecond % len(possible_statuses) - return possible_statuses[index] + return Status.ACTIVE @property def start_date(self): From 38291937f9f6c06ed3a9e9c22595dab719e6a7f0 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Wed, 5 Jun 2019 15:12:39 -0400 Subject: [PATCH 18/18] Remove unused imports --- atst/models/task_order.py | 1 - atst/routes/task_orders/index.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/atst/models/task_order.py b/atst/models/task_order.py index d3f8005d..049b7d85 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -1,6 +1,5 @@ from enum import Enum from datetime import date -import random from sqlalchemy import Column, DateTime, ForeignKey, String from sqlalchemy.ext.hybrid import hybrid_property diff --git a/atst/routes/task_orders/index.py b/atst/routes/task_orders/index.py index b81333c8..d91db98f 100644 --- a/atst/routes/task_orders/index.py +++ b/atst/routes/task_orders/index.py @@ -1,6 +1,6 @@ from collections import defaultdict -from flask import g, render_template, url_for +from flask import g, render_template from . import task_orders_bp from atst.domain.authz.decorator import user_can_access_decorator as user_can