From e1fea2a7a5daa264e3e4f2aba7c6bd38a085cabd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Pracha=C5=99?= <jan.prachar@gmail.com>
Date: Thu, 15 Apr 2021 14:11:21 +0200
Subject: [PATCH] =?UTF-8?q?Emaily=20=C3=BA=C4=8Dastn=C3=ADk=C5=AFm:=20Odka?=
 =?UTF-8?q?z=20zp=C4=9Bt=20na=20seznam=20p=C5=99es=20drobe=C4=8Dkovou=20na?=
 =?UTF-8?q?vigaci?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 mo/web/org_contest.py                               | 8 +++++++-
 mo/web/templates/org_contest_list.html              | 2 +-
 mo/web/templates/org_round_list.html                | 2 +-
 mo/web/templates/parts/org_participants_emails.html | 5 -----
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/mo/web/org_contest.py b/mo/web/org_contest.py
index dca704ce..fdebce5c 100644
--- a/mo/web/org_contest.py
+++ b/mo/web/org_contest.py
@@ -288,7 +288,8 @@ def get_contest_site_rr(id: int, site_id: Optional[int], right_needed: Optional[
 def contest_breadcrumbs(
     round: Optional[db.Round] = None, contest: Optional[db.Contest] = None,
     site: Optional[db.Place] = None, task: Optional[db.Task] = None,
-    user: Optional[db.User] = None, action: Optional[str] = None
+    user: Optional[db.User] = None, action: Optional[str] = None,
+    table: Optional[bool] = False
 ) -> Markup:
     elements = [(url_for('org_rounds'), 'Soutěže')]
     round_id = None
@@ -313,6 +314,11 @@ def contest_breadcrumbs(
     if user:
         user_id = user.user_id
         elements.append((url_for('org_contest_user', contest_id=ct_id, user_id=user_id), user.full_name()))
+    if table:
+        if contest:
+            elements.append((url_for('org_contest_list', id=ct_id, site=site_id), "Seznam účastníků"))
+        else:
+            elements.append((url_for('org_round_list', id=round_id), "Seznam účastníků"))
     if action:
         elements.append(('', action))
 
diff --git a/mo/web/templates/org_contest_list.html b/mo/web/templates/org_contest_list.html
index a52f292d..edf82b92 100644
--- a/mo/web/templates/org_contest_list.html
+++ b/mo/web/templates/org_contest_list.html
@@ -6,7 +6,7 @@
 Seznam účastníků {% if site %}v soutěžním místě {{ site.name }}{% else %}{{ contest.place.name_locative() }}{% endif %}
 {% endblock %}
 {% block breadcrumbs %}
-{{ contest_breadcrumbs(round=round, contest=contest, site=site, action="Seznam účastníků") }}
+{{ contest_breadcrumbs(round=round, contest=contest, site=site, action="Seznam účastníků" if table else "E-maily", table=False if table else True) }}
 {% endblock %}
 {% set id = contest.contest_id %}
 {% set site_id = site.place_id if site else None %}
diff --git a/mo/web/templates/org_round_list.html b/mo/web/templates/org_round_list.html
index 69b4ca3f..e3ecd198 100644
--- a/mo/web/templates/org_round_list.html
+++ b/mo/web/templates/org_round_list.html
@@ -3,7 +3,7 @@
 
 {% block title %}Seznam účastníků kola {{ round.round_code() }}{% endblock %}
 {% block breadcrumbs %}
-{{ contest_breadcrumbs(round=round, action="Seznam účastníků") }}
+{{ contest_breadcrumbs(round=round, action="Seznam účastníků" if table else "E-maily", table=False if table else True) }}
 {% endblock %}
 {% set id = round.round_id %}
 
diff --git a/mo/web/templates/parts/org_participants_emails.html b/mo/web/templates/parts/org_participants_emails.html
index 19a46a26..b84c2102 100644
--- a/mo/web/templates/parts/org_participants_emails.html
+++ b/mo/web/templates/parts/org_participants_emails.html
@@ -1,8 +1,3 @@
-<a class="btn btn-default pull-right" style="margin-top: 15px;"
-   href="{{ url_for('org_contest_list', id=id, site_id=site_id, **request.args) if contest else url_for('org_round_list', id=id, **request.args) }}">
-	Zpět na tabulku účastníků
-</a>
-
 <h3>E-mailové adresy</h3>
 
 {% if emails %}
-- 
GitLab