diff --git a/amanuensis/server/__init__.py b/amanuensis/server/__init__.py index 4b04664..1e799a5 100644 --- a/amanuensis/server/__init__.py +++ b/amanuensis/server/__init__.py @@ -5,7 +5,8 @@ from amanuensis.models import ModelFactory from amanuensis.server.auth import get_login_manager, bp_auth from amanuensis.server.helpers import register_custom_filters from amanuensis.server.home import bp_home -# from amanuensis.server.lexicon import bp_lexicon +from amanuensis.server.lexicon import bp_lexicon +from amanuensis.server.session import bp_session def get_app(root: RootConfigDirectoryContext) -> Flask: @@ -30,9 +31,7 @@ def get_app(root: RootConfigDirectoryContext) -> Flask: # Blueprint inits app.register_blueprint(bp_auth) app.register_blueprint(bp_home) - # app.register_blueprint(bp_lexicon) - - # import code - # code.interact(local=locals()) + app.register_blueprint(bp_lexicon) + app.register_blueprint(bp_session) return app diff --git a/amanuensis/server/helpers.py b/amanuensis/server/helpers.py index 77cfada..841d6a3 100644 --- a/amanuensis/server/helpers.py +++ b/amanuensis/server/helpers.py @@ -32,7 +32,7 @@ def register_custom_filters(app): def article_link(title): return url_for( 'lexicon.article', - name=g.lexicon.name, + name=g.lexicon.cfg.name, title=filesafe_title(title)) @@ -102,6 +102,6 @@ def editor_required(route): def editor_route(*args, **kwargs): if current_user.uid != g.lexicon.cfg.editor: flash("You must be the editor to view this page") - return redirect(url_for('lexicon.contents', name=g.lexicon.name)) + return redirect(url_for('lexicon.contents', name=g.lexicon.cfg.name)) return route(*args, **kwargs) return editor_route diff --git a/amanuensis/server/lexicon.jinja b/amanuensis/server/lexicon.jinja index 3bcee3f..0431219 100644 --- a/amanuensis/server/lexicon.jinja +++ b/amanuensis/server/lexicon.jinja @@ -1,13 +1,9 @@ {% extends "page_2col.jinja" %} -{% if g.lexicon.title %} {% set lexicon_title = g.lexicon.title %} -{% else %} -{% set lexicon_title = "Lexicon " + g.lexicon.name %} -{% endif %} {% block header %}
{{ g.lexicon.prompt }}
+{{ g.lexicon.cfg.prompt }}
{% endblock %} {% block sb_logo %}{% endblock %} @@ -15,19 +11,19 @@ {% endblock %} {% block sb_contents %}Contents{% endblock %} {% block sb_rules %}Rules{% endblock %} {% block sb_session %}Session{% endblock %} {% block sb_stats %}Statistics{% endblock %} {% set template_sidebar_rows = [ diff --git a/amanuensis/server/lexicon/__init__.py b/amanuensis/server/lexicon/__init__.py index 0c7d40b..f75f449 100644 --- a/amanuensis/server/lexicon/__init__.py +++ b/amanuensis/server/lexicon/__init__.py @@ -39,7 +39,7 @@ def join(name): # Gate on join validity if player_can_join_lexicon(current_user, g.lexicon, form.password.data): add_player_to_lexicon(current_user, g.lexicon) - return redirect(url_for("lexicon.contents", name=name)) # SESSION + return redirect(url_for('session.session', name=name)) else: flash("Could not join game") return redirect(url_for("home.home", name=name)) diff --git a/amanuensis/server/lexicon/lexicon.join.jinja b/amanuensis/server/lexicon/lexicon.join.jinja index 5f22f08..7f33e6a 100644 --- a/amanuensis/server/lexicon/lexicon.join.jinja +++ b/amanuensis/server/lexicon/lexicon.join.jinja @@ -5,7 +5,7 @@