diff --git a/atst/routes/workspaces/__init__.py b/atst/routes/workspaces/__init__.py index 6ba95d77..96aa24b5 100644 --- a/atst/routes/workspaces/__init__.py +++ b/atst/routes/workspaces/__init__.py @@ -6,6 +6,7 @@ from . import index from . import projects from . import members from . import invitations +from . import task_orders from atst.domain.exceptions import UnauthorizedError from atst.domain.workspaces import Workspaces from atst.domain.authz import Authorization diff --git a/atst/routes/workspaces/task_orders.py b/atst/routes/workspaces/task_orders.py new file mode 100644 index 00000000..7fdcbc9a --- /dev/null +++ b/atst/routes/workspaces/task_orders.py @@ -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//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//task_order/") +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 + ) diff --git a/templates/workspaces/task_orders/index.html b/templates/workspaces/task_orders/index.html new file mode 100644 index 00000000..19de849c --- /dev/null +++ b/templates/workspaces/task_orders/index.html @@ -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 %} + + + +{% endif %} + +{% endblock %} diff --git a/templates/workspaces/task_orders/show.html b/templates/workspaces/task_orders/show.html new file mode 100644 index 00000000..d65f9ec0 --- /dev/null +++ b/templates/workspaces/task_orders/show.html @@ -0,0 +1,7 @@ +{% extends "workspaces/base.html" %} + +{% block workspace_content %} + +You're looking at TO {{ task_order.id }} + +{% endblock %}