From 1ead09cf4773e2ed6f60f18c839352322a90f10e Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 24 Apr 2020 17:53:46 -0700 Subject: [PATCH] Move home templates into server submodule --- amanuensis/server/{home.py => home/__init__.py} | 10 ++++++---- .../home/admin.jinja => server/home/home.admin.jinja} | 0 .../create.jinja => server/home/home.create.jinja} | 0 .../home/home.jinja => server/home/home.root.jinja} | 0 4 files changed, 6 insertions(+), 4 deletions(-) rename amanuensis/server/{home.py => home/__init__.py} (88%) rename amanuensis/{templates/home/admin.jinja => server/home/home.admin.jinja} (100%) rename amanuensis/{templates/home/create.jinja => server/home/home.create.jinja} (100%) rename amanuensis/{templates/home/home.jinja => server/home/home.root.jinja} (100%) diff --git a/amanuensis/server/home.py b/amanuensis/server/home/__init__.py similarity index 88% rename from amanuensis/server/home.py rename to amanuensis/server/home/__init__.py index 6d3a0cf..ebe6e7d 100644 --- a/amanuensis/server/home.py +++ b/amanuensis/server/home/__init__.py @@ -9,7 +9,9 @@ from amanuensis.server.helpers import admin_required from amanuensis.user import load_all_users -bp_home = Blueprint('home', __name__, url_prefix='/home') +bp_home = Blueprint('home', __name__, + url_prefix='/home', + template_folder='.') @bp_home.route('/', methods=['GET']) @@ -24,7 +26,7 @@ def home(): elif lexicon.cfg.join.public: public_lexicons.append(lexicon) return render_template( - 'home/home.jinja', + 'home.root.jinja', user_lexicons=user_lexicons, public_lexicons=public_lexicons) @@ -36,7 +38,7 @@ def admin(): root: RootConfigDirectoryContext = current_app.config['root'] users = list(load_all_users(root)) lexicons = list(load_all_lexicons(root)) - return render_template('home/admin.jinja', users=users, lexicons=lexicons) + return render_template('home.admin.jinja', users=users, lexicons=lexicons) @bp_home.route("/admin/create/", methods=['GET', 'POST']) @@ -55,4 +57,4 @@ def admin_create(): cfg.prompt = prompt return redirect(url_for('lexicon.session', name=lexicon_name)) - return render_template('home/create.jinja', form=form) + return render_template('home.create.jinja', form=form) diff --git a/amanuensis/templates/home/admin.jinja b/amanuensis/server/home/home.admin.jinja similarity index 100% rename from amanuensis/templates/home/admin.jinja rename to amanuensis/server/home/home.admin.jinja diff --git a/amanuensis/templates/home/create.jinja b/amanuensis/server/home/home.create.jinja similarity index 100% rename from amanuensis/templates/home/create.jinja rename to amanuensis/server/home/home.create.jinja diff --git a/amanuensis/templates/home/home.jinja b/amanuensis/server/home/home.root.jinja similarity index 100% rename from amanuensis/templates/home/home.jinja rename to amanuensis/server/home/home.root.jinja