@ -28,9 +28,14 @@
{% for bunny in game.bunnies() %}
{% for bunny in game.bunnies() %}
< tr >
< tr >
< td > {{ bunny.user.name }}< / td >
< td > {{ bunny.user.name }}< / td >
< td > < span style = "color:green;" > {{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'accepted') |list|length}}< / span > /
< td > < span
< span style = "color:red;" > {{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'denied') |list|length}}< / span > /
style="color:green;">{{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'accepted') |list|length}}< / span >
< span style = "color:gray;" > {{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'none') |list|length}}< / span >
/
< span
style="color:red;">{{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'denied') |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()}}
{% if location %}{{ moment(location.timestamp).fromNow()}}
@ -39,7 +44,8 @@
{% endif %}
{% 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) }}">
< button class = "btn btn-success btn-sm" > Catch< / button >
< button class = "btn btn-success btn-sm" > Catch< / button >
< / a >
< / a >
< / td >
< / td >
@ -48,7 +54,9 @@
< / tbody >
< / tbody >
< / table >
< / table >
< span style = "font-size: smaller;" >
< span style = "font-size: smaller;" >
(< span style = "color:green;" > Accepted< / span > /< span style = "color:red;" > Denied< / span > /< span style = "color:gray;" > Not reviewed< / span > )
(< span style = "color:green;" > Accepted< / span > /< span style = "color:red;" > Denied< / span > /< span
style="color:gray;">Not
reviewed< / span > )
< / span >
< / span >
< / div >
< / div >
< / div >
< / div >
@ -70,20 +78,22 @@
< script type = "text/javascript" , crossorigin = "anonymous" >
< script type = "text/javascript" , crossorigin = "anonymous" >
// Leaflet Map
// Leaflet Map
map = getMap()
map = getMap()
markers = []
var bunnies = JSON.parse('{{ json.dumps(game.last_locations(game.bunnies(), offset=hunter_delay), cls=location_encoder)|safe }}')
var bunnies = JSON.parse(
'{{ json.dumps(game.last_locations(game.bunnies(), offset=hunter_delay), cls=location_encoder)|safe }}')
for (var i = 0; i < bunnies.length ; i + + ) {
for (var i = 0; i < bunnies.length ; i + + ) {
addPlayerMarker(map, bunnies[i])
addPlayerMarker(map, bunnies[i])
markers.push([bunnies[i].latitude, bunnies[i].longitude])
}
}
var self = JSON.parse('{{ json.dumps(current_user.last_location(game ), cls=location_encoder)|safe }}')
var self = JSON.parse('{{ json.dumps(current_user.last_location(), cls=location_encoder)|safe }}')
if (self) {
if (self) {
addPlayerMarker(map, self, greenPlayerIcon)
addPlayerMarker(map, self, greenPlayerIcon)
markers.push([self.latitude, self.longitude])
}
}
map.fitBounds(
if (markers.length > 0) {
bunnies.map(o => [o.latitude, o.longitude]).concat([self].map(p => [p.latitude, p.longitude]))
map.fitBounds(markers);
);
}
< / script >
< / script >
{% endblock %}
{% endblock %}