Browse Source

Give no location in tables

testing
Rogier Neeleman 4 years ago
parent
commit
05efb236ce
  1. 4
      app/templates/game_hunter_dashboard.html
  2. 10
      app/templates/game_owner_dashboard.html

4
app/templates/game_hunter_dashboard.html

@ -33,8 +33,10 @@ @@ -33,8 +33,10 @@
<span style="color:gray;">{{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'none') |list|length}}</span>
</td>
<td>{% 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 %}</td>
<td>
<a href="{{ url_for('main.catch_bunny', game_name=game.name, bunny_name=bunny.user.name) }}">

10
app/templates/game_owner_dashboard.html

@ -39,8 +39,10 @@ @@ -39,8 +39,10 @@
<td>{{ player.accepted_caught_players() | list | length }}</td>
<td>{{ player.accepted_caught_by_players() | list | length }}</td>
<td>{% with location = player.last_location() %}
{% if location %}{{ moment(location.timestamp).fromNow()}}: {% endif %}
{{ location }}
{% if location %}{{ moment(location.timestamp).fromNow()}}
{% else %}
{{ location }}
{% endif %}
{% endwith %}</td>
<td><a href="{{ url_for('main.remove_player', game_name=game.name, username=player.user.name) }}">
<button class="btn btn-danger">Delete</button></a>
@ -110,7 +112,7 @@ @@ -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 @@ @@ -124,4 +126,4 @@
}
</script>
{% endblock %}
{% endblock %}

Loading…
Cancel
Save