Move home templates into server submodule

This commit is contained in:
Tim Van Baak 2020-04-24 17:53:46 -07:00
parent 07d590bee4
commit 1ead09cf47
4 changed files with 6 additions and 4 deletions

View File

@ -9,7 +9,9 @@ from amanuensis.server.helpers import admin_required
from amanuensis.user import load_all_users 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']) @bp_home.route('/', methods=['GET'])
@ -24,7 +26,7 @@ def home():
elif lexicon.cfg.join.public: elif lexicon.cfg.join.public:
public_lexicons.append(lexicon) public_lexicons.append(lexicon)
return render_template( return render_template(
'home/home.jinja', 'home.root.jinja',
user_lexicons=user_lexicons, user_lexicons=user_lexicons,
public_lexicons=public_lexicons) public_lexicons=public_lexicons)
@ -36,7 +38,7 @@ def admin():
root: RootConfigDirectoryContext = current_app.config['root'] root: RootConfigDirectoryContext = current_app.config['root']
users = list(load_all_users(root)) users = list(load_all_users(root))
lexicons = list(load_all_lexicons(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']) @bp_home.route("/admin/create/", methods=['GET', 'POST'])
@ -55,4 +57,4 @@ def admin_create():
cfg.prompt = prompt cfg.prompt = prompt
return redirect(url_for('lexicon.session', name=lexicon_name)) 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)