From e6f3506e6499620bbf8f61b898f43661c66b52a7 Mon Sep 17 00:00:00 2001
From: Clement Verna <cverna@tutanota.com>
Date: Nov 18 2019 16:55:14 +0000
Subject: [PATCH 1/6] Remove fedmenu from elections


Signed-off-by: Clement Verna <cverna@tutanota.com>

---

diff --git a/fedora_elections/templates/base.html b/fedora_elections/templates/base.html
index c128ae8..d18e2f8 100644
--- a/fedora_elections/templates/base.html
+++ b/fedora_elections/templates/base.html
@@ -126,17 +126,6 @@
           $('[data-toggle="tooltip"]').tooltip()
         })
         </script>
-      {% if config['FEDMENU_URL'] %}
-      <script src="{{ config['FEDMENU_URL'] }}/js/fedmenu.js"></script>
-      <script>
-        fedmenu({
-            'url': '{{ config["FEDMENU_DATA_URL"] }}',
-            'mimeType': 'application/javascript',
-            'position': 'bottom-right',
-        });
-      </script>
-      {% endif %}
-
     {% endblock %}
 
   </body>

From ad6162a7c5ed944535b7392cba730345f75a61d9 Mon Sep 17 00:00:00 2001
From: Ben Cotton <bcotton@fedoraproject.org>
Date: Nov 18 2019 16:55:27 +0000
Subject: [PATCH 2/6] Open information links in a new window.


Fixes #56

---

diff --git a/fedora_elections/forms.py b/fedora_elections/forms.py
index 8fc90b0..91947ba 100644
--- a/fedora_elections/forms.py
+++ b/fedora_elections/forms.py
@@ -135,7 +135,7 @@ def get_range_voting_form(candidates, max_range):
     for candidate in candidates:
         title = candidate.fas_name or candidate.name
         if candidate.url:
-            title = '%s <a href="%s">[Info]</a>' % (title, candidate.url)
+            title = '%s <a href="%s" target="_blank">[Info]</a>' % (title, candidate.url)
         field = wtforms.SelectField(
             title,
             choices=[(str(item), item) for item in range(max_range + 1)]
@@ -160,7 +160,7 @@ def get_simple_voting_form(candidates, fasusers):
             except (KeyError, AuthError) as err:
                 APP.logger.debug(err)
         if candidate.url:
-            title = '%s <a href="%s">[Info]</a>' % (title, candidate.url)
+            title = '%s <a href="%s" target="_blank">[Info]</a>' % (title, candidate.url)
         titles.append((str(candidate.id), title))
     field = wtforms.RadioField(
         'Candidates',
@@ -192,7 +192,7 @@ def get_select_voting_form(candidates, max_selection):
     for candidate in candidates:
         title = candidate.fas_name or candidate.name
         if candidate.url:
-            title = '%s <a href="%s">[Info]</a>' % (title, candidate.url)
+            title = '%s <a href="%s" target="_blank">[Info]</a>' % (title, candidate.url)
         field = wtforms.BooleanField(
             title,
         )
diff --git a/fedora_elections/templates/vote_simple.html b/fedora_elections/templates/vote_simple.html
index a088925..6b53e70 100644
--- a/fedora_elections/templates/vote_simple.html
+++ b/fedora_elections/templates/vote_simple.html
@@ -13,7 +13,7 @@
 
     <p class="text-xs-center">{{election.description}}</p>
 
-    <p class="text-xs-center"><a href="{{election.url}}">[More Information]</a></p>
+    <p class="text-xs-center"><a href="{{election.url}}" target="_blank">[More Information]</a></p>
 
     <p>Here are the candidates for the {{ election.seats_elected }} seat(s) open:</p>
     <form action="{{ url_for('vote', election_alias=election.alias) }}" method="post">

From ff15dcafb612fc2a321062d1b55eeb4130debcd5 Mon Sep 17 00:00:00 2001
From: Ben Cotton <bcotton@fedoraproject.org>
Date: Nov 18 2019 16:55:27 +0000
Subject: [PATCH 3/6] Add another place to open the link in a new window


---

diff --git a/fedora_elections/templates/vote_range.html b/fedora_elections/templates/vote_range.html
index d6f0f2b..ce45b8a 100644
--- a/fedora_elections/templates/vote_range.html
+++ b/fedora_elections/templates/vote_range.html
@@ -13,7 +13,7 @@
 
     <p class="text-xs-center">{{election.description}}</p>
 
-    <p class="text-xs-center"><a href="{{election.url}}">[More Information]</a></p>
+    <p class="text-xs-center"><a href="{{election.url}}" target="_blank">[More Information]</a></p>
 
     <p>Here are the candidates for the {{ election.seats_elected }} seat(s) open:</p>
     <form action="{{ url_for('vote', election_alias=election.alias) }}" method="post">

From 1eb88013a7bb141ed487aef94fe3cd7192ad4896 Mon Sep 17 00:00:00 2001
From: Ben Cotton <bcotton@fedoraproject.org>
Date: Nov 18 2019 16:55:27 +0000
Subject: [PATCH 4/6] Clarify that the names are clickable links


Fixes #55

---

diff --git a/fedora_elections/templates/about.html b/fedora_elections/templates/about.html
index b87fea8..8a2e1de 100644
--- a/fedora_elections/templates/about.html
+++ b/fedora_elections/templates/about.html
@@ -68,12 +68,13 @@
   <h4><strong>Candidates</strong></h4>
   <div class="list-group">
     {% for candidate in election.candidates %}
-      <a {% if candidate.url %}href="{{ candidate.url }}"{%endif%} class="list-group-item">
+      <a {% if candidate.url %}href="{{ candidate.url }}" target="_blank"{%endif%} class="list-group-item">
           {% if election.candidates_are_fasusers %}
             {{ usernamemap['%s' % candidate.id] }}
           {% else %}
             {{ candidate.name }}
           {% endif %}
+          {% if candidate.url %}(click for more info){% endif %}
       </a>
     {% endfor %}
     {% if election.candidates.count() == 0 %}

From 6dffcae7a16aa1c1625c65a206a6de4f66a546ca Mon Sep 17 00:00:00 2001
From: Ben Cotton <bcotton@fedoraproject.org>
Date: Nov 18 2019 17:04:42 +0000
Subject: [PATCH 5/6] Protect against info leakage with rel="noopener noreferrer" on our new tabs.


---

diff --git a/fedora_elections/forms.py b/fedora_elections/forms.py
index 91947ba..b88edaf 100644
--- a/fedora_elections/forms.py
+++ b/fedora_elections/forms.py
@@ -135,7 +135,7 @@ def get_range_voting_form(candidates, max_range):
     for candidate in candidates:
         title = candidate.fas_name or candidate.name
         if candidate.url:
-            title = '%s <a href="%s" target="_blank">[Info]</a>' % (title, candidate.url)
+            title = '%s <a href="%s" target="_blank" rel="noopener noreferrer">[Info]</a>' % (title, candidate.url)
         field = wtforms.SelectField(
             title,
             choices=[(str(item), item) for item in range(max_range + 1)]
@@ -160,7 +160,7 @@ def get_simple_voting_form(candidates, fasusers):
             except (KeyError, AuthError) as err:
                 APP.logger.debug(err)
         if candidate.url:
-            title = '%s <a href="%s" target="_blank">[Info]</a>' % (title, candidate.url)
+            title = '%s <a href="%s" target="_blank" rel="noopener noreferrer">[Info]</a>' % (title, candidate.url)
         titles.append((str(candidate.id), title))
     field = wtforms.RadioField(
         'Candidates',
@@ -192,7 +192,7 @@ def get_select_voting_form(candidates, max_selection):
     for candidate in candidates:
         title = candidate.fas_name or candidate.name
         if candidate.url:
-            title = '%s <a href="%s" target="_blank">[Info]</a>' % (title, candidate.url)
+            title = '%s <a href="%s" target="_blank" rel="noopener noreferrer">[Info]</a>' % (title, candidate.url)
         field = wtforms.BooleanField(
             title,
         )
diff --git a/fedora_elections/templates/about.html b/fedora_elections/templates/about.html
index 8a2e1de..de10caa 100644
--- a/fedora_elections/templates/about.html
+++ b/fedora_elections/templates/about.html
@@ -68,7 +68,7 @@
   <h4><strong>Candidates</strong></h4>
   <div class="list-group">
     {% for candidate in election.candidates %}
-      <a {% if candidate.url %}href="{{ candidate.url }}" target="_blank"{%endif%} class="list-group-item">
+      <a {% if candidate.url %}href="{{ candidate.url }}" target="_blank" rel="noopener noreferrer"{%endif%} class="list-group-item">
           {% if election.candidates_are_fasusers %}
             {{ usernamemap['%s' % candidate.id] }}
           {% else %}
diff --git a/fedora_elections/templates/base.html b/fedora_elections/templates/base.html
index d18e2f8..c963822 100644
--- a/fedora_elections/templates/base.html
+++ b/fedora_elections/templates/base.html
@@ -112,7 +112,7 @@
          Copyright © 2013-2016 Red Hat
             </p>
             <p class="text-muted credit"> Powered by the <a href="https://pagure.io/elections/"
-                  target="_blank">elections</a> app -- version {{ version }}</p>
+                  target="_blank" rel="noopener noreferrer">elections</a> app -- version {{ version }}</p>
         </div>
     </div>
     {% block jscripts %}
diff --git a/fedora_elections/templates/vote_range.html b/fedora_elections/templates/vote_range.html
index ce45b8a..ade038b 100644
--- a/fedora_elections/templates/vote_range.html
+++ b/fedora_elections/templates/vote_range.html
@@ -13,7 +13,7 @@
 
     <p class="text-xs-center">{{election.description}}</p>
 
-    <p class="text-xs-center"><a href="{{election.url}}" target="_blank">[More Information]</a></p>
+    <p class="text-xs-center"><a href="{{election.url}}" target="_blank" rel="noopener noreferrer">[More Information]</a></p>
 
     <p>Here are the candidates for the {{ election.seats_elected }} seat(s) open:</p>
     <form action="{{ url_for('vote', election_alias=election.alias) }}" method="post">
diff --git a/fedora_elections/templates/vote_simple.html b/fedora_elections/templates/vote_simple.html
index 6b53e70..ef202da 100644
--- a/fedora_elections/templates/vote_simple.html
+++ b/fedora_elections/templates/vote_simple.html
@@ -13,7 +13,7 @@
 
     <p class="text-xs-center">{{election.description}}</p>
 
-    <p class="text-xs-center"><a href="{{election.url}}" target="_blank">[More Information]</a></p>
+    <p class="text-xs-center"><a href="{{election.url}}" target="_blank" rel="noopener noreferrer">[More Information]</a></p>
 
     <p>Here are the candidates for the {{ election.seats_elected }} seat(s) open:</p>
     <form action="{{ url_for('vote', election_alias=election.alias) }}" method="post">

From ed4fd1d56d62311b71f803a86eb8d0b6a6033937 Mon Sep 17 00:00:00 2001
From: Ben Cotton <bcotton@fedoraproject.org>
Date: Nov 18 2019 17:12:27 +0000
Subject: [PATCH 6/6] Release 2.9


---

diff --git a/fedora_elections/__init__.py b/fedora_elections/__init__.py
index c782d8f..20e7865 100644
--- a/fedora_elections/__init__.py
+++ b/fedora_elections/__init__.py
@@ -25,7 +25,7 @@
 #
 from __future__ import unicode_literals, absolute_import
 
-__version__ = '2.7'
+__version__ = '2.9'
 
 import logging  # noqa
 import os  # noqa
diff --git a/files/fedora-elections.spec b/files/fedora-elections.spec
index fc99887..f84d23e 100644
--- a/files/fedora-elections.spec
+++ b/files/fedora-elections.spec
@@ -1,7 +1,7 @@
 %define modname fedora_elections
 
 Name:           fedora-elections
-Version:        2.7
+Version:        2.9
 Release:        1%{?dist}
 Summary:        Fedora elections application
 
@@ -112,6 +112,11 @@ install -m 644 files/update_1_to_2.sql \
 
 
 %changelog
+* Mon Nov 18 2019 Ben Cotton <bcotton@fedoraproject.org> 2.9-1
+- Update to 2.9 (2.8 existed, in a sense)
+- Open "more info" links in a new window
+- Make it more clear that names are clickable links
+
 * Tue Oct 17 2017 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.7-1
 - Update to 2.7
 - Fix spelling error (VoidWhisperer)

