From bf22afa7afe8b10a47bed7481f257d91611121e0 Mon Sep 17 00:00:00 2001 From: Montana Date: Mon, 7 Jan 2019 11:30:59 -0500 Subject: [PATCH] Add Activity Log tab for a workspace --- atst/routes/workspaces/index.py | 14 ++++++++++++++ templates/navigation/workspace_navigation.html | 9 +++++++++ templates/workspaces/activity.html | 1 + translations.yaml | 1 + 4 files changed, 25 insertions(+) create mode 100644 templates/workspaces/activity.html diff --git a/atst/routes/workspaces/index.py b/atst/routes/workspaces/index.py index 2bdcd6d2..30e11ab1 100644 --- a/atst/routes/workspaces/index.py +++ b/atst/routes/workspaces/index.py @@ -80,3 +80,17 @@ def workspace_reports(workspace_id): expiration_date=expiration_date, remaining_days=remaining_days, ) + + +@workspaces_bp.route("/workspaces//activity") +def workspace_activity(workspace_id): + workspace = Workspaces.get(g.current_user, workspace_id) + Authorization.check_workspace_permission( + g.current_user, + workspace, + # TODO: diff permission + Permissions.VIEW_USAGE_DOLLARS, + "view workspace reports", + ) + + return render_template("workspaces/activity.html", workspace_name=workspace.name) diff --git a/templates/navigation/workspace_navigation.html b/templates/navigation/workspace_navigation.html index 3a36bff5..698f193f 100644 --- a/templates/navigation/workspace_navigation.html +++ b/templates/navigation/workspace_navigation.html @@ -56,5 +56,14 @@ ) }} {% endif %} + + {% if user_can(permissions.VIEW_USAGE_DOLLARS) %} + {{ SidenavItem( + ("navigation.workspace_navigation.activity_log" | translate), + href=url_for("workspaces.workspace_activity", workspace_id=workspace.id), + active=request.url_rule.rule.startswith('/workspaces//activity') + ) }} + {% endif %} + diff --git a/templates/workspaces/activity.html b/templates/workspaces/activity.html new file mode 100644 index 00000000..acd43b4e --- /dev/null +++ b/templates/workspaces/activity.html @@ -0,0 +1 @@ +

Activity Log for Workspace {{workspace_name}}

diff --git a/translations.yaml b/translations.yaml index d4268246..61859980 100644 --- a/translations.yaml +++ b/translations.yaml @@ -202,6 +202,7 @@ navigation: add_new_member_label: Add New Member add_new_project_label: Add New Project budget_report: Budget Report + activity_log: Activity Log members: Members projects: Projects task_orders: Task Orders