From 2c63556548cb372a5ee10455ad776bf3417f6f50 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Wed, 29 Jan 2020 23:19:17 -0800 Subject: [PATCH] Add anonymous mode for lexicon dashboard --- amanuensis/templates/macros.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/amanuensis/templates/macros.html b/amanuensis/templates/macros.html index ba85281..60e6d94 100644 --- a/amanuensis/templates/macros.html +++ b/amanuensis/templates/macros.html @@ -1,13 +1,25 @@ -{% macro dashboard_lexicon_item(lexicon) %} +{% macro dashboard_lexicon_item(lexicon, anonymize) %}

- Lexicon {{ lexicon.name }} + + Lexicon {{ lexicon.name }} [{{ lexicon.status().capitalize() }}]

{{ lexicon.prompt }}

-

Editor: {{ lexicon.editor|user_attr('username') }} / Players: {% for uid in lexicon.join.joined[:-1] %}{{ uid|user_attr('username') }}, {% endfor %}{{ lexicon.join.joined[-1]|user_attr('username') }}

+

+ {% if anonymize %} + Players: {{ lexicon.join.joined|count }}/{{ lexicon.join.max_players }} + {% else %} + Editor: + {{ lexicon.editor|user_attr('username') }} / Players: + {% for uid in lexicon.join.joined[:-1] %} + {{ uid|user_attr('username') }}, + {% endfor %} + {{ lexicon.join.joined[-1]|user_attr('username') }} + {% endif %} +

{% endmacro %}