From 4cb4b56482c9e0e9a0ab65ba1f71300d7e18159a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Tue, 1 Jun 2021 16:09:22 +0200
Subject: [PATCH] UX tweaks and translations

---
 helios/forms.py                              |  4 ++--
 helios/media/static_templates/question.html  | 10 ++++------
 helios/templates/election_view.html          |  6 +++---
 helios/templates/elections_administered.html |  2 +-
 helios/templates/elections_voted.html        |  2 +-
 helios/templates/email/info_body.txt         |  2 +-
 helios/templates/email/result_body.txt       |  2 +-
 helios/templates/email/simple_body.txt       |  4 ++--
 helios/templates/email/vote_body.txt         | 16 ++++++++--------
 helios/templates/list_trustees.html          | 11 +++++------
 heliosbooth/templates/question.html          |  8 ++++----
 server_ui/templates/index.html               |  2 +-
 12 files changed, 33 insertions(+), 36 deletions(-)

diff --git a/helios/forms.py b/helios/forms.py
index b1d6687..eccb04a 100644
--- a/helios/forms.py
+++ b/helios/forms.py
@@ -34,9 +34,9 @@ class ElectionForm(forms.Form):
     # v DB se ukládá naivní UTC, ale do formuláře potřebujeme převést zpět na Europe/Prague
     if data:
       tz = pytz.timezone("Europe/Prague")
-      if "voting_starts_at" in data:
+      if "voting_starts_at" in data and data["voting_starts_at"]:
         data["voting_starts_at"] = make_naive(make_aware(data["voting_starts_at"], pytz.UTC), tz)
-      if "voting_ends_at" in data:
+      if "voting_ends_at" in data and data["voting_ends_at"]:
         data["voting_ends_at"] = make_naive(make_aware(data["voting_ends_at"], pytz.UTC), tz)
     super().__init__(data, *args, **kwargs)
 
diff --git a/helios/media/static_templates/question.html b/helios/media/static_templates/question.html
index fe6709f..b3de687 100644
--- a/helios/media/static_templates/question.html
+++ b/helios/media/static_templates/question.html
@@ -27,8 +27,8 @@
 <input type="hidden" name="choice_type" value="approval" />
 <b>{$T.question$index + 1}.</b> &nbsp;&nbsp;&nbsp;Zvolte mezi &nbsp;&nbsp;
 <select name="min">
-    <option>0</option>
-    <option selected>1</option>
+    <option selected>0</option>
+    <option>1</option>
 {#for option_index = 2 to 20}
     <option>{$T.option_index}</option>
 {#/for}
@@ -37,7 +37,6 @@
 &nbsp;&nbsp; a  &nbsp;&nbsp;
 
 <select name="max">
-    <option>0</option>
     <option selected>1</option>
 {#for option_index = 2 to 50}
     <option>{$T.option_index}</option>
@@ -95,8 +94,8 @@ zatím žádné otázky
 <input type="hidden" name="choice_type" value="approval" />
 &nbsp;&nbsp;&nbsp;Zvolte mezi &nbsp;&nbsp;
 <select name="min">
-    <option>0</option>
-    <option selected>1</option>
+    <option selected>0</option>
+    <option>1</option>
 {#for option_index = 2 to 20}
     <option>{$T.option_index}</option>
 {#/for}
@@ -105,7 +104,6 @@ zatím žádné otázky
 &nbsp;&nbsp; a  &nbsp;&nbsp;
 
 <select name="max">
-    <option>0</option>
     <option selected>1</option>
 {#for option_index = 2 to 50}
     <option>{$T.option_index}</option>
diff --git a/helios/templates/election_view.html b/helios/templates/election_view.html
index 6617500..44fbff9 100644
--- a/helios/templates/election_view.html
+++ b/helios/templates/election_view.html
@@ -48,7 +48,7 @@ toto {{election.election_type}} <u>není</u> zobrazeno na titulní stránce.
 </div>
 
 <p>
-{% if election.help_email and admin_p%}Email pro nápovědu: {{election.help_email}}<br />{% endif %}
+{# {% if election.help_email and admin_p%}Email pro nápovědu: {{election.help_email}}<br />{% endif %} #}
 {% if election.voting_start_at %}Hlasování začíná: {{election.voting_start_at|timezone:"Europe/Prague"}}<br />{% endif %}
 {% if election.voting_end_at %}Hlasování končí: {{election.voting_end_at|timezone:"Europe/Prague"}}<br />{% endif %}
 </p>
@@ -159,7 +159,7 @@ Poté uvidíte výsledek pouze vy jakožto zakladatel hlasování.
 {% if show_result %}
 {% if election.result_released_at %}
 <span class="highlight-box round">
-Toto hlasování bylo ukončeno. Výsledek byl zveřejněn {{election.result_released_at|timezone:"Europe/Prague"}}. Celkem bylo odevzdáno {{election.num_cast_votes}} hlasů.
+Toto hlasování bylo ukončeno. Výsledek byl zveřejněn {{election.result_released_at|timezone:"Europe/Prague"}}. Celkem hlasovalo {{election.num_cast_votes}} voličů.
 </span><br /><br /><br />
 {% endif %}
 
@@ -256,7 +256,7 @@ V tomto hlasování může hlasovat kdokoli.
 {% endif %}
 
 {% if admin_p and election.voting_ends_at and not election.tallying_started_at %}
-<br /><a href="{% url "election@extend" election.uuid %}">extend voting</a><br />
+<br /><a href="{% url "election@extend" election.uuid %}">prodloužit hlasování</a><br />
 {% endif %}
 
 <div style="background: lightyellow; padding:5px; padding-left: 10px; margin-top: 15px; border: 1px solid #aaa; width: 720px;" class="round">
diff --git a/helios/templates/elections_administered.html b/helios/templates/elections_administered.html
index 366147f..a3d623e 100644
--- a/helios/templates/elections_administered.html
+++ b/helios/templates/elections_administered.html
@@ -1,7 +1,7 @@
 {% extends TEMPLATE_BASE %}
 
 {% block content %}
-  <h2 class="title">Hlasování, která spravujete <span style="font-size:0.7em;">[<a href="/">zpět na úvodní stránku</a>]</span></h2>
+  <h2 class="title">Hlasování, která spravujete <span style="font-size:0.7em;">[<a href="/">zpět na úvod</a>]</span></h2>
 
 <ul>
 {% for election in elections %}
diff --git a/helios/templates/elections_voted.html b/helios/templates/elections_voted.html
index 08effff..abd4330 100644
--- a/helios/templates/elections_voted.html
+++ b/helios/templates/elections_voted.html
@@ -1,7 +1,7 @@
 {% extends TEMPLATE_BASE %}
 
 {% block content %}
-  <h2 class="title">Hlasování, v nichž jste hlasoval <span style="font-size:0.7em;">[<a href="/">zpět na úvodní stránku</a>]</span></h2>
+  <h2 class="title">Hlasování, v nichž jste oprávněn/a hlasovat <span style="font-size:0.7em;">[<a href="/">zpět na úvod</a>]</span></h2>
 
 <ul>
 {% for election in elections %}
diff --git a/helios/templates/email/info_body.txt b/helios/templates/email/info_body.txt
index 2a0b68c..01f1b32 100644
--- a/helios/templates/email/info_body.txt
+++ b/helios/templates/email/info_body.txt
@@ -2,7 +2,7 @@ Vážený {{voter.name}},
 
 {{custom_message|safe}}
 
-Odkaz na volby: {{election_vote_url}}
+Odkaz na volby: {{election_url}}
 
 --
 Helios
diff --git a/helios/templates/email/result_body.txt b/helios/templates/email/result_body.txt
index fc71cc9..5b071d7 100644
--- a/helios/templates/email/result_body.txt
+++ b/helios/templates/email/result_body.txt
@@ -12,7 +12,7 @@ Celkový výsledek pro {{election.name}} byl vypočítán a zveřejněn:
 
 Pokud myslíte že tento sledovač je chybný, prosím kontaktuje nás.
 {% else %}
-Vyoadá to, že v těchto volbách jste nehlasovali.
+Vypadá to, že v těchto volbách jste nehlasovali.
 Prosím kontaktujte nás, pokud si myslíte, že ano.
 {% endif %}
 --
diff --git a/helios/templates/email/simple_body.txt b/helios/templates/email/simple_body.txt
index 560ff7b..79fba54 100644
--- a/helios/templates/email/simple_body.txt
+++ b/helios/templates/email/simple_body.txt
@@ -5,10 +5,10 @@ Vážený {{voter.name}},
 ========
 Jak hlasovat
 
-URL Hlasování:  {{election_vote_url}}
+URL Hlasování:  {{election_url}}
 {% ifequal voter.voter_type "password" %}
 Vaše ID voliče: {{voter.voter_login_id}}
 Vaše heslo: {{voter.voter_password}}
 {% else %}
-Přihlašte se svým {{voter.voter_type}} účtem.
+Přihlaste se svou pirátskou identitou.
 {% endifequal %}
diff --git a/helios/templates/email/vote_body.txt b/helios/templates/email/vote_body.txt
index 6e42d08..12e0a88 100644
--- a/helios/templates/email/vote_body.txt
+++ b/helios/templates/email/vote_body.txt
@@ -3,25 +3,25 @@ Vážený {{voter.name}},
 
 {{custom_message|safe}}
 
-URL Hlasování: {{election_vote_url}}
-Otisk Hlasováné: {{voter.election.hash}}
-{% if election.voting_start_at %}Hlasování začíná {{election.voting_start_at|timezone:"Europe/Prague"}}
-{% endif %}{% if election.voting_end_at %}Hlasování končí {{election.voting_end_at|timezone:"Europe/Prague"}}
+URL hlasování: {{election_url}}
+Otisk hlasování: {{voter.election.hash}}
+{% if election.voting_start_at %}Hlasování začíná: {{election.voting_start_at|timezone:"Europe/Prague"}}
+{% endif %}{% if election.voting_end_at %}Hlasování končí: {{election.voting_end_at|timezone:"Europe/Prague"}}
 {% endif %}
 
 {% ifequal voter.voter_type "password" %}
 Vaše ID voliče: {{voter.voter_login_id}}
 Vaše heslo: {{voter.voter_password}}
 {% else %}
-Přihlašte se svým {{voter.voter_type}} účtem.
+Přihlaste se svou pirátskou identitou.
 {% endifequal %}{% if voter.vote_hash %}
-Zaznamenali jsem váš hlas chytrým sledovačem:
+Zaznamenali jsme váš hlas chytrým sledovačem:
 
   {{voter.vote_hash}}
 
-Můžete kdykoli znovu hlasovat: pouze poslední hlas se počítá.
+Můžete kdykoli znovu hlasovat, pouze poslední hlas se počítá.
 {% endif %}{% if election.use_voter_aliases %}
-Z důvodů ochrany vašeho soukromí, toto hlasování je nastaveno
+Z důvodů ochrany vašeho soukromí je toto hlasování nastaveno,
 aby nikdy nezobrazovalo veřejně Vaše login, ID voliče, jméno, nebo email.
 Centrum sledování lístků bude zobrazovat pouze váš alias.
 
diff --git a/helios/templates/list_trustees.html b/helios/templates/list_trustees.html
index 5e3f1e3..a1905b6 100644
--- a/helios/templates/list_trustees.html
+++ b/helios/templates/list_trustees.html
@@ -50,22 +50,21 @@
 
 <p>
 {% if t.public_key_hash %}
-  Otisk veřejného klíče: <tt style="font-size:1.5em;">{{t.public_key_hash}}</tt>
+  Otisk veřejného klíče: <tt style="font-size:1.3em;">{{t.public_key_hash}}</tt>
 {% else %}
 Veřejný klíč ještě nebyl nahrán.
 {% endif %}
-</p>
 
 {% if election.encrypted_tally %}
 {% if t.decryption_factors %}
-<b>Tento trustee již dešifroval výsledek.</b>
+<br><b>Tento trustee již dešifroval výsledek.</b>
 {% else %}
-<em>Čekáme na dílčí dešifrování výsledku.</em>
+<br><em>Čekáme na dílčí dešifrování výsledku.</em>
 {% endif %}
 {% endif %}
-</li>
+</p>
+<br>
 {% endfor %}
-</ul>
 
 {% endif %}
 
diff --git a/heliosbooth/templates/question.html b/heliosbooth/templates/question.html
index ac43b72..f1eeb79 100644
--- a/heliosbooth/templates/question.html
+++ b/heliosbooth/templates/question.html
@@ -10,15 +10,15 @@
  zvolte
 {#if $T.question.min && $T.question.min > 0}
 {#if $T.question.max}
-od {$T.question.min} do {$T.question.max} moĹľnostĂ­
+ od {$T.question.min} do {$T.question.max} moĹľnostĂ­
 {#else}
-nejméně {$T.question.min} možnosti
+ nejméně {$T.question.min} možnosti
 {#/if}
 {#else}
 {#if $T.question.max}
-{#if $T.question.max > 1} nejvýše {#/if}{$T.question.max} možnosti
+ nejvýše {$T.question.max} možnosti
 {#else}
-libovolnĂ˝ poÄŤet moĹľnostĂ­
+ libovolnĂ˝ poÄŤet moĹľnostĂ­
 {#/if}
 {#/if}
 </span>
diff --git a/server_ui/templates/index.html b/server_ui/templates/index.html
index 54a4ef8..a8be249 100644
--- a/server_ui/templates/index.html
+++ b/server_ui/templates/index.html
@@ -75,7 +75,7 @@ More than <b>2,000,000 votes</b> have been cast using Helios.
 <div class="row"></div>
 {% endif %}
 
-<h5 class="subheader">Naposledy hlasováno v</h5>
+<h5 class="subheader">Vaše hlasování</h5>
 {% if elections_voted %}
 <ul>
 {% for election in elections_voted %}
-- 
GitLab