From 9b3381a2cc85921f89c887e15d581ef78f16c1a3 Mon Sep 17 00:00:00 2001 From: Marcos Prieto Date: Thu, 23 Nov 2023 12:01:17 +0100 Subject: [PATCH] Rename organization templates to follow the pattern of AI ones --- .../new.html.jinja2} | 2 +- .../search.html.jinja2} | 2 +- .../show.html.jinja2} | 2 +- .../usage.html.jinja2} | 2 +- lms/views/admin/organization.py | 12 ++++++------ 5 files changed, 10 insertions(+), 10 deletions(-) rename lms/templates/admin/{organization.new.html.jinja2 => organization/new.html.jinja2} (90%) rename lms/templates/admin/{organizations.html.jinja2 => organization/search.html.jinja2} (98%) rename lms/templates/admin/{organization.html.jinja2 => organization/show.html.jinja2} (99%) rename lms/templates/admin/{organization.usage.html.jinja2 => organization/usage.html.jinja2} (96%) diff --git a/lms/templates/admin/organization.new.html.jinja2 b/lms/templates/admin/organization/new.html.jinja2 similarity index 90% rename from lms/templates/admin/organization.new.html.jinja2 rename to lms/templates/admin/organization/new.html.jinja2 index 41f99b5909..cac0d58c5d 100644 --- a/lms/templates/admin/organization.new.html.jinja2 +++ b/lms/templates/admin/organization/new.html.jinja2 @@ -1,4 +1,4 @@ -{% import "macros.html.jinja2" as macros %} +{% import "lms:templates/admin/macros.html.jinja2" as macros %} {% extends "lms:templates/admin/base.html.jinja2" %} {% block header %}New organization{% endblock %} {% block content %} diff --git a/lms/templates/admin/organizations.html.jinja2 b/lms/templates/admin/organization/search.html.jinja2 similarity index 98% rename from lms/templates/admin/organizations.html.jinja2 rename to lms/templates/admin/organization/search.html.jinja2 index 66297ca6fe..c5cda162ac 100644 --- a/lms/templates/admin/organizations.html.jinja2 +++ b/lms/templates/admin/organization/search.html.jinja2 @@ -1,4 +1,4 @@ -{% import "macros.html.jinja2" as macros %} +{% import "lms:templates/admin/macros.html.jinja2" as macros %} {% extends "lms:templates/admin/base.html.jinja2" %} {% block header %}Organizations{% endblock %} {% block content %} diff --git a/lms/templates/admin/organization.html.jinja2 b/lms/templates/admin/organization/show.html.jinja2 similarity index 99% rename from lms/templates/admin/organization.html.jinja2 rename to lms/templates/admin/organization/show.html.jinja2 index cdbc2a22f4..7e33d4b1dd 100644 --- a/lms/templates/admin/organization.html.jinja2 +++ b/lms/templates/admin/organization/show.html.jinja2 @@ -1,4 +1,4 @@ -{% import "macros.html.jinja2" as macros %} +{% import "lms:templates/admin/macros.html.jinja2" as macros %} {% macro org_hierarchy(node, focus_org) %}
  • {% if node.id == focus_org.id %} diff --git a/lms/templates/admin/organization.usage.html.jinja2 b/lms/templates/admin/organization/usage.html.jinja2 similarity index 96% rename from lms/templates/admin/organization.usage.html.jinja2 rename to lms/templates/admin/organization/usage.html.jinja2 index cb66454caf..249886a801 100644 --- a/lms/templates/admin/organization.usage.html.jinja2 +++ b/lms/templates/admin/organization/usage.html.jinja2 @@ -1,4 +1,4 @@ -{% import "macros.html.jinja2" as macros %} +{% import "lms:templates/admin/macros.html.jinja2" as macros %} {% extends "lms:templates/admin/base.html.jinja2" %} {% block header %}Organization {{ org.id }} usage{% endblock %} {% block content %} diff --git a/lms/views/admin/organization.py b/lms/views/admin/organization.py index 719ce4f13a..92fe859567 100644 --- a/lms/views/admin/organization.py +++ b/lms/views/admin/organization.py @@ -43,7 +43,7 @@ def __init__(self, request): @view_config( route_name="admin.organizations", request_method="GET", - renderer="lms:templates/admin/organizations.html.jinja2", + renderer="lms:templates/admin/organization/search.html.jinja2", ) def organizations(self): # pragma: no cover return {} @@ -51,7 +51,7 @@ def organizations(self): # pragma: no cover @view_config( route_name="admin.organization.new", request_method="GET", - renderer="lms:templates/admin/organization.new.html.jinja2", + renderer="lms:templates/admin/organization/new.html.jinja2", ) def new_organization(self): # pragma: no cover return {} @@ -59,7 +59,7 @@ def new_organization(self): # pragma: no cover @view_config( route_name="admin.organization.new", request_method="POST", - renderer="lms:templates/admin/organization.new.html.jinja2", + renderer="lms:templates/admin/organization/new.html.jinja2", ) def new_organization_callback(self): if flash_validation(self.request, NewOrganizationSchema): @@ -76,7 +76,7 @@ def new_organization_callback(self): @view_config( route_name="admin.organization", request_method="GET", - renderer="lms:templates/admin/organization.html.jinja2", + renderer="lms:templates/admin/organization/show.html.jinja2", ) def show_organization(self): org_id = self.request.matchdict["id_"] @@ -142,7 +142,7 @@ def toggle_organization_enabled(self): @view_config( route_name="admin.organizations", request_method="POST", - renderer="lms:templates/admin/organizations.html.jinja2", + renderer="lms:templates/admin/organization/search.html.jinja2", ) def search(self): if flash_validation(self.request, SearchOrganizationSchema): @@ -164,7 +164,7 @@ def search(self): @view_config( route_name="admin.organization.usage", request_method="POST", - renderer="lms:templates/admin/organization.usage.html.jinja2", + renderer="lms:templates/admin/organization/usage.html.jinja2", ) def usage(self): org = self._get_org_or_404(self.request.matchdict["id_"])