From e2a9d0a86fe918fefd55b4cf0f98fce0442e882f Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Nov 19 2019 09:07:47 +0000 Subject: [PATCH 1/6] Remove fedmenu from elections Signed-off-by: Clement Verna --- 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() }) - {% if config['FEDMENU_URL'] %} - - - {% endif %} - {% endblock %} From d2c991ddd63f5b3e4b48faa8986bc497e95de4e0 Mon Sep 17 00:00:00 2001 From: Ben Cotton Date: Nov 19 2019 09:07:47 +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 [Info]' % (title, candidate.url) + title = '%s [Info]' % (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 [Info]' % (title, candidate.url) + title = '%s [Info]' % (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 [Info]' % (title, candidate.url) + title = '%s [Info]' % (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 @@

{{election.description}}

-

[More Information]

+

[More Information]

Here are the candidates for the {{ election.seats_elected }} seat(s) open:

From ca37d89d92675fe3cd8d1ecf9c8ab0c28eba147d Mon Sep 17 00:00:00 2001 From: Ben Cotton Date: Nov 19 2019 09:07:47 +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 @@

{{election.description}}

-

[More Information]

+

[More Information]

Here are the candidates for the {{ election.seats_elected }} seat(s) open:

From 10b14d8ab3c1e20680b21c39f9116782f9d5d367 Mon Sep 17 00:00:00 2001 From: Ben Cotton Date: Nov 19 2019 09:07:47 +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 @@

Candidates

{% for candidate in election.candidates %} - + {% if election.candidates_are_fasusers %} {{ usernamemap['%s' % candidate.id] }} {% else %} {{ candidate.name }} {% endif %} + {% if candidate.url %}(click for more info){% endif %} {% endfor %} {% if election.candidates.count() == 0 %} From eaa9283723b7e8974aeebeeb85d0ea55d4a3085e Mon Sep 17 00:00:00 2001 From: Ben Cotton Date: Nov 19 2019 09:07:47 +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 [Info]' % (title, candidate.url) + title = '%s [Info]' % (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 [Info]' % (title, candidate.url) + title = '%s [Info]' % (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 [Info]' % (title, candidate.url) + title = '%s [Info]' % (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 @@

Candidates

{% 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 @@

{{election.description}}

-

[More Information]

+

[More Information]

Here are the candidates for the {{ election.seats_elected }} seat(s) open:

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 @@

{{election.description}}

-

[More Information]

+

[More Information]

Here are the candidates for the {{ election.seats_elected }} seat(s) open:

From dc98f988a43619738b03efe9c152257897f32281 Mon Sep 17 00:00:00 2001 From: Ben Cotton Date: Nov 19 2019 09:07:47 +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 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 - 2.7-1 - Update to 2.7 - Fix spelling error (VoidWhisperer)