From 05efb236ce74c6eba2cf454b90fa02ccf72a31d6 Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Wed, 22 Jul 2020 22:57:56 +0200 Subject: [PATCH] Give no location in tables --- app/templates/game_hunter_dashboard.html | 4 +++- app/templates/game_owner_dashboard.html | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/templates/game_hunter_dashboard.html b/app/templates/game_hunter_dashboard.html index e3f27c2..c156736 100644 --- a/app/templates/game_hunter_dashboard.html +++ b/app/templates/game_hunter_dashboard.html @@ -33,8 +33,10 @@ {{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'none') |list|length}} {% with location = bunny.last_location(offset=hunter_delay) %} - {% if location %}{{ moment(location.timestamp).fromNow()}}: {% endif %} + {% if location %}{{ moment(location.timestamp).fromNow()}} + {% else %} {{ location }} + {% endif %} {% endwith %} diff --git a/app/templates/game_owner_dashboard.html b/app/templates/game_owner_dashboard.html index 4de0403..39d60d1 100644 --- a/app/templates/game_owner_dashboard.html +++ b/app/templates/game_owner_dashboard.html @@ -39,8 +39,10 @@ {{ player.accepted_caught_players() | list | length }} {{ player.accepted_caught_by_players() | list | length }} {% with location = player.last_location() %} - {% if location %}{{ moment(location.timestamp).fromNow()}}: {% endif %} - {{ location }} + {% if location %}{{ moment(location.timestamp).fromNow()}} + {% else %} + {{ location }} + {% endif %} {% endwith %} @@ -110,7 +112,7 @@ for (var i = 0; i < objectives.length; i++){ addObjectiveMarker(map, objectives[i]) } - + var players = JSON.parse('{{ json.dumps(game.last_player_locations(), cls=location_encoder)|safe }}') for (var i = 0; i < players.length; i++){ addPlayerMarker(map, players[i]) @@ -124,4 +126,4 @@ } -{% endblock %} \ No newline at end of file +{% endblock %}