diff --git a/app.py b/app.py index 08bc5c3..c679ea4 100644 --- a/app.py +++ b/app.py @@ -176,14 +176,43 @@ def vote_date(): result = instantrunoff_forward(meet_id, "date") log.debug("result = %s", result) - return render_template("date_vote_fragment.html", dates=dates, result=result) + csr.execute( + """ + select distinct email, short + from date_vote + join date on date_vote.date = date.id + join bod on date_vote.bod = bod.id + where meet = %s + order by email + """, + (meet_id,)) + voters = csr.fetchall() + + return render_template( + "date_vote_fragment.html", + dates=dates, result=result, voters=voters) @app.get("/result//date") def result_date(meet_id): result = instantrunoff_forward(meet_id, "date") log.debug("result = %s", result) - return render_template("date_result_fragment.html", result=result) + csr = get_cursor() + csr.execute( + """ + select distinct email, short + from date_vote + join date on date_vote.date = date.id + join bod on date_vote.bod = bod.id + where meet = %s + order by email + """, + (meet_id,)) + voters = csr.fetchall() + + return render_template( + "date_result_fragment.html", + result=result, voters=voters) @@ -225,14 +254,43 @@ def vote_time(): result = instantrunoff_forward(meet_id, "time") log.debug("result = %s", result) - return render_template("time_vote_fragment.html", times=times, result=result) + csr.execute( + """ + select distinct email, short + from time_vote + join time on time_vote.time = time.id + join bod on time_vote.bod = bod.id + where meet = %s + order by email + """, + (meet_id,)) + voters = csr.fetchall() + + return render_template( + "time_vote_fragment.html", + times=times, result=result, voters=voters) @app.get("/result//time") def result_time(meet_id): result = instantrunoff_forward(meet_id, "time") log.debug("result = %s", result) - return render_template("time_result_fragment.html", result=result) + csr = get_cursor() + csr.execute( + """ + select distinct email, short + from time_vote + join time on time_vote.time = time.id + join bod on time_vote.bod = bod.id + where meet = %s + order by email + """, + (meet_id,)) + voters = csr.fetchall() + + return render_template( + "time_result_fragment.html", + result=result, voters=voters) @app.post("/vote/place") def vote_place(): @@ -272,7 +330,21 @@ def vote_place(): result = instantrunoff_forward(meet_id, "place") log.debug("result = %s", result) - return render_template("place_vote_fragment.html", places=places, result=result) + csr.execute( + """ + select distinct email, short + from place_vote + join place on place_vote.place = place.id + join bod on place_vote.bod = bod.id + where meet = %s + order by email + """, + (meet_id,)) + voters = csr.fetchall() + + return render_template( + "place_vote_fragment.html", + places=places, result=result, voters=voters) @app.get("/result//place") @@ -280,7 +352,22 @@ def result_place(meet_id): result = instantrunoff_forward(meet_id, "place") log.debug("result = %s", result) - return render_template("place_result_fragment.html", result=result) + csr = get_cursor() + csr.execute( + """ + select distinct email, short + from place_vote + join place on place_vote.place = place.id + join bod on place_vote.bod = bod.id + where meet = %s + order by email + """, + (meet_id,)) + voters = csr.fetchall() + + return render_template( + "place_result_fragment.html", + result=result, voters=voters) @app.get("/result//date/ballot") diff --git a/static/meeat-0.svg b/static/meeat-0.svg new file mode 100644 index 0000000..205ecf4 --- /dev/null +++ b/static/meeat-0.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + MEATMEET + E + M + A + T + E + E + + diff --git a/static/meeat-1.svg b/static/meeat-1.svg new file mode 100644 index 0000000..f42660b --- /dev/null +++ b/static/meeat-1.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + M + E + A + E + T + + diff --git a/static/style.css b/static/style.css index 4300486..6817a0e 100644 --- a/static/style.css +++ b/static/style.css @@ -1,5 +1,16 @@ body { font-family: sans; + margin: 0; +} + +header { + height: 100px; +} + +h1 { + padding-top: 19px; + margin-top: 0px; + margin-left: 200px; } .sortable { @@ -33,7 +44,8 @@ p { #hello, #voters { grid-column: 1 / 3; } -h1, h2 { + +h2 { grid-column: 1 / 3; line-height: 1.1em; } @@ -65,3 +77,53 @@ h1, h2 { padding: 1em; background-color: hsl(240, 10%, 80%); } + +.logo { + position: absolute; + outline: 1px solid lime; +} +.logo-1 { + animation-name: fadeoutin; + animation-duration: 10s; + animation-iteration-count: infinite; +} +.logo-2 { + animation-name: fadeinout; + animation-duration: 10s; + animation-iteration-count: infinite; +} + +@keyframes fadeinout { + 0% { + opacity: 0% + } + 10% { + opacity: 100% + } + 50% { + opacity: 100% + } + 60% { + opacity: 0% + } + 100% { + opacity: 0% + } +} +@keyframes fadeoutin { + 0% { + opacity: 100% + } + 10% { + opacity: 0% + } + 50% { + opacity: 0% + } + 60% { + opacity: 100% + } + 100% { + opacity: 100% + } +} diff --git a/templates/date_result_fragment.html b/templates/date_result_fragment.html index 8fedb36..73514ef 100644 --- a/templates/date_result_fragment.html +++ b/templates/date_result_fragment.html @@ -1,7 +1,8 @@
+ Ergebnis ({% for v in voters %}{{ v.short or v.email }}{% if not loop.last %}, {% endif %}{% endfor %}): {% for r in result %}
- {{ r.display or r.date }} + {{ loop.index }}. {{ r.display or r.date }}
{% endfor %}
diff --git a/templates/date_vote_fragment.html b/templates/date_vote_fragment.html index 5935ba7..d4645f1 100644 --- a/templates/date_vote_fragment.html +++ b/templates/date_vote_fragment.html @@ -1,13 +1,14 @@ {% for d in dates %}
- {{ d.display or d.date }} + {{ loop.index }}. {{ d.display or d.date }}
{% endfor %}
+ Ergebnis ({% for v in voters %}{{ v.short or v.email }}{% if not loop.last %}, {% endif %}{% endfor %}): {% for r in result %}
- {{ r.display or r.date }} + {{ loop.index }}. {{ r.display or r.date }}
{% endfor %}
diff --git a/templates/place_result_fragment.html b/templates/place_result_fragment.html index bf65088..4b8823e 100644 --- a/templates/place_result_fragment.html +++ b/templates/place_result_fragment.html @@ -1,7 +1,8 @@
+ Ergebnis ({% for v in voters %}{{ v.short or v.email }}{% if not loop.last %}, {% endif %}{% endfor %}): {% for r in result %}
- {{ r.name }} + {{ loop.index }}. {{ r.name }}
{% endfor %}
diff --git a/templates/place_vote_fragment.html b/templates/place_vote_fragment.html index f74dc35..7d15936 100644 --- a/templates/place_vote_fragment.html +++ b/templates/place_vote_fragment.html @@ -1,13 +1,14 @@ {% for d in places %}
- {{ d.name }} + {{ loop.index }}. {{ d.name }}
{% endfor %}
+ Ergebnis ({% for v in voters %}{{ v.short or v.email }}{% if not loop.last %}, {% endif %}{% endfor %}): {% for r in result %}
- {{ r.name }} + {{ loop.index }}. {{ r.name }}
{% endfor %}
diff --git a/templates/time_result_fragment.html b/templates/time_result_fragment.html index 1487c63..35368ff 100644 --- a/templates/time_result_fragment.html +++ b/templates/time_result_fragment.html @@ -1,7 +1,8 @@
+ Ergebnis ({% for v in voters %}{{ v.short or v.email }}{% if not loop.last %}, {% endif %}{% endfor %}): {% for r in result %}
- {{ r.display or r.time }} + {{ loop.index }}. {{ r.display or r.time }}
{% endfor %}
diff --git a/templates/time_vote_fragment.html b/templates/time_vote_fragment.html index d984c80..6e35d9c 100644 --- a/templates/time_vote_fragment.html +++ b/templates/time_vote_fragment.html @@ -1,13 +1,14 @@ {% for d in times %}
- {{ d.display or d.time }} + {{ loop.index }}. {{ d.display or d.time }}
{% endfor %}
+ Ergebnis ({% for v in voters %}{{ v.short or v.email }}{% if not loop.last %}, {% endif %}{% endfor %}): {% for r in result %}
- {{ r.display or r.time }} + {{ loop.index }}. {{ r.display or r.time }}
{% endfor %}
diff --git a/templates/vote.html b/templates/vote.html index cac771f..4cf509f 100644 --- a/templates/vote.html +++ b/templates/vote.html @@ -8,6 +8,11 @@ +
+ + +

{{ meet.title }}

+

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

@@ -16,49 +21,55 @@ {{ voter.email }}{% if not loop.last %},{% endif %} {% endfor %}

-

- {{ meet.title }} -

An welchem Tag? [details]

-
- {% for d in dates %} -
- {{ d.display or d.date }} - -
- {% endfor %} -
+
+ Ordne die Optionen nach Präferenz: +
+ {% for d in dates %} +
+ {{ loop.index }}. {{ d.display or d.date }} + +
+ {% endfor %} +
+

Zu welcher Zeit? [details]

-
- {% for d in times %} -
- {{ d.display or d.time }} - -
- {% endfor %} -
+
+ Ordne die Optionen nach Präferenz: +
+ {% for d in times %} +
+ {{ loop.index }}. {{ d.display or d.time }} + +
+ {% endfor %} +
+

An welchem Ort? [details]

-
- {% for d in places %} -
- {{ d.name }} - -
- {% endfor %} -
+
+ Ordne die Optionen nach Präferenz: +
+ {% for d in places %} +
+ {{ loop.index }}. {{ d.name }} + +
+ {% endfor %} +
+