diff --git a/amanuensis/server/lexicon.py b/amanuensis/server/lexicon.py index cbbd358..c6f9a4b 100644 --- a/amanuensis/server/lexicon.py +++ b/amanuensis/server/lexicon.py @@ -17,12 +17,14 @@ def get_bp(): @bp.route('/contents/', methods=['GET']) @login_required def contents(name): - return "Lexicon " + str(name) + lex = lexicon.LexiconModel.by(name=name) + return render_template('lexicon/contents.html', lexicon=lex) @bp.route('/rules/', methods=['GET']) @login_required def rules(name): - return "Lexicon " + str(name) + lex = lexicon.LexiconModel.by(name=name) + return render_template('lexicon/rules.html', lexicon=lex) @bp.route('/session/', methods=['GET']) @login_required @@ -33,6 +35,7 @@ def get_bp(): @bp.route('/statistics/', methods=['GET']) @login_required def stats(name): - return "Lexicon " + str(name) + lex = lexicon.LexiconModel.by(name=name) + return render_template('lexicon/statistics.html', lexicon=lex) return bp diff --git a/amanuensis/templates/lexicon/contents.html b/amanuensis/templates/lexicon/contents.html new file mode 100644 index 0000000..14e64fe --- /dev/null +++ b/amanuensis/templates/lexicon/contents.html @@ -0,0 +1,11 @@ +{% extends "lexicon/lexicon.html" %} +{% block title %}Session | {{ lexicon_title }}{% endblock %} + +{% block main %} + +

Contents

+ +{% set lexicons = current_user.lexicons_in() %} + +{% endblock %} +{% set template_content_blocks = [self.main()] %} \ No newline at end of file diff --git a/amanuensis/templates/lexicon/lexicon.html b/amanuensis/templates/lexicon/lexicon.html index 36103ec..3a1e5d8 100644 --- a/amanuensis/templates/lexicon/lexicon.html +++ b/amanuensis/templates/lexicon/lexicon.html @@ -1,12 +1,20 @@ {% extends "page_2col.html" %} -{% block header %}

{{ lexicon.title }}

{% endblock %} +{% if lexicon.title %} +{% set lexicon_title = lexicon.title %} +{% else %} +{% set lexicon_title = "Lexicon " + lexicon.name %} +{% endif %} + +{% block header %} +

{{ lexicon_title }}

+{% endblock %} {% block sb_logo %}{% endblock %} {% block sb_home %}Home{% endblock %} {% block sb_contents %}Contents{% endblock %} {% block sb_rules %}Rules{% endblock %} {% block sb_session %}Session{% endblock %} -{% block sb_stats %}Stats{% endblock %} +{% block sb_stats %}Statistics{% endblock %} {% set template_sidebar_rows = [ self.sb_logo(), diff --git a/amanuensis/templates/lexicon/rules.html b/amanuensis/templates/lexicon/rules.html new file mode 100644 index 0000000..6c13bb9 --- /dev/null +++ b/amanuensis/templates/lexicon/rules.html @@ -0,0 +1,11 @@ +{% extends "lexicon/lexicon.html" %} +{% block title %}Rules | {{ lexicon_title }}{% endblock %} + +{% block main %} + +

Rules

+ +{% set lexicons = current_user.lexicons_in() %} + +{% endblock %} +{% set template_content_blocks = [self.main()] %} \ No newline at end of file diff --git a/amanuensis/templates/lexicon/session.html b/amanuensis/templates/lexicon/session.html index 93d4d4e..a851065 100644 --- a/amanuensis/templates/lexicon/session.html +++ b/amanuensis/templates/lexicon/session.html @@ -1,5 +1,5 @@ {% extends "lexicon/lexicon.html" %} -{% block title %}Session | {{ lexicon.name }}{% endblock %} +{% block title %}Session | {{ lexicon_title }}{% endblock %} {% block main %} diff --git a/amanuensis/templates/lexicon/statistics.html b/amanuensis/templates/lexicon/statistics.html new file mode 100644 index 0000000..fece5a3 --- /dev/null +++ b/amanuensis/templates/lexicon/statistics.html @@ -0,0 +1,11 @@ +{% extends "lexicon/lexicon.html" %} +{% block title %}Session | {{ lexicon_title }}{% endblock %} + +{% block main %} + +

Statistics

+ +{% set lexicons = current_user.lexicons_in() %} + +{% endblock %} +{% set template_content_blocks = [self.main()] %} \ No newline at end of file