[Fedora Elections] #44: Rework FAS integration
by fedora-badges
#44: Rework FAS integration
-------------------------+-----------------------------
Reporter: pingou | Owner: nigelj
Type: enhancement | Status: new
Priority: major | Milestone: Future Release
Component: General | Version:
Keywords: | Blocked By:
Blocking: |
-------------------------+-----------------------------
At the moment we keep the user's FAS name in memcached but this is not
working so well and quite ofte we're stuck or very slow.
What we could do is add a new table or a new field in the candidate table,
to store locally the FAS name.
This way, when we add/edit candidates, we would query FAS for their name,
store it locally and forget about memcached.
--
Ticket URL: <https://fedorahosted.org/elections/ticket/44>
Fedora Elections <https://fedorahosted.org/elections/>
Fedora Elections
7 years, 2 months
[Fedora Elections] #45: Add support for claiming badge from voting
by fedora-badges
#45: Add support for claiming badge from voting
-------------------------+-----------------------------
Reporter: jflory7 | Owner: nigelj
Type: enhancement | Status: new
Priority: critical | Milestone: Future Release
Component: Voting | Version: 0.2.1
Keywords: badges | Blocked By:
Blocking: |
-------------------------+-----------------------------
= Enhancement =
After voting, a user can click a link to receive a badge for participating
in the elections (similar to Nuancier).
= Analysis =
Ideally, there should be a way to determine if a badge is available for an
individual election or for all elections globally. I think the current
idea is to make it so that there is just one badge for the entire election
cycle, but it may make more sense to design it so that each individual
link is set up with a badge claim code, should there ever be a need or
desire to create a badge for a specific election.
It would be claimed like in Nuancier, where the user is presented with the
link to the badge immediately after submitting their vote to any given
election.
= Implementation =
1. Choose an election, vote.
2. Submit votes.
3. On post-vote / confirmation page, "Thanks for voting! etc." and
clickable link with the badge claim URL
--
Ticket URL: <https://fedorahosted.org/elections/ticket/45>
Fedora Elections <https://fedorahosted.org/elections/>
Fedora Elections
7 years, 7 months
Branch 'develop' - 11 commits - fedora_elections/templates .gitignore README.rst runserver.py Vagrantfile
by Pierre-YvesChibon
.gitignore | 1 +
README.rst | 33 +++++++++++++++++++++++++++++++++
Vagrantfile | 12 ++++++++++++
fedora_elections/templates/base.html | 2 +-
fedora_elections/templates/index.html | 10 +++++-----
runserver.py | 6 +++++-
6 files changed, 57 insertions(+), 7 deletions(-)
New commits:
commit 48e7d4534b52907274c4fb4f238ee8d2a338e0ef
Merge: d1829db 9e9dbeb
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu Sep 1 14:24:35 2016 +0200
Merge pull request #63 from fedora-infra/fix_links
Specify rel="noopener noreferrer" to link including target='_blank'
commit 9e9dbeb605c1050154b74156ae241b65febe544c
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed Aug 31 18:47:46 2016 +0200
Specify rel="noopener noreferrer" to link including target='_blank'
This avoids potential security risk:
https://dev.to/ben/the-targetblank-vulnerability-by-example
https://mathiasbynens.github.io/rel-noopener/
diff --git a/fedora_elections/templates/base.html b/fedora_elections/templates/base.html
index 78c0669..eace1ed 100644
--- a/fedora_elections/templates/base.html
+++ b/fedora_elections/templates/base.html
@@ -81,7 +81,7 @@
<p id="footer">
Copyright © 2013-2014 Red Hat
- <a href="//github.com/fedora-infra/elections/"
+ <a href="//github.com/fedora-infra/elections/" rel="noopener noreferrer"
target="_blank">elections</a>
-- version: {{ version }}
</p>
commit d1829db16456c8e02f1d2056982b0e53cd42a66a
Merge: 5db065b 28bc5a2
Author: Ryan Lerch <ryanlerch(a)users.noreply.github.com>
Date: Mon Aug 29 19:22:21 2016 +1000
Merge pull request #62 from ryanlerch/vagrant
Add a vagrantfile to hack on elections using Vagrant
commit 28bc5a2abdbd037a45f76b54d8ea877fe40fbd2e
Author: Ryan Lerch <rlerch(a)redhat.com>
Date: Mon Aug 29 16:08:26 2016 +1000
Added .vagrant/ to the gitignore
diff --git a/.gitignore b/.gitignore
index 3ea936c..a7b527f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ build/
dist/
.coverage
alembic.ini
+.vagrant/
commit 4c324a97cca7d09ea2d0ef1009631f061212fe0a
Author: Ryan Lerch <rlerch(a)redhat.com>
Date: Mon Aug 29 16:08:05 2016 +1000
updated README with vagrant instructions
diff --git a/README.rst b/README.rst
index 96a39c8..6878919 100644
--- a/README.rst
+++ b/README.rst
@@ -12,6 +12,39 @@ adapted to other projects. Fedora-elections is integrated with the Fedora
Account System (FAS).
+Hacking with Vagrant
+====================
+Quickly start hacking on elections using the vagrant setup that is included in
+the elections repo is super simple.
+
+First, install Vagrant and the vagrant-libvirt plugin from the official Fedora
+repos::
+
+ $ sudo dnf install vagrant vagrant-libvirt
+
+The elections vagrant setup uses vagrant-sshfs for syncing files between your
+host and the vagrant dev machine. vagrant-sshfs is not in the Fedora repos
+(yet), so we install the vagrant-sshfs plugin from dustymabe's COPR repo::
+
+ $ sudo dnf copr enable dustymabe/vagrant-sshfs
+ $ sudo dnf install vagrant-sshfs
+
+Now, from within main directory (the one with the Vagrantfile in it) of your git
+checkout of elections, run the ``vagrant up`` command to provision your dev
+environment::
+
+ $ vagrant up
+
+When this command is completed (it may take a while) you will be able to ssh
+into your dev VM with ``vagrant ssh`` and then run the command to start the
+elections server::
+
+ $ vagrant ssh
+ [vagrant@localhost ~]$ pushd /vagrant/; ./runserver.py --host "0.0.0.0";
+
+Once that is running, simply go to http://localhost:5002/ in your browser on
+your host to see your running elections test instance.
+
Running from a checkout:
========================
commit 93d1e4749c09698d744a9a8edc05b3c89753e597
Author: Ryan Lerch <rlerch(a)redhat.com>
Date: Mon Aug 29 16:07:37 2016 +1000
added Vagrantfile for Fedora elections
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 0000000..e72dbf8
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,12 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure(2) do |config|
+ config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86..."
+ config.vm.box = "f23-cloud-libvirt"
+ config.vm.network "forwarded_port", guest: 5000, host: 5002
+ config.vm.synced_folder ".", "/vagrant", type: "sshfs"
+ config.vm.provision "shell", inline: "dnf -y install python redhat-rpm-config python-devel python-pip rpl"
+ config.vm.provision "shell", inline: "pushd /vagrant/; pip install -r requirements.txt"
+ config.vm.provision "shell", inline: "pushd /vagrant/; python createdb.py", privileged: false
+end
commit 9aff244adfa8b1d9bb17c76f992172d3d2cfaaa9
Author: Ryan Lerch <rlerch(a)redhat.com>
Date: Mon Aug 29 15:58:02 2016 +1000
added the ability to set the host from command line in runserver.py
diff --git a/runserver.py b/runserver.py
index 03becc0..415f49f 100755
--- a/runserver.py
+++ b/runserver.py
@@ -25,6 +25,10 @@ parser.add_argument(
parser.add_argument(
'--port', '-p', default=5000,
help='Port for the flask application.')
+parser.add_argument(
+ '--host', default="127.0.0.1",
+ help='Hostname to listen on. When set to 0.0.0.0 the server is available \
+ externally. Defaults to 127.0.0.1 making the it only visable on localhost')
args = parser.parse_args()
@@ -43,4 +47,4 @@ if args.config:
os.environ['FEDORA_ELECTIONS_CONFIG'] = config
APP.debug = True
-APP.run(host='127.0.0.1', port=int(args.port))
+APP.run(host=args.host, port=int(args.port))
commit 5db065b1a5dc5d1f583cf4b3ef727254e8f5c595
Merge: 8b39a79 fba81d3
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Jul 26 09:00:05 2016 +0200
Merge pull request #60 from jflory7/patch-1
Correct spelling, fix grammar errors
commit fba81d3a734a7558cf8a776c8b773acfc9dcd05b
Author: Justin W. Flory <jflory7(a)users.noreply.github.com>
Date: Mon Jul 25 19:59:08 2016 -0400
Correct spelling, fix grammar errors
Minor modifications:
* committies => committees
* is => are
* held => held
And some other very minor things to improve English readability.
diff --git a/fedora_elections/templates/index.html b/fedora_elections/templates/index.html
index 2660281..a112aec 100644
--- a/fedora_elections/templates/index.html
+++ b/fedora_elections/templates/index.html
@@ -50,13 +50,13 @@
{% if tag == 'index' %}
<p>
- The <a href='https://fedoraproject.org'>Fedora project</a> is a community
- driven project. It has a number of steering commities whose responsibilities
- is to drive the project forward.
+ The <a href='https://fedoraproject.org'>Fedora Project</a> is a community-
+ driven project. It has a number of steering committees whose responsibilities
+ are to drive the project forward.
</p>
<p>
- These committies are elected among volunteers of the community and by
- the community members. The present application is meant to held these
+ These committees are elected among volunteers of the community and by
+ the community members. The present application is meant to hold these
elections.
</p>
{% endif %}
commit 8b39a79afe54c4018f61d159668a6b63bd4ccf89
Merge: c26a153 772d55b
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sat Jul 16 10:16:14 2016 +0200
Merge pull request #59 from VoidWhisperer/develop
Fix spelling error
commit 772d55b8398630bb8f17d48aa26968bda70af02b
Author: VoidWhisperer <voidwhisperer(a)voidchar.com>
Date: Sat Jul 16 04:10:33 2016 -0400
Fix spelling error
responsabilities -> responsibilities
diff --git a/fedora_elections/templates/index.html b/fedora_elections/templates/index.html
index 5d15ef8..2660281 100644
--- a/fedora_elections/templates/index.html
+++ b/fedora_elections/templates/index.html
@@ -51,7 +51,7 @@
{% if tag == 'index' %}
<p>
The <a href='https://fedoraproject.org'>Fedora project</a> is a community
- driven project. It has a number of steering commities whose responsabilities
+ driven project. It has a number of steering commities whose responsibilities
is to drive the project forward.
</p>
<p>
7 years, 8 months