Add skeleton for lexicon pages
This commit is contained in:
parent
5c244855eb
commit
221790b00e
@ -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
|
||||
|
17
amanuensis/templates/lexicon/lexicon.html
Normal file
17
amanuensis/templates/lexicon/lexicon.html
Normal 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()] %}
|
11
amanuensis/templates/lexicon/session.html
Normal file
11
amanuensis/templates/lexicon/session.html
Normal 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()] %}
|
Loading…
Reference in New Issue
Block a user