From cf359e2c6b8f13987b04b32bf84595369818c921 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Thu, 3 Feb 2022 16:37:34 -0600 Subject: [PATCH] apparently some skills have no icon add jinja debug helper restrict char_xml to gm 9 strip quoted from local desc --- app/__init__.py | 4 ++++ app/characters.py | 2 ++ app/luclient.py | 2 ++ app/templates/partials/charxml/_stats.html.j2 | 10 ++++++---- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index e165381..e1879cc 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -57,6 +57,10 @@ def create_app(): if cdclient is not None: cdclient.close() + @app.template_filter('debug') + def debug(text): + print(text) + # add the commands to flask cli app.cli.add_command(init_db) app.cli.add_command(init_accounts) diff --git a/app/characters.py b/app/characters.py index 8c5b6aa..f6d53a9 100644 --- a/app/characters.py +++ b/app/characters.py @@ -89,6 +89,7 @@ def view(id): @character_blueprint.route('/view_xml/', methods=['GET']) @login_required +@gm_level(9) def view_xml(id): character_data = CharacterInfo.query.filter(CharacterInfo.id == id).first() @@ -107,6 +108,7 @@ def view_xml(id): @character_blueprint.route('/get_xml/', methods=['GET']) @login_required +@gm_level(9) def get_xml(id): character_data = CharacterInfo.query.filter(CharacterInfo.id == id).first() diff --git a/app/luclient.py b/app/luclient.py index 4f6415a..cb4f0fc 100644 --- a/app/luclient.py +++ b/app/luclient.py @@ -271,6 +271,8 @@ def register_luclient_jinja_helpers(app): )[0] if desc in ("", None): desc = None + if desc: + desc = desc.strip('"') return desc @app.template_filter('get_item_set') diff --git a/app/templates/partials/charxml/_stats.html.j2 b/app/templates/partials/charxml/_stats.html.j2 index 4ff2846..e8bc582 100644 --- a/app/templates/partials/charxml/_stats.html.j2 +++ b/app/templates/partials/charxml/_stats.html.j2 @@ -27,10 +27,12 @@ {% set skill_desc = skill[0]|get_skill_desc %} {% if "IP" not in skill_desc and "AP" not in skill_desc and "LP" not in skill_desc and skill[0]|string not in skill_desc %}
- Skill: + {% if skill[1]%} + Skill: + {% endif %} {{ skill[0]|get_skill_desc }}
{% endif %}