From 75d82025e0e85fa58be7b05fba547d07d5a128a7 Mon Sep 17 00:00:00 2001 From: Burathar Date: Sat, 18 Jul 2020 00:23:52 +0200 Subject: [PATCH] Split game_dashboard into separate files per player type --- app/templates/_game_player_info.html | 18 +++ ...shboard.html => game_bunny_dashboard.html} | 0 app/templates/game_hunter_dashboard.html | 80 ++++++++++ app/templates/game_owner_dashboard.html | 137 ++++++++++++++++++ 4 files changed, 235 insertions(+) create mode 100644 app/templates/_game_player_info.html rename app/templates/{game_dashboard.html => game_bunny_dashboard.html} (100%) create mode 100644 app/templates/game_hunter_dashboard.html create mode 100644 app/templates/game_owner_dashboard.html diff --git a/app/templates/_game_player_info.html b/app/templates/_game_player_info.html new file mode 100644 index 0000000..b1d512c --- /dev/null +++ b/app/templates/_game_player_info.html @@ -0,0 +1,18 @@ +

Game Info

+
+ + + + + + + + + + + + + + +
My Role{{ current_user.}}
Start Time10:00
End Time18:00
+
\ No newline at end of file diff --git a/app/templates/game_dashboard.html b/app/templates/game_bunny_dashboard.html similarity index 100% rename from app/templates/game_dashboard.html rename to app/templates/game_bunny_dashboard.html diff --git a/app/templates/game_hunter_dashboard.html b/app/templates/game_hunter_dashboard.html new file mode 100644 index 0000000..4528bf0 --- /dev/null +++ b/app/templates/game_hunter_dashboard.html @@ -0,0 +1,80 @@ +{% extends 'base.html' %} + +{% block head %} +{{ super() }} + + +{% endblock %} + +{% block app_content %} +

{{ game.name }} Dashboard

+{% include '_game_player_info.html' %} +

Bunnies:

+
+ + + + + + + + + + {% for player in game.bunnies() %} + + + + + + {% endfor %} + +
Player NameTimes CaughtLast location
{{ player.name }}{{ player.caught_by_players | selectattr('game', '==', game)|list|length}}{% with location = player.last_location(game) %} + {% if location %}{{ moment(location.timestamp).fromNow()}}: {% endif %} + {{ location }} + {% endwith %}
+
+
+ +{% endblock %} + +{% block scripts %} +{{ super() }} +{{ moment.include_moment() }} + +{% endblock %} \ No newline at end of file diff --git a/app/templates/game_owner_dashboard.html b/app/templates/game_owner_dashboard.html new file mode 100644 index 0000000..4da5150 --- /dev/null +++ b/app/templates/game_owner_dashboard.html @@ -0,0 +1,137 @@ +{% extends 'base.html' %} + +{% block head %} +{{ super() }} + + +{% endblock %} + +{% block app_content %} +

{{ game.name }} Dashboard

+ +

Players:

+

Add player

+
+ + + + + + + + + + + + + + {% for player in game.players %} + + + {% for gameplayer in player.player_games if gameplayer.game == game %} + + {% endfor %} + + + + + + + {% endfor %} + +
Player NameRoleObjectives foundBunnies CaughtBeen CaughtLast location
{{ player.name }}{{ gameplayer.role.name }}{{ player.found_objectives | selectattr('game', '==', game)|list|length}}{{ player.caught_players | selectattr('game', '==', game)|list|length}}{{ player.caught_by_players | selectattr('game', '==', game)|list|length}}{% with location = player.last_location(game) %} + {% if location %}{{ moment(location.timestamp).fromNow()}}: {% endif %} + {{ location }} + {% endwith %} + +
+
+

Objectives:

+

Add new objective

+{% if game.objectives %} +
+ + + + + + + + + + + + + {% for objective in game.objectives %} + + + + + + + + + {% endfor %} + +
Objective NameLatitudeLongitudeTimes foundHash
{{ objective.name }}{{ objective.latitude }}{{ objective.longitude }}{{ objective.found_by|length }}{{ objective.hash }} + +
+
+
+{% endif %} + + +{% endblock %} + +{% block scripts %} +{{ super() }} +{{ moment.include_moment() }} + +{% endblock %} \ No newline at end of file