From de5b4f6ec4117571467aec58c76e7af1bd205e61 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Mon, 29 Nov 2021 17:23:35 +0100 Subject: [PATCH] All theme files elevated to app directory. --- cara/apps/calculator/__init__.py | 2 +- cara/apps/calculator/__main__.py | 1 - .../{calculator => }/templates/base/calculator.form.html.j2 | 0 .../{calculator => }/templates/base/calculator.report.html.j2 | 0 cara/apps/{calculator => }/templates/base/userguide.html.j2 | 0 cara/apps/{calculator => }/templates/calculator.form.html.j2 | 0 cara/apps/{calculator => }/templates/calculator.report.html.j2 | 0 .../cern/templates => templates/cern}/calculator.form.html.j2 | 0 .../cern/templates => templates/cern}/calculator.report.html.j2 | 0 .../{themes/cern/templates => templates/cern}/index.html.j2 | 0 .../{themes/cern/templates => templates/cern}/layout.html.j2 | 0 .../{themes/cern/templates => templates/cern}/userguide.html.j2 | 0 cara/apps/{calculator => }/templates/userguide.html.j2 | 0 13 files changed, 1 insertion(+), 2 deletions(-) rename cara/apps/{calculator => }/templates/base/calculator.form.html.j2 (100%) rename cara/apps/{calculator => }/templates/base/calculator.report.html.j2 (100%) rename cara/apps/{calculator => }/templates/base/userguide.html.j2 (100%) rename cara/apps/{calculator => }/templates/calculator.form.html.j2 (100%) rename cara/apps/{calculator => }/templates/calculator.report.html.j2 (100%) rename cara/apps/{themes/cern/templates => templates/cern}/calculator.form.html.j2 (100%) rename cara/apps/{themes/cern/templates => templates/cern}/calculator.report.html.j2 (100%) rename cara/apps/{themes/cern/templates => templates/cern}/index.html.j2 (100%) rename cara/apps/{themes/cern/templates => templates/cern}/layout.html.j2 (100%) rename cara/apps/{themes/cern/templates => templates/cern}/userguide.html.j2 (100%) rename cara/apps/{calculator => }/templates/userguide.html.j2 (100%) diff --git a/cara/apps/calculator/__init__.py b/cara/apps/calculator/__init__.py index 407382e3..c5b50385 100644 --- a/cara/apps/calculator/__init__.py +++ b/cara/apps/calculator/__init__.py @@ -229,7 +229,7 @@ def make_app( calculator_templates = Path(__file__).parent / "templates" templates_directories = [cara_templates, calculator_templates] if theme_dir: - templates_directories.insert(0, theme_dir / 'templates') + templates_directories.insert(0, theme_dir) loader = jinja2.FileSystemLoader([str(path) for path in templates_directories]) template_environment = jinja2.Environment( loader=loader, diff --git a/cara/apps/calculator/__main__.py b/cara/apps/calculator/__main__.py index 7ec61206..7ec8b69a 100644 --- a/cara/apps/calculator/__main__.py +++ b/cara/apps/calculator/__main__.py @@ -36,7 +36,6 @@ def main(): if theme_dir is not None: theme_dir = Path(theme_dir).absolute() assert theme_dir.exists() - assert (theme_dir / 'templates').exists() app = make_app(debug=args.no_debug, calculator_prefix=args.prefix, theme_dir=theme_dir) app.listen(args.port) IOLoop.instance().start() diff --git a/cara/apps/calculator/templates/base/calculator.form.html.j2 b/cara/apps/templates/base/calculator.form.html.j2 similarity index 100% rename from cara/apps/calculator/templates/base/calculator.form.html.j2 rename to cara/apps/templates/base/calculator.form.html.j2 diff --git a/cara/apps/calculator/templates/base/calculator.report.html.j2 b/cara/apps/templates/base/calculator.report.html.j2 similarity index 100% rename from cara/apps/calculator/templates/base/calculator.report.html.j2 rename to cara/apps/templates/base/calculator.report.html.j2 diff --git a/cara/apps/calculator/templates/base/userguide.html.j2 b/cara/apps/templates/base/userguide.html.j2 similarity index 100% rename from cara/apps/calculator/templates/base/userguide.html.j2 rename to cara/apps/templates/base/userguide.html.j2 diff --git a/cara/apps/calculator/templates/calculator.form.html.j2 b/cara/apps/templates/calculator.form.html.j2 similarity index 100% rename from cara/apps/calculator/templates/calculator.form.html.j2 rename to cara/apps/templates/calculator.form.html.j2 diff --git a/cara/apps/calculator/templates/calculator.report.html.j2 b/cara/apps/templates/calculator.report.html.j2 similarity index 100% rename from cara/apps/calculator/templates/calculator.report.html.j2 rename to cara/apps/templates/calculator.report.html.j2 diff --git a/cara/apps/themes/cern/templates/calculator.form.html.j2 b/cara/apps/templates/cern/calculator.form.html.j2 similarity index 100% rename from cara/apps/themes/cern/templates/calculator.form.html.j2 rename to cara/apps/templates/cern/calculator.form.html.j2 diff --git a/cara/apps/themes/cern/templates/calculator.report.html.j2 b/cara/apps/templates/cern/calculator.report.html.j2 similarity index 100% rename from cara/apps/themes/cern/templates/calculator.report.html.j2 rename to cara/apps/templates/cern/calculator.report.html.j2 diff --git a/cara/apps/themes/cern/templates/index.html.j2 b/cara/apps/templates/cern/index.html.j2 similarity index 100% rename from cara/apps/themes/cern/templates/index.html.j2 rename to cara/apps/templates/cern/index.html.j2 diff --git a/cara/apps/themes/cern/templates/layout.html.j2 b/cara/apps/templates/cern/layout.html.j2 similarity index 100% rename from cara/apps/themes/cern/templates/layout.html.j2 rename to cara/apps/templates/cern/layout.html.j2 diff --git a/cara/apps/themes/cern/templates/userguide.html.j2 b/cara/apps/templates/cern/userguide.html.j2 similarity index 100% rename from cara/apps/themes/cern/templates/userguide.html.j2 rename to cara/apps/templates/cern/userguide.html.j2 diff --git a/cara/apps/calculator/templates/userguide.html.j2 b/cara/apps/templates/userguide.html.j2 similarity index 100% rename from cara/apps/calculator/templates/userguide.html.j2 rename to cara/apps/templates/userguide.html.j2