Add skeleton for lexicon pages

This commit is contained in:
Tim Van Baak 2020-01-20 08:55:28 -08:00
parent 5c244855eb
commit 221790b00e
3 changed files with 44 additions and 0 deletions

View File

@ -14,9 +14,25 @@ def get_bp():
"""Create a blueprint for lexicon pages"""
bp = Blueprint('lexicon', __name__, url_prefix='/lexicon/<name>')
@bp.route('/contents/', methods=['GET'])
@login_required
def contents(name):
return "Lexicon " + str(name)
@bp.route('/rules/', methods=['GET'])
@login_required
def rules(name):
return "Lexicon " + str(name)
@bp.route('/session/', methods=['GET'])
@login_required
def session(name):
lex = lexicon.LexiconModel.by(name=name)
return render_template('lexicon/session.html', lexicon=lex)
@bp.route('/statistics/', methods=['GET'])
@login_required
def stats(name):
return "Lexicon " + str(name)
return bp

View File

@ -0,0 +1,17 @@
{% extends "page_2col.html" %}
{% block header %}<h2>{{ lexicon.title }}</h2>{% endblock %}
{% block sb_logo %}{% endblock %}
{% block sb_home %}<a href="{{ url_for('home.home') }}">Home</a>{% endblock %}
{% block sb_contents %}<a href="{{ url_for('lexicon.contents', name=lexicon.name) }}">Contents</a>{% endblock %}
{% block sb_rules %}<a href="{{ url_for('lexicon.rules', name=lexicon.name) }}">Rules</a>{% endblock %}
{% block sb_session %}<a href="{{ url_for('lexicon.session', name=lexicon.name) }}">Session</a>{% endblock %}
{% block sb_stats %}<a href="{{ url_for('lexicon.stats', name=lexicon.name) }}">Stats</a>{% endblock %}
{% set template_sidebar_rows = [
self.sb_logo(),
self.sb_home(),
self.sb_contents(),
self.sb_rules(),
self.sb_session(),
self.sb_stats()] %}

View File

@ -0,0 +1,11 @@
{% extends "lexicon/lexicon.html" %}
{% block title %}Session | {{ lexicon.name }}{% endblock %}
{% block main %}
<h1>Session</h1>
{% set lexicons = current_user.lexicons_in() %}
{% endblock %}
{% set template_content_blocks = [self.main()] %}