various design improvements

This commit is contained in:
2019-01-02 17:24:02 +01:00
parent 3bf1d1f0eb
commit b8ffa5f4cc
5 changed files with 17 additions and 6 deletions

View File

@@ -2,6 +2,9 @@
<head> <head>
<title>{% block title %}Wer bin ich{% endblock %}</title> <title>{% block title %}Wer bin ich{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.current_player_indicator { font-size: x-large; }
</style>
</head> </head>
<body> <body>
{% block content %}{% endblock %} {% block content %}{% endblock %}

View File

@@ -3,15 +3,18 @@
{% block content %} {% block content %}
<h1>Choose a name</h1> <h1>Choose a name</h1>
<h2>You are: {{ current_player }}</h2>
<div class=current_player_indicator>You are: {{ current_player }}</div>
<p> <p>
Please name your player: Please name your player:
<br/> <br/>
<form method=post> <form method=post>
<table>
{% for player in other_players %} {% for player in other_players %}
{{ player }}: <input type=text name={{ player }} /><br/> <tr><td>{{ player }}</td><td><input type=text name={{ player }} /></td></tr>
{% endfor %} {% endfor %}
</table>
<input type=submit /> <input type=submit />
</form> </form>
</p> </p>

View File

@@ -3,7 +3,7 @@
{% block content %} {% block content %}
<h1>Play!</h1> <h1>Play!</h1>
<h2>You are: {{ current_player }}</h2> <div class=current_player_indicator>You are: {{ current_player }}</div>
<p> <p>
<table> <table>
@@ -13,4 +13,8 @@
</table> </table>
</p> </p>
<p>
<a href={{ edit_url }}>Edit name</a> <a href={{ url_for('create_game') }}>New game</a>
</p>
{% endblock %} {% endblock %}

View File

@@ -7,9 +7,11 @@
<p> <p>
Please select your player: Please select your player:
<br/> <br/>
<ul class=playerlist>
{% for player in players %} {% for player in players %}
<a href=./edit/{{ player }}>{{ player }}</a> <li><a href=./edit/{{ player }}>{{ player }}</a></li>
{% endfor %} {% endfor %}
</ul>
</p> </p>
<p> <p>

View File

@@ -46,8 +46,7 @@ def store_name(gameid, player):
def name_show(gameid, player): def name_show(gameid, player):
other_players = dict(games[str(gameid)]) other_players = dict(games[str(gameid)])
other_players.pop(player,None) other_players.pop(player,None)
pprint(other_players) return render_template("name_show.html", current_player=player, other_players=other_players, edit_url=url_for("name_edit", gameid=gameid, player=player))
return render_template("name_show.html", current_player=player, other_players=other_players)
@app.errorhandler(KeyError) @app.errorhandler(KeyError)
def not_found(error): def not_found(error):