Rename lexicon templates

This commit is contained in:
Tim Van Baak 2020-04-24 17:50:07 -07:00
parent 8732d998cf
commit 07d590bee4
12 changed files with 24 additions and 24 deletions

View File

@ -48,7 +48,7 @@ def get_bp():
flash("Could not join game") flash("Could not join game")
return redirect(url_for("home.home", name=name)) 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']) @bp.route('/contents/', methods=['GET'])
@lexicon_param @lexicon_param
@ -62,7 +62,7 @@ def get_bp():
'title': a.title, 'title': a.title,
'link': url_for('lexicon.article', name=name, title=filesafe_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/<title>') @bp.route('/article/<title>')
@lexicon_param @lexicon_param
@ -70,13 +70,13 @@ def get_bp():
def article(name, title): def article(name, title):
with g.lexicon_.ctx.article.read(title) as a: with g.lexicon_.ctx.article.read(title) as a:
article = { **a, 'html': Markup(a['html']) } 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']) @bp.route('/rules/', methods=['GET'])
@lexicon_param @lexicon_param
@player_required_if_not_public @player_required_if_not_public
def rules(name): def rules(name):
return render_template('lexicon/rules.html') return render_template('lexicon/rules.jinja')
@bp.route('/session/', methods=['GET']) @bp.route('/session/', methods=['GET'])
@lexicon_param @lexicon_param
@ -93,7 +93,7 @@ def get_bp():
if draft.status.approved: if draft.status.approved:
approved.append(draft) approved.append(draft)
return render_template( return render_template(
'lexicon/session.html', 'lexicon/session.jinja',
ready_articles=drafts, ready_articles=drafts,
approved_articles=approved) approved_articles=approved)
@ -107,7 +107,7 @@ def get_bp():
if not form.is_submitted(): if not form.is_submitted():
# On GET, populate with the character # On GET, populate with the character
form.for_character(g.lexicon, cid) 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): def create_character(name, form):
if form.validate_on_submit(): if form.validate_on_submit():
@ -123,7 +123,7 @@ def get_bp():
if not form.is_submitted(): if not form.is_submitted():
# On GET, populate form for new character # On GET, populate form for new character
form.for_new() 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']) @bp.route('/session/character/', methods=['GET', 'POST'])
@lexicon_param @lexicon_param
@ -152,17 +152,17 @@ def get_bp():
# Load the config for the lexicon on load # Load the config for the lexicon on load
if not form.is_submitted(): if not form.is_submitted():
form.populate_from_lexicon(g.lexicon) 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 form.validate():
if not form.update_lexicon(g.lexicon): if not form.update_lexicon(g.lexicon):
flash("Error updating settings") flash("Error updating settings")
return render_template("lexicon/settings.html", form=form) return render_template("lexicon/settings.jinja", form=form)
flash("Settings updated") flash("Settings updated")
return redirect(url_for('lexicon.session', name=name)) return redirect(url_for('lexicon.session', name=name))
flash("Validation error") 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']) @bp.route('/session/review/', methods=['GET', 'POST'])
@lexicon_param @lexicon_param
@ -205,7 +205,7 @@ def get_bp():
form = None form = None
return render_template( return render_template(
"lexicon/review.html", "lexicon/review.jinja",
form=form, form=form,
article_html=Markup(rendered_html)) article_html=Markup(rendered_html))
@ -213,7 +213,7 @@ def get_bp():
@lexicon_param @lexicon_param
@player_required_if_not_public @player_required_if_not_public
def stats(name): def stats(name):
return render_template('lexicon/statistics.html') return render_template('lexicon/statistics.jinja')
@bp.route('/session/editor/', methods=['GET']) @bp.route('/session/editor/', methods=['GET'])
@lexicon_param @lexicon_param
@ -238,7 +238,7 @@ def get_bp():
if any([article.character == char.cid for char in characters]) if any([article.character == char.cid for char in characters])
] ]
return render_template( return render_template(
'lexicon/editor.html', 'lexicon/editor.jinja',
characters=characters, characters=characters,
articles=articles, articles=articles,
jsonfmt=jsonfmt) jsonfmt=jsonfmt)
@ -262,7 +262,7 @@ def get_bp():
if article.character == character.cid if article.character == character.cid
] ]
return render_template( return render_template(
'lexicon/editor.html', 'lexicon/editor.jinja',
character=character, character=character,
articles=articles, articles=articles,
jsonfmt=jsonfmt) jsonfmt=jsonfmt)
@ -276,7 +276,7 @@ def get_bp():
return redirect(url_for('lexicon.session', name=name)) return redirect(url_for('lexicon.session', name=name))
return render_template( return render_template(
'lexicon/editor.html', 'lexicon/editor.jinja',
character=character, character=character,
article=article, article=article,
jsonfmt=jsonfmt) jsonfmt=jsonfmt)

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% block title %}{{ article.title }} | {{ lexicon_title }}{% endblock %} {% block title %}{{ article.title }} | {{ lexicon_title }}{% endblock %}
{% block main %} {% block main %}

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% block title %}Character | {{ lexicon_title }}{% endblock %} {% block title %}Character | {{ lexicon_title }}{% endblock %}
{% block main %} {% block main %}

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% set current_page = "contents" %} {% set current_page = "contents" %}
{% block title %}Index | {{ lexicon_title }}{% endblock %} {% block title %}Index | {{ lexicon_title }}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% block title %}Join | {{ lexicon_title }}{% endblock %} {% block title %}Join | {{ lexicon_title }}{% endblock %}
{% block main %} {% block main %}

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% block title %}Review | {{ lexicon_title }}{% endblock %} {% block title %}Review | {{ lexicon_title }}{% endblock %}
{% block article %} {% block article %}

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% set current_page = "rules" %} {% set current_page = "rules" %}
{% block title %}Rules | {{ lexicon_title }}{% endblock %} {% block title %}Rules | {{ lexicon_title }}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% set current_page = "session" %} {% set current_page = "session" %}
{% block title %}Session | {{ lexicon_title }}{% endblock %} {% block title %}Session | {{ lexicon_title }}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% block title %}Edit | {{ lexicon_title }}{% endblock %} {% block title %}Edit | {{ lexicon_title }}{% endblock %}
{% block info %} {% block info %}

View File

@ -1,4 +1,4 @@
{% extends "lexicon/lexicon.html" %} {% extends "lexicon/lexicon.jinja" %}
{% set current_page = "statistics" %} {% set current_page = "statistics" %}
{% block title %}Session | {{ lexicon_title }}{% endblock %} {% block title %}Session | {{ lexicon_title }}{% endblock %}