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 @@
<span style="color:gray;">{{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'none') |list|length}}</span> <span style="color:gray;">{{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'none') |list|length}}</span>
</td> </td>
<td>{% with location = bunny.last_location(offset=hunter_delay) %} <td>{% with location = bunny.last_location(offset=hunter_delay) %}
{% if location %}{{ moment(location.timestamp).fromNow()}}: {% endif %} {% if location %}{{ moment(location.timestamp).fromNow()}}
{% else %}
{{ location }} {{ location }}
{% endif %}
{% endwith %}</td> {% endwith %}</td>
<td> <td>
<a href="{{ url_for('main.catch_bunny', game_name=game.name, bunny_name=bunny.user.name) }}"> <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 @@
<td>{{ player.accepted_caught_players() | list | length }}</td> <td>{{ player.accepted_caught_players() | list | length }}</td>
<td>{{ player.accepted_caught_by_players() | list | length }}</td> <td>{{ player.accepted_caught_by_players() | list | length }}</td>
<td>{% with location = player.last_location() %} <td>{% with location = player.last_location() %}
{% if location %}{{ moment(location.timestamp).fromNow()}}: {% endif %} {% if location %}{{ moment(location.timestamp).fromNow()}}
{{ location }} {% else %}
{{ location }}
{% endif %}
{% endwith %}</td> {% endwith %}</td>
<td><a href="{{ url_for('main.remove_player', game_name=game.name, username=player.user.name) }}"> <td><a href="{{ url_for('main.remove_player', game_name=game.name, username=player.user.name) }}">
<button class="btn btn-danger">Delete</button></a> <button class="btn btn-danger">Delete</button></a>
@ -110,7 +112,7 @@
for (var i = 0; i < objectives.length; i++){ for (var i = 0; i < objectives.length; i++){
addObjectiveMarker(map, objectives[i]) addObjectiveMarker(map, objectives[i])
} }
var players = JSON.parse('{{ json.dumps(game.last_player_locations(), cls=location_encoder)|safe }}') var players = JSON.parse('{{ json.dumps(game.last_player_locations(), cls=location_encoder)|safe }}')
for (var i = 0; i < players.length; i++){ for (var i = 0; i < players.length; i++){
addPlayerMarker(map, players[i]) addPlayerMarker(map, players[i])
@ -124,4 +126,4 @@
} }
</script> </script>
{% endblock %} {% endblock %}

Loading…
Cancel
Save