Merge pull request #1247 from dod-ccpo/to-index-page-redesign_part-3
To index page redesign part 3
This commit is contained in:
commit
f9a3d2628e
@ -1,4 +1,5 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
from decimal import Decimal
|
||||||
|
|
||||||
from sqlalchemy import Column, DateTime, ForeignKey, String
|
from sqlalchemy import Column, DateTime, ForeignKey, String
|
||||||
from sqlalchemy.ext.hybrid import hybrid_property
|
from sqlalchemy.ext.hybrid import hybrid_property
|
||||||
@ -16,7 +17,7 @@ class Status(Enum):
|
|||||||
ACTIVE = "Active"
|
ACTIVE = "Active"
|
||||||
UPCOMING = "Upcoming"
|
UPCOMING = "Upcoming"
|
||||||
EXPIRED = "Expired"
|
EXPIRED = "Expired"
|
||||||
UNSIGNED = "Not signed"
|
UNSIGNED = "Unsigned"
|
||||||
|
|
||||||
|
|
||||||
SORT_ORDERING = [
|
SORT_ORDERING = [
|
||||||
@ -172,7 +173,7 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
|||||||
@property
|
@property
|
||||||
def invoiced_funds(self):
|
def invoiced_funds(self):
|
||||||
# TODO: implement this using reporting data from the CSP
|
# TODO: implement this using reporting data from the CSP
|
||||||
return self.total_obligated_funds * 75 / 100
|
return self.total_obligated_funds * Decimal(0.75)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def display_status(self):
|
def display_status(self):
|
||||||
|
@ -28,5 +28,8 @@ def review_task_order(task_order_id):
|
|||||||
def portfolio_funding(portfolio_id):
|
def portfolio_funding(portfolio_id):
|
||||||
portfolio = Portfolios.get(g.current_user, portfolio_id)
|
portfolio = Portfolios.get(g.current_user, portfolio_id)
|
||||||
task_orders = TaskOrders.sort_by_status(portfolio.task_orders)
|
task_orders = TaskOrders.sort_by_status(portfolio.task_orders)
|
||||||
|
to_count = len(portfolio.task_orders)
|
||||||
# TODO: Get expended amount from the CSP
|
# TODO: Get expended amount from the CSP
|
||||||
return render_template("task_orders/index.html", task_orders=task_orders)
|
return render_template(
|
||||||
|
"task_orders/index.html", task_orders=task_orders, to_count=to_count
|
||||||
|
)
|
||||||
|
@ -46,6 +46,13 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--empty {
|
||||||
|
font-weight: $font-bold;
|
||||||
|
color: $color-gray-dark;
|
||||||
|
padding: $gap * 8;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-list {
|
&-list {
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
|
|
||||||
{% macro TaskOrderList(task_orders, status) %}
|
{% macro TaskOrderList(task_orders, status) %}
|
||||||
<div class="accordion">
|
<div class="accordion">
|
||||||
{% call Accordion(title=status, id=status, heading_tag="h4") %}
|
{% call Accordion(title=("task_orders.status_list_title"|translate({'status': status})), id=status, heading_tag="h4") %}
|
||||||
|
{% if task_orders|length > 0 %}
|
||||||
{% for task_order in task_orders %}
|
{% for task_order in task_orders %}
|
||||||
{% set to_number %}
|
{% set to_number %}
|
||||||
{% if task_order.number != "" %}
|
{% if task_order.number != "" %}
|
||||||
@ -54,6 +55,11 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
<div class="accordion__content--empty">
|
||||||
|
{{ "task_orders.status_empty_state" | translate({ 'status': status }) }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
@ -71,7 +77,7 @@
|
|||||||
|
|
||||||
<div class="portfolio-funding">
|
<div class="portfolio-funding">
|
||||||
|
|
||||||
{% if task_orders %}
|
{% if to_count > 0 %}
|
||||||
{% call AccordionList() %}
|
{% call AccordionList() %}
|
||||||
{% for status, to_list in task_orders.items() %}
|
{% for status, to_list in task_orders.items() %}
|
||||||
{{ TaskOrderList(to_list, status) }}
|
{{ TaskOrderList(to_list, status) }}
|
||||||
|
@ -152,5 +152,5 @@ def test_task_order_sort_by_status():
|
|||||||
assert len(sorted_by_status["Active"]) == 1
|
assert len(sorted_by_status["Active"]) == 1
|
||||||
assert len(sorted_by_status["Upcoming"]) == 1
|
assert len(sorted_by_status["Upcoming"]) == 1
|
||||||
assert len(sorted_by_status["Expired"]) == 2
|
assert len(sorted_by_status["Expired"]) == 2
|
||||||
assert len(sorted_by_status["Not signed"]) == 1
|
assert len(sorted_by_status["Unsigned"]) == 1
|
||||||
assert list(sorted_by_status.keys()) == [status.value for status in SORT_ORDERING]
|
assert list(sorted_by_status.keys()) == [status.value for status in SORT_ORDERING]
|
||||||
|
@ -529,6 +529,8 @@ task_orders:
|
|||||||
team_title: Your team
|
team_title: Your team
|
||||||
sign:
|
sign:
|
||||||
digital_signature_description: I acknowledge that the uploaded task order contains the required KO signature.
|
digital_signature_description: I acknowledge that the uploaded task order contains the required KO signature.
|
||||||
|
status_empty_state: 'This Portfolio has no {status} Task Orders.'
|
||||||
|
status_list_title: '{status} Task Orders'
|
||||||
JEDICLINType:
|
JEDICLINType:
|
||||||
JEDI_CLIN_1: 'IDIQ CLIN 0001 Unclassified IaaS/PaaS'
|
JEDI_CLIN_1: 'IDIQ CLIN 0001 Unclassified IaaS/PaaS'
|
||||||
JEDI_CLIN_2: 'IDIQ CLIN 0002 Classified IaaS/PaaS'
|
JEDI_CLIN_2: 'IDIQ CLIN 0002 Classified IaaS/PaaS'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user