From c288612fc9e68bf28150605337593bc3109bfca5 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 3 Sep 2019 19:21:40 +0200 Subject: [PATCH] Add trivia score to Royalnet profile --- royalnet/web/royalprints/profile/__init__.py | 2 +- royalnet/web/royalprints/profile/templates/profile_page.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/royalnet/web/royalprints/profile/__init__.py b/royalnet/web/royalprints/profile/__init__.py index 252b2a5a..21a756db 100644 --- a/royalnet/web/royalprints/profile/__init__.py +++ b/royalnet/web/royalprints/profile/__init__.py @@ -12,7 +12,7 @@ from ....utils.wikirender import prepare_page_markdown, RenderError tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates') rp = Royalprint("profile", __name__, url_prefix="/profile", template_folder=tmpl_dir, required_tables={Royal, ActiveKvGroup, Alias, Diario, Discord, Keygroup, Keyvalue, Telegram, WikiPage, - WikiRevision, Bio}) + WikiRevision, Bio, TriviaScore}) @rp.route("/") diff --git a/royalnet/web/royalprints/profile/templates/profile_page.html b/royalnet/web/royalprints/profile/templates/profile_page.html index 7e8efdfa..55e8e091 100644 --- a/royalnet/web/royalprints/profile/templates/profile_page.html +++ b/royalnet/web/royalprints/profile/templates/profile_page.html @@ -74,6 +74,11 @@ {% else %}
  • Kvgroup attivo: Nessuno
  • {% endif %} + {% if royal.trivia_score %} +
  • Punteggio trivia: {{ royal.trivia_score.correct_answers }}/{{ royal.trivia_score.total_answers }}
  • + {% else %} +
  • Punteggio trivia: 0/0
  • + {% endif %}