diff --git a/app.py b/app.py index b06dfd8..de0b93c 100644 --- a/app.py +++ b/app.py @@ -86,6 +86,25 @@ def vote(key): if not meet: abort(404) + csr.execute( + """ + select email from bod where id in ( + select date_vote.bod + from date join date_vote on date.id = date_vote.date + where meet = %(meet_id)s + union + select time_vote.bod + from time join time_vote on time.id = time_vote.time + where meet = %(meet_id)s + union + select place_vote.bod + from place join place_vote on place.id = place_vote.place + where meet = %(meet_id)s + ) order by 1 + """, + { "meet_id": meet.id,}) + voters = csr.fetchall() + csr.execute( """ select d.id, d.date, d.display, position @@ -114,7 +133,7 @@ def vote(key): places = csr.fetchall() return render_template("vote.html", - meet=meet, dates=dates, times=times, places=places) + meet=meet, voters=voters,dates=dates, times=times, places=places) @app.post("/vote/date") def vote_date(): diff --git a/static/style.css b/static/style.css index 93cf0b7..eb95f88 100644 --- a/static/style.css +++ b/static/style.css @@ -19,16 +19,23 @@ body { } body { + padding: 1rem; display: grid; grid-template-columns: 1fr 1fr; grid-column-gap: 2em; + line-height: 1.5em; } -#hello { +p { + margin-top: 0; +} + +#hello, #voters { grid-column: 1 / 3; } h1, h2 { grid-column: 1 / 3; + line-height: 1.1em; } .result-item { diff --git a/templates/vote.html b/templates/vote.html index 31c348f..e7e6caf 100644 --- a/templates/vote.html +++ b/templates/vote.html @@ -8,7 +8,13 @@ -

Hallo, {{ session.user.email }}!

+

Hallo, {{ session.user.email }}!

+

+ Bisher haben abgestimmt: + {% for voter in voters %} + {{ voter.email }}{% if not loop.last %},{% endif %} + {% endfor %} +

{{ meet.title }}