Files
atst/templates/portfolios/task_orders/index.html
2019-06-05 15:37:40 -04:00

97 lines
3.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% from "components/empty_state.html" import EmptyState %}
{% from "components/icon.html" import Icon %}
{% from "components/sticky_cta.html" import StickyCTA %}
{% extends "portfolios/base.html" %}
{% block portfolio_content %}
{% macro ViewLink(task_order, text="Edit") %}
<a href="{{ url_for('task_orders.view_task_order', task_order_id=task_order.id) }}" class="usa-button">
{{ text }}
</a>
{% endmacro %}
{% macro TaskOrderDateTime(dt, className="") %}
<local-datetime timestamp="{{ dt }}" format="M/D/YYYY" class="{{ className }}"></local-datetime>
{% endmacro %}
{% macro TaskOrderDate(task_order) %}
<span class="datetime">
{% if task_order.is_active %}
Began {{ TaskOrderDateTime(task_order.start_date) }} &nbsp;&nbsp;|&nbsp;&nbsp; Ends {{ TaskOrderDateTime(task_order.end_date) }}
{% elif task_order.is_expired %}
Started {{ TaskOrderDateTime(task_order.start_date) }} &nbsp;&nbsp;|&nbsp;&nbsp; Ended {{ TaskOrderDateTime(task_order.end_date) }}
{% else %}
Started {{ TaskOrderDateTime(task_order.start_date) }}
{% endif %}
</span>
{% endmacro %}
{% macro TaskOrderActions(task_order) %}
<div class="task-order-card__buttons">
{% if task_order.is_pending %}
{{ ViewLink(task_order, text="Edit") }}
{% elif task_order.is_active %}
{{ ViewLink(task_order, text="Modify") }}
{% else %}
{{ ViewLink(task_order, text="View") }}
{% endif %}
</div>
{% endmacro %}
{% macro TaskOrderList(task_orders, label='success') %}
<div class="task-order-list">
{% for task_order in task_orders %}
<div class="card task-order-card">
<div class="card__status">
<span class='label label--{{ label }}'>{{ task_order.display_status }}</span>
{{ TaskOrderDate(task_order) }}
<span class="card__status-spacer"></span>
<span class="card__button">
{{ TaskOrderActions(task_order) }}
</span>
</div>
<div class="card__header">
<h3>Task Order {{ task_order.number }}</h3>
</div>
<div class="card__body">
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.
</div>
</div>
{% endfor %}
</div>
{% endmacro %}
<div class="portfolio-funding">
{% call StickyCTA(text="Funding") %}
<div class='portfolio-funding__header row'>
<a href="{{ url_for("task_orders.edit", portfolio_id=portfolio.id) }}" class="usa-button">Add a new task order</a>
</div>
{% endcall %}
{% if not active_task_orders and not pending_task_orders %}
{{ EmptyState(
'This portfolio doesnt have any active or pending task orders.',
action_label='Add a New Task Order',
action_href=url_for('task_orders.edit', portfolio_id=portfolio.id),
icon='cloud',
) }}
{% endif %}
{% if pending_task_orders %}
{{ TaskOrderList(pending_task_orders, label='warning') }}
{% endif %}
{% if active_task_orders %}
{{ TaskOrderList(active_task_orders, label='success') }}
{% endif %}
{% if expired_task_orders %}
{{ TaskOrderList(expired_task_orders, label='error') }}
{% endif %}
</div>
{% endblock %}