From 07d590bee4ec28c69daa51263db8f691e4e21597 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 24 Apr 2020 17:50:07 -0700 Subject: [PATCH] Rename lexicon templates --- amanuensis/server/lexicon.py | 30 +++++++++---------- .../lexicon/{article.html => article.jinja} | 2 +- .../{character.html => character.jinja} | 2 +- .../lexicon/{contents.html => contents.jinja} | 2 +- .../lexicon/{editor.html => editor.jinja} | 0 .../lexicon/{join.html => join.jinja} | 2 +- .../lexicon/{lexicon.html => lexicon.jinja} | 0 .../lexicon/{review.html => review.jinja} | 2 +- .../lexicon/{rules.html => rules.jinja} | 2 +- .../lexicon/{session.html => session.jinja} | 2 +- .../lexicon/{settings.html => settings.jinja} | 2 +- .../{statistics.html => statistics.jinja} | 2 +- 12 files changed, 24 insertions(+), 24 deletions(-) rename amanuensis/templates/lexicon/{article.html => article.jinja} (94%) rename amanuensis/templates/lexicon/{character.html => character.jinja} (93%) rename amanuensis/templates/lexicon/{contents.html => contents.jinja} (91%) rename amanuensis/templates/lexicon/{editor.html => editor.jinja} (100%) rename amanuensis/templates/lexicon/{join.html => join.jinja} (92%) rename amanuensis/templates/lexicon/{lexicon.html => lexicon.jinja} (100%) rename amanuensis/templates/lexicon/{review.html => review.jinja} (93%) rename amanuensis/templates/lexicon/{rules.html => rules.jinja} (83%) rename amanuensis/templates/lexicon/{session.html => session.jinja} (98%) rename amanuensis/templates/lexicon/{settings.html => settings.jinja} (99%) rename amanuensis/templates/lexicon/{statistics.html => statistics.jinja} (84%) diff --git a/amanuensis/server/lexicon.py b/amanuensis/server/lexicon.py index 915cfce..3e7ee98 100644 --- a/amanuensis/server/lexicon.py +++ b/amanuensis/server/lexicon.py @@ -48,7 +48,7 @@ def get_bp(): flash("Could not join game") return redirect(url_for("home.home", name=name)) - return render_template('lexicon/join.html', form=form) + return render_template('lexicon/join.jinja', form=form) @bp.route('/contents/', methods=['GET']) @lexicon_param @@ -62,7 +62,7 @@ def get_bp(): 'title': a.title, 'link': url_for('lexicon.article', name=name, title=filesafe_title(a.title)), }) - return render_template('lexicon/contents.html', articles=articles) + return render_template('lexicon/contents.jinja', articles=articles) @bp.route('/article/') @lexicon_param @@ -70,13 +70,13 @@ def get_bp(): def article(name, title): with g.lexicon_.ctx.article.read(title) as a: article = { **a, 'html': Markup(a['html']) } - return render_template('lexicon/article.html', article=article) + return render_template('lexicon/article.jinja', article=article) @bp.route('/rules/', methods=['GET']) @lexicon_param @player_required_if_not_public def rules(name): - return render_template('lexicon/rules.html') + return render_template('lexicon/rules.jinja') @bp.route('/session/', methods=['GET']) @lexicon_param @@ -93,7 +93,7 @@ def get_bp(): if draft.status.approved: approved.append(draft) return render_template( - 'lexicon/session.html', + 'lexicon/session.jinja', ready_articles=drafts, approved_articles=approved) @@ -107,7 +107,7 @@ def get_bp(): if not form.is_submitted(): # On GET, populate with the character form.for_character(g.lexicon, cid) - return render_template('lexicon/character.html', form=form, action='edit') + return render_template('lexicon/character.jinja', form=form, action='edit') def create_character(name, form): if form.validate_on_submit(): @@ -123,7 +123,7 @@ def get_bp(): if not form.is_submitted(): # On GET, populate form for new character form.for_new() - return render_template('lexicon/character.html', form=form, action='create') + return render_template('lexicon/character.jinja', form=form, action='create') @bp.route('/session/character/', methods=['GET', 'POST']) @lexicon_param @@ -152,17 +152,17 @@ def get_bp(): # Load the config for the lexicon on load if not form.is_submitted(): form.populate_from_lexicon(g.lexicon) - return render_template("lexicon/settings.html", form=form) + return render_template("lexicon/settings.jinja", form=form) if form.validate(): if not form.update_lexicon(g.lexicon): flash("Error updating settings") - return render_template("lexicon/settings.html", form=form) + return render_template("lexicon/settings.jinja", form=form) flash("Settings updated") return redirect(url_for('lexicon.session', name=name)) flash("Validation error") - return render_template("lexicon/settings.html", form=form) + return render_template("lexicon/settings.jinja", form=form) @bp.route('/session/review/', methods=['GET', 'POST']) @lexicon_param @@ -205,7 +205,7 @@ def get_bp(): form = None return render_template( - "lexicon/review.html", + "lexicon/review.jinja", form=form, article_html=Markup(rendered_html)) @@ -213,7 +213,7 @@ def get_bp(): @lexicon_param @player_required_if_not_public def stats(name): - return render_template('lexicon/statistics.html') + return render_template('lexicon/statistics.jinja') @bp.route('/session/editor/', methods=['GET']) @lexicon_param @@ -238,7 +238,7 @@ def get_bp(): if any([article.character == char.cid for char in characters]) ] return render_template( - 'lexicon/editor.html', + 'lexicon/editor.jinja', characters=characters, articles=articles, jsonfmt=jsonfmt) @@ -262,7 +262,7 @@ def get_bp(): if article.character == character.cid ] return render_template( - 'lexicon/editor.html', + 'lexicon/editor.jinja', character=character, articles=articles, jsonfmt=jsonfmt) @@ -276,7 +276,7 @@ def get_bp(): return redirect(url_for('lexicon.session', name=name)) return render_template( - 'lexicon/editor.html', + 'lexicon/editor.jinja', character=character, article=article, jsonfmt=jsonfmt) diff --git a/amanuensis/templates/lexicon/article.html b/amanuensis/templates/lexicon/article.jinja similarity index 94% rename from amanuensis/templates/lexicon/article.html rename to amanuensis/templates/lexicon/article.jinja index 66b4766..7e4710e 100644 --- a/amanuensis/templates/lexicon/article.html +++ b/amanuensis/templates/lexicon/article.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% block title %}{{ article.title }} | {{ lexicon_title }}{% endblock %} {% block main %} diff --git a/amanuensis/templates/lexicon/character.html b/amanuensis/templates/lexicon/character.jinja similarity index 93% rename from amanuensis/templates/lexicon/character.html rename to amanuensis/templates/lexicon/character.jinja index 0d00b2a..0a8ea14 100644 --- a/amanuensis/templates/lexicon/character.html +++ b/amanuensis/templates/lexicon/character.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% block title %}Character | {{ lexicon_title }}{% endblock %} {% block main %} diff --git a/amanuensis/templates/lexicon/contents.html b/amanuensis/templates/lexicon/contents.jinja similarity index 91% rename from amanuensis/templates/lexicon/contents.html rename to amanuensis/templates/lexicon/contents.jinja index bc7959a..2b7c2f3 100644 --- a/amanuensis/templates/lexicon/contents.html +++ b/amanuensis/templates/lexicon/contents.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% set current_page = "contents" %} {% block title %}Index | {{ lexicon_title }}{% endblock %} diff --git a/amanuensis/templates/lexicon/editor.html b/amanuensis/templates/lexicon/editor.jinja similarity index 100% rename from amanuensis/templates/lexicon/editor.html rename to amanuensis/templates/lexicon/editor.jinja diff --git a/amanuensis/templates/lexicon/join.html b/amanuensis/templates/lexicon/join.jinja similarity index 92% rename from amanuensis/templates/lexicon/join.html rename to amanuensis/templates/lexicon/join.jinja index 2ec736a..1a26cfb 100644 --- a/amanuensis/templates/lexicon/join.html +++ b/amanuensis/templates/lexicon/join.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% block title %}Join | {{ lexicon_title }}{% endblock %} {% block main %} diff --git a/amanuensis/templates/lexicon/lexicon.html b/amanuensis/templates/lexicon/lexicon.jinja similarity index 100% rename from amanuensis/templates/lexicon/lexicon.html rename to amanuensis/templates/lexicon/lexicon.jinja diff --git a/amanuensis/templates/lexicon/review.html b/amanuensis/templates/lexicon/review.jinja similarity index 93% rename from amanuensis/templates/lexicon/review.html rename to amanuensis/templates/lexicon/review.jinja index 78b89f1..3ee3164 100644 --- a/amanuensis/templates/lexicon/review.html +++ b/amanuensis/templates/lexicon/review.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% block title %}Review | {{ lexicon_title }}{% endblock %} {% block article %} diff --git a/amanuensis/templates/lexicon/rules.html b/amanuensis/templates/lexicon/rules.jinja similarity index 83% rename from amanuensis/templates/lexicon/rules.html rename to amanuensis/templates/lexicon/rules.jinja index f272507..dca2491 100644 --- a/amanuensis/templates/lexicon/rules.html +++ b/amanuensis/templates/lexicon/rules.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% set current_page = "rules" %} {% block title %}Rules | {{ lexicon_title }}{% endblock %} diff --git a/amanuensis/templates/lexicon/session.html b/amanuensis/templates/lexicon/session.jinja similarity index 98% rename from amanuensis/templates/lexicon/session.html rename to amanuensis/templates/lexicon/session.jinja index 550fa6b..c7a4586 100644 --- a/amanuensis/templates/lexicon/session.html +++ b/amanuensis/templates/lexicon/session.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% set current_page = "session" %} {% block title %}Session | {{ lexicon_title }}{% endblock %} diff --git a/amanuensis/templates/lexicon/settings.html b/amanuensis/templates/lexicon/settings.jinja similarity index 99% rename from amanuensis/templates/lexicon/settings.html rename to amanuensis/templates/lexicon/settings.jinja index 6a937c7..113ad46 100644 --- a/amanuensis/templates/lexicon/settings.html +++ b/amanuensis/templates/lexicon/settings.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% block title %}Edit | {{ lexicon_title }}{% endblock %} {% block info %} diff --git a/amanuensis/templates/lexicon/statistics.html b/amanuensis/templates/lexicon/statistics.jinja similarity index 84% rename from amanuensis/templates/lexicon/statistics.html rename to amanuensis/templates/lexicon/statistics.jinja index 7afe417..33ad417 100644 --- a/amanuensis/templates/lexicon/statistics.html +++ b/amanuensis/templates/lexicon/statistics.jinja @@ -1,4 +1,4 @@ -{% extends "lexicon/lexicon.html" %} +{% extends "lexicon/lexicon.jinja" %} {% set current_page = "statistics" %} {% block title %}Session | {{ lexicon_title }}{% endblock %}