From 00e91ba78924e026012ca9938b58d9097ab81eea Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Thu, 6 Sep 2018 10:52:17 -0400 Subject: [PATCH] Move requests & workspaces templates into directories --- atst/routes/requests/index.py | 2 +- atst/routes/workspaces.py | 29 ++++++++++++------- .../{requests_new.html => requests/_new.html} | 0 .../approval.html} | 0 .../{requests.html => requests/index.html} | 0 templates/requests/screen-1.html | 2 +- templates/requests/screen-2.html | 2 +- templates/requests/screen-3.html | 2 +- templates/requests/screen-4.html | 2 +- .../base.html} | 0 .../index.html} | 0 .../members/edit.html} | 0 .../members/index.html} | 2 +- .../members/new.html} | 0 .../projects/edit.html.to} | 0 .../projects/index.html} | 2 +- .../projects/new.html} | 2 +- .../reports/index.html} | 2 +- 18 files changed, 28 insertions(+), 19 deletions(-) rename templates/{requests_new.html => requests/_new.html} (100%) rename templates/{request_approval.html => requests/approval.html} (100%) rename templates/{requests.html => requests/index.html} (100%) rename templates/{base_workspace.html => workspaces/base.html} (100%) rename templates/{workspaces.html => workspaces/index.html} (100%) rename templates/{member_edit.html => workspaces/members/edit.html} (100%) rename templates/{workspace_members.html => workspaces/members/index.html} (98%) rename templates/{member_new.html => workspaces/members/new.html} (100%) rename templates/{project_edit.html.to => workspaces/projects/edit.html.to} (100%) rename templates/{workspace_projects.html => workspaces/projects/index.html} (97%) rename templates/{workspace_project_new.html => workspaces/projects/new.html} (98%) rename templates/{workspace_reports.html => workspaces/reports/index.html} (99%) diff --git a/atst/routes/requests/index.py b/atst/routes/requests/index.py index b475a9e6..fe3e894e 100644 --- a/atst/routes/requests/index.py +++ b/atst/routes/requests/index.py @@ -98,4 +98,4 @@ class RequestsIndex(object): @requests_bp.route("/requests", methods=["GET"]) def requests_index(): context = RequestsIndex(g.current_user).execute() - return render_template("requests.html", **context) + return render_template("requests/index.html", **context) diff --git a/atst/routes/workspaces.py b/atst/routes/workspaces.py index d6da53ab..594b8f99 100644 --- a/atst/routes/workspaces.py +++ b/atst/routes/workspaces.py @@ -47,13 +47,13 @@ def workspace(): @bp.route("/workspaces") def workspaces(): workspaces = Workspaces.get_many(g.current_user) - return render_template("workspaces.html", page=5, workspaces=workspaces) + return render_template("workspaces/index.html", page=5, workspaces=workspaces) @bp.route("/workspaces//projects") def workspace_projects(workspace_id): workspace = Workspaces.get(g.current_user, workspace_id) - return render_template("workspace_projects.html", workspace=workspace) + return render_template("workspaces/projects/index.html", workspace=workspace) @bp.route("/workspaces/") @@ -64,7 +64,7 @@ def show_workspace(workspace_id): @bp.route("/workspaces//members") def workspace_members(workspace_id): workspace = Workspaces.get(g.current_user, workspace_id) - return render_template("workspace_members.html", workspace=workspace) + return render_template("workspaces/members/index.html", workspace=workspace) @bp.route("/workspaces//reports") @@ -86,7 +86,7 @@ def workspace_reports(workspace_id): two_months_ago = prev_month - timedelta(days=28) return render_template( - "workspace_reports.html", + "workspaces/reports/index.html", workspace_totals=Reports.workspace_totals(alternate_reports), monthly_totals=Reports.monthly_totals(alternate_reports), current_month=current_month, @@ -99,7 +99,9 @@ def workspace_reports(workspace_id): def new_project(workspace_id): workspace = Workspaces.get_for_update(g.current_user, workspace_id) form = NewProjectForm() - return render_template("workspace_project_new.html", workspace=workspace, form=form) + return render_template( + "workspaces/projects/new.html", workspace=workspace, form=form + ) @bp.route("/workspaces//projects/new", methods=["POST"]) @@ -120,7 +122,7 @@ def update_project(workspace_id): ) else: return render_template( - "workspace_project_new.html", workspace=workspace, form=form + "workspaces/projects/new.html", workspace=workspace, form=form ) @@ -128,7 +130,9 @@ def update_project(workspace_id): def new_member(workspace_id): workspace = Workspaces.get(g.current_user, workspace_id) form = NewMemberForm() - return render_template("member_new.html", workspace=workspace, form=form) + return render_template( + "workspaces/members/new.html", workspace=workspace, form=form + ) @bp.route("/workspaces//members/new", methods=["POST"]) @@ -146,7 +150,9 @@ def create_member(workspace_id): ) ) else: - return render_template("member_new.html", workspace=workspace, form=form) + return render_template( + "workspaces/members/new.html", workspace=workspace, form=form + ) @bp.route("/workspaces//members//member_edit") @@ -161,7 +167,7 @@ def view_member(workspace_id, member_id): member = WorkspaceUsers.get(workspace_id, member_id) form = EditMemberForm(workspace_role=member.role) return render_template( - "member_edit.html", form=form, workspace=workspace, member=member + "workspaces/members/edit.html", form=form, workspace=workspace, member=member ) @@ -195,5 +201,8 @@ def update_member(workspace_id, member_id): ) else: return render_template( - "member_edit.html", form=form, workspace=workspace, member=member + "workspaces/members/edit.html", + form=form, + workspace=workspace, + member=member, ) diff --git a/templates/requests_new.html b/templates/requests/_new.html similarity index 100% rename from templates/requests_new.html rename to templates/requests/_new.html diff --git a/templates/request_approval.html b/templates/requests/approval.html similarity index 100% rename from templates/request_approval.html rename to templates/requests/approval.html diff --git a/templates/requests.html b/templates/requests/index.html similarity index 100% rename from templates/requests.html rename to templates/requests/index.html diff --git a/templates/requests/screen-1.html b/templates/requests/screen-1.html index 88561030..22e9b100 100644 --- a/templates/requests/screen-1.html +++ b/templates/requests/screen-1.html @@ -1,4 +1,4 @@ -{% extends 'requests_new.html' %} +{% extends 'requests/_new.html' %} {% from "components/alert.html" import Alert %} {% from "components/text_input.html" import TextInput %} diff --git a/templates/requests/screen-2.html b/templates/requests/screen-2.html index 9a23777e..6d23c171 100644 --- a/templates/requests/screen-2.html +++ b/templates/requests/screen-2.html @@ -1,4 +1,4 @@ -{% extends 'requests_new.html' %} +{% extends 'requests/_new.html' %} {% from "components/alert.html" import Alert %} {% from "components/text_input.html" import TextInput %} diff --git a/templates/requests/screen-3.html b/templates/requests/screen-3.html index 79f4b3a0..cbceccae 100644 --- a/templates/requests/screen-3.html +++ b/templates/requests/screen-3.html @@ -1,4 +1,4 @@ -{% extends 'requests_new.html' %} +{% extends 'requests/_new.html' %} {% from "components/alert.html" import Alert %} {% from "components/text_input.html" import TextInput %} diff --git a/templates/requests/screen-4.html b/templates/requests/screen-4.html index c53b3a25..36fe1276 100644 --- a/templates/requests/screen-4.html +++ b/templates/requests/screen-4.html @@ -2,7 +2,7 @@ Response Required {%- endmacro %} -{% extends 'requests_new.html' %} +{% extends 'requests/_new.html' %} {% from "components/alert.html" import Alert %} {% from "components/text_input.html" import TextInput %} diff --git a/templates/base_workspace.html b/templates/workspaces/base.html similarity index 100% rename from templates/base_workspace.html rename to templates/workspaces/base.html diff --git a/templates/workspaces.html b/templates/workspaces/index.html similarity index 100% rename from templates/workspaces.html rename to templates/workspaces/index.html diff --git a/templates/member_edit.html b/templates/workspaces/members/edit.html similarity index 100% rename from templates/member_edit.html rename to templates/workspaces/members/edit.html diff --git a/templates/workspace_members.html b/templates/workspaces/members/index.html similarity index 98% rename from templates/workspace_members.html rename to templates/workspaces/members/index.html index 34761341..6c4f0b0f 100644 --- a/templates/workspace_members.html +++ b/templates/workspaces/members/index.html @@ -1,4 +1,4 @@ -{% extends "base_workspace.html" %} +{% extends "workspaces/base.html" %} {% from "components/empty_state.html" import EmptyState %} {% from "components/alert.html" import Alert %} diff --git a/templates/member_new.html b/templates/workspaces/members/new.html similarity index 100% rename from templates/member_new.html rename to templates/workspaces/members/new.html diff --git a/templates/project_edit.html.to b/templates/workspaces/projects/edit.html.to similarity index 100% rename from templates/project_edit.html.to rename to templates/workspaces/projects/edit.html.to diff --git a/templates/workspace_projects.html b/templates/workspaces/projects/index.html similarity index 97% rename from templates/workspace_projects.html rename to templates/workspaces/projects/index.html index 81aa8a11..99b00d7f 100644 --- a/templates/workspace_projects.html +++ b/templates/workspaces/projects/index.html @@ -2,7 +2,7 @@ {% from "components/alert.html" import Alert %} {% from "components/empty_state.html" import EmptyState %} -{% extends "base_workspace.html" %} +{% extends "workspaces/base.html" %} {% block workspace_content %} diff --git a/templates/workspace_project_new.html b/templates/workspaces/projects/new.html similarity index 98% rename from templates/workspace_project_new.html rename to templates/workspaces/projects/new.html index 2a7d0a27..69914ea3 100644 --- a/templates/workspace_project_new.html +++ b/templates/workspaces/projects/new.html @@ -4,7 +4,7 @@ {% from "components/tooltip.html" import Tooltip %} {% from "components/alert.html" import Alert %} -{% extends "base_workspace.html" %} +{% extends "workspaces/base.html" %} {% block workspace_content %} diff --git a/templates/workspace_reports.html b/templates/workspaces/reports/index.html similarity index 99% rename from templates/workspace_reports.html rename to templates/workspaces/reports/index.html index 060f33e8..0bc1e503 100644 --- a/templates/workspace_reports.html +++ b/templates/workspaces/reports/index.html @@ -1,4 +1,4 @@ -{% extends "base_workspace.html" %} +{% extends "workspaces/base.html" %} {% from "components/alert.html" import Alert %} {% from "components/icon.html" import Icon %}