Merge pull request #527 from dod-ccpo/simple-task-order-view
Simple task order view
This commit is contained in:
commit
8bd7de4f02
@ -6,6 +6,7 @@ from . import index
|
|||||||
from . import projects
|
from . import projects
|
||||||
from . import members
|
from . import members
|
||||||
from . import invitations
|
from . import invitations
|
||||||
|
from . import task_orders
|
||||||
from atst.domain.exceptions import UnauthorizedError
|
from atst.domain.exceptions import UnauthorizedError
|
||||||
from atst.domain.workspaces import Workspaces
|
from atst.domain.workspaces import Workspaces
|
||||||
from atst.domain.authz import Authorization
|
from atst.domain.authz import Authorization
|
||||||
|
20
atst/routes/workspaces/task_orders.py
Normal file
20
atst/routes/workspaces/task_orders.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from flask import g, render_template
|
||||||
|
|
||||||
|
from . import workspaces_bp
|
||||||
|
from atst.domain.task_orders import TaskOrders
|
||||||
|
from atst.domain.workspaces import Workspaces
|
||||||
|
|
||||||
|
|
||||||
|
@workspaces_bp.route("/workspaces/<workspace_id>/task_orders")
|
||||||
|
def workspace_task_orders(workspace_id):
|
||||||
|
workspace = Workspaces.get(g.current_user, workspace_id)
|
||||||
|
return render_template("workspaces/task_orders/index.html", workspace=workspace)
|
||||||
|
|
||||||
|
|
||||||
|
@workspaces_bp.route("/workspaces/<workspace_id>/task_order/<task_order_id>")
|
||||||
|
def view_task_order(workspace_id, task_order_id):
|
||||||
|
workspace = Workspaces.get(g.current_user, workspace_id)
|
||||||
|
task_order = TaskOrders.get(task_order_id)
|
||||||
|
return render_template(
|
||||||
|
"workspaces/task_orders/show.html", workspace=workspace, task_order=task_order
|
||||||
|
)
|
@ -40,6 +40,13 @@
|
|||||||
) }}
|
) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{{ SidenavItem(
|
||||||
|
("navigation.workspace_navigation.task_orders" | translate),
|
||||||
|
href=url_for("workspaces.workspace_task_orders", workspace_id=workspace.id),
|
||||||
|
active=request.url_rule.rule.startswith('/workspaces/<workspace_id>/task_order'),
|
||||||
|
subnav=None
|
||||||
|
) }}
|
||||||
|
|
||||||
{% if user_can(permissions.EDIT_WORKSPACE_INFORMATION) %}
|
{% if user_can(permissions.EDIT_WORKSPACE_INFORMATION) %}
|
||||||
{{ SidenavItem(
|
{{ SidenavItem(
|
||||||
("navigation.workspace_navigation.workspace_settings" | translate),
|
("navigation.workspace_navigation.workspace_settings" | translate),
|
||||||
|
30
templates/workspaces/task_orders/index.html
Normal file
30
templates/workspaces/task_orders/index.html
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{% from "components/empty_state.html" import EmptyState %}
|
||||||
|
|
||||||
|
{% extends "workspaces/base.html" %}
|
||||||
|
|
||||||
|
{% block workspace_content %}
|
||||||
|
|
||||||
|
{% if not workspace.task_orders %}
|
||||||
|
|
||||||
|
{{ EmptyState(
|
||||||
|
'This workspace doesn’t have any task orders yet.',
|
||||||
|
action_label='Add a New Task Order',
|
||||||
|
action_href=url_for('task_orders.new', screen=1, workspace_id=workspace.id),
|
||||||
|
icon='cloud',
|
||||||
|
) }}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for task_order in workspace.task_orders %}
|
||||||
|
<li class='block-list__item'>
|
||||||
|
<a href='{{ url_for("workspaces.view_task_order", workspace_id=workspace.id, task_order_id=task_order.id)}}'>
|
||||||
|
<span>{{ task_order.start_date }} - {{ task_order.end_date }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endblock %}
|
7
templates/workspaces/task_orders/show.html
Normal file
7
templates/workspaces/task_orders/show.html
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{% extends "workspaces/base.html" %}
|
||||||
|
|
||||||
|
{% block workspace_content %}
|
||||||
|
|
||||||
|
You're looking at TO {{ task_order.id }}
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -204,6 +204,7 @@ navigation:
|
|||||||
budget_report: Budget Report
|
budget_report: Budget Report
|
||||||
members: Members
|
members: Members
|
||||||
projects: Projects
|
projects: Projects
|
||||||
|
task_orders: Task Orders
|
||||||
workspace_settings: Workspace Settings
|
workspace_settings: Workspace Settings
|
||||||
requests:
|
requests:
|
||||||
_new:
|
_new:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user