From 3bd6bda6e1e5f45a93be3c8cd9199838b7708d1f Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Wed, 22 Jul 2020 18:36:09 +0200 Subject: [PATCH] Update pages for mobile use --- app/static/css/default.css | 0 app/templates/_game_player_info.html | 44 +++++++++++++--------- app/templates/base.html | 5 +++ app/templates/game_bunny_dashboard.html | 25 +++++++++--- app/templates/game_hunter_dashboard.html | 48 ++++++++++++++---------- app/templates/index.html | 24 +++++++++--- 6 files changed, 97 insertions(+), 49 deletions(-) create mode 100644 app/static/css/default.css diff --git a/app/static/css/default.css b/app/static/css/default.css new file mode 100644 index 0000000..e69de29 diff --git a/app/templates/_game_player_info.html b/app/templates/_game_player_info.html index c1d6c65..43d868d 100644 --- a/app/templates/_game_player_info.html +++ b/app/templates/_game_player_info.html @@ -1,21 +1,29 @@

Game Info

-
+
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
My Role{{ current_user.role_in_game(game).name }}
Game State{{ game.state.name }}
Start Time{% if game.start_time %}{{ moment(game.start_time).format('DD-MM-YYYY, hh:mm')}}{% else %}-{% endif %}
End Time{% if game.end_time %}{{ moment(game.end_time).format('DD-MM-YYYY, hh:mm')}}{% else %}-{% endif %}
My Game{{ game.name.title() }}
My Name{{ current_user.name.title() }}
My Role{{ current_user.role_in_game(game).name.title() }}
Game State{{ game.state.name.title() }}
Start Time{% if game.start_time %}{{ moment(game.start_time).format('DD-MM-YYYY, hh:mm')}}{% else %}-{% endif %}
End Time{% if game.end_time %}{{ moment(game.end_time).format('DD-MM-YYYY, hh:mm')}}{% else %}-{% endif %}
-
\ No newline at end of file +
diff --git a/app/templates/base.html b/app/templates/base.html index 5b5c6c8..68ad074 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -1,5 +1,10 @@ {% extends 'bootstrap/base.html' %} +{% block styles %} +{{ super() }} + +{% endblock %} + {% block title %} {% if title %}{{ title }} - The Hunt{% else %}Welcome to The Hunt{% endif %} {% endblock %} diff --git a/app/templates/game_bunny_dashboard.html b/app/templates/game_bunny_dashboard.html index 46cb04a..4f0836c 100644 --- a/app/templates/game_bunny_dashboard.html +++ b/app/templates/game_bunny_dashboard.html @@ -8,11 +8,14 @@ {% endblock %} {% block player_app_content %} -

{{ game.name }}: {{ current_user.name }}

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

Objective Locations:

{% if game.objectives %} -
+
@@ -34,9 +37,21 @@
-
{% endif %} +
+
+ {% include '_game_player_info.html' %} +
+
+ +{% if game.objectives %} +
+
+
+
+
+{% endif %} {% endblock %} @@ -70,4 +85,4 @@ } -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/templates/game_hunter_dashboard.html b/app/templates/game_hunter_dashboard.html index 56c9e59..3d25668 100644 --- a/app/templates/game_hunter_dashboard.html +++ b/app/templates/game_hunter_dashboard.html @@ -8,22 +8,17 @@ {% endblock %} {% block player_app_content %} -

{{ game.name }}: {{ current_user.name }}

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

Bunnies:

- - - -
- +
+
+ +
+

Bunnies

+
+
- + @@ -33,7 +28,7 @@ {% for bunny in game.bunnies() %} - @@ -43,15 +38,28 @@ {% endwith %} {% endfor %} -
Player NameTimes Caught - - (Accepted/Denied/Not reviewed) - - Times Caught Last location
{{ bunny.user.name }}{{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'accepted') |list|length}} / + {{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'accepted') |list|length}} / {{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'denied') |list|length}} / {{ bunny.player_caught_by_players | selectattr('catching_player', '==', player) | selectattr('review.name', '==', 'none') |list|length}} - +
+ + + (Accepted/Denied/Not reviewed) + +
+
+
+ {% include '_game_player_info.html' %} +
+ + +
+
+
+
-
{% endblock %} @@ -72,8 +80,8 @@ L.tileLayer( 'https://geodata.nationaalgeoregister.nl/tiles/service/wmts/brtachtergrondkaartpastel/EPSG:3857/{z}/{x}/{y}.png', { attribution: 'Kaartgegevens © Kadaster' }).addTo( map ); - - var bunnies = JSON.parse('{{ json.dumps(game.last_locations(game.bunnies()), cls=location_encoder)|safe }}') + + var bunnies = JSON.parse('{{ json.dumps(game.last_locations(game.bunnies()), cls=location_encoder)|safe }}') for (var i = 0; i < bunnies.length; i++){ addPlayerMarker(map, bunnies[i]) } @@ -84,4 +92,4 @@ } -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/templates/index.html b/app/templates/index.html index 74fd73b..b530da6 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,11 +1,19 @@ {% extends 'player_base.html' %} {% block player_app_content %} -

Hi, {{ current_user.name }}!

- +
+
+

My games:

+
+
+
+ {% if current_user.games %} -
+
+
+
+
@@ -20,12 +28,12 @@ {% for game in current_user.games %} - + @@ -33,9 +41,13 @@
{{ game.name }}{{ game.state.name}}{{ game.state.name.title() }} {{ game.start_time }} {{ game.end_time }} {% for gameplayer in current_user.user_games if gameplayer.game == game %} - {{ gameplayer.role.name }} + {{ gameplayer.role.name.title() }} {% endfor %}
+
+
+
+ {% else %} {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %}