[Fedora Elections] #28: Improvements for the Voting App: Allow voting multiple times
by fedora-badges
#28: Improvements for the Voting App: Allow voting multiple times
-------------------------+--------------------------------------------------
Reporter: ixs | Owner: nigelj
Type: enhancement | Status: new
Priority: major | Milestone:
Component: General | Version: 0.1.5
Keywords: |
-------------------------+--------------------------------------------------
Please allow voting multiple times with each later vote canceling the
previous votes. This easily allows to correct a mistake during the voting
procedure or accounts for changed opinion.
There has just been a bit of discussion on IRC where people accidentially
voted incorrectly and would have liked such a feature.
kthxbai
--
Ticket URL: <https://fedorahosted.org/elections/ticket/28>
Fedora Elections <https://fedorahosted.org/elections/>
Fedora Elections
11 years, 11 months
Changes to 'refs/tags/0.2.1-1'
by Nigel Jones
Changes since the dawn of time:
Luca Foppiano (2):
Close ticket #1 : add default sort order to candidates and to votes
Fixed #6: Write documentation
Nigel Jones (89):
mv dev.cfg & ignore
Small cleanup
Schema/Model:
Controllers:
Controllers:
Close ticket #2 (Vote confirmation page)
Update svn:ignore & start controller for editing
WIP - Edit Elections
Implement Range Voting!
Comment out the debugger, enable date checks
SCHEMA CHANGE
Gaa, handle ValueError for non integers
More changes... a results page\!
Silly mistake
Add some sanity checking
Add election and election_started to info's dict so we can disable the form because the election starts, also show results if the election has ended.
Just some WIP stuff relating to creating elections + string correction
Some working signs of adding elections... needs A LOT of work
FAS Identity Configured
Slight corrections but otherwise... IT WORKS
More identity checking - WIP
New Files - WSGI Voodoo and COPYING (GPL 2)
Additions/Deletions:
Opps, missed this one
Renames:
baseurl->tg.url changes and a small tweak to setup.py
Misc Bug Fixes
Okay, I was doing it all wrong...
Template changes, why have info links if they goto self, I think this is the cause of the 500 errors
* elections.sql
Small template name changes
Oppsie
* controllers.py:
Something went wack, I was getting DOS EOLs
Update to 0.1.0!
Small spelling corrections
More bugfixes
Merge Rickys fix and fix links as reported to webmaster
Controllers update to close Ticket #18 \(Typo after voting has been done\)
String and CSS updates
Hmmm the typo dtimms found didn't find it's way back to master.
Schema changes
Setup .gitignore
.gitignore & schema changes
Make adding candidates easier
Embargoed entry...
Add check for 'anycla' (any group bar CLA)
gitignore update
Add embargoed check
Old spec file...
Bump to 0.1.5
Update manifest.in
Fix a little oopsie!
Schema oopsie
WIP
Just to be sure...
SP Fix...
Merge branch '0.1.5'
Change where fas2 is loaded from (API change)
Make some small adjustments
Update SQL schema
I hate .txt....
Clean UPDATE-NOTES
Split off /vote/ this won't work yet...
Actually, this might just work
Readapt /admin/newe/ (new election form) and / (main election list) for new schema, also fix up SQL schema
Fix up adding new candidates
Make /about/foo work again...
Votes can now be recorded
And now one can see the results... everything now uses the new schema (I think)
Fix SQL for timestamps...
Better way to determine if to translate candidate names via FAS or not
Import FAS correctly
Grab Candidate's name from FAS when election is set to usefas - part 1
Grab Candidate's name from FAS when election is set to usefas - part 2/2
Get rid of /admin/ and make admin stuff API only...
Fix admnewe.html for now, fix API (thanks Toshio)
Update to about.html to start nomination stuff, also dos2unix a heap of files...
Commit minor edits to SQL
Just a tiny change
Random fix ups to make the current code work as the old did.
Changes/updates to SQL schema
Minor update again to bring it in line with whats actually required.
Fix missing comma
Merge branch 'master' of ssh://fedorahosted.org/git/elections
Bump to 0.2.0 for production
Missing import (oops!)
Add a verification page to the elections application.
[Ticket #30] Selected the wrong field - bad mistake.
Ricky Zhou (7):
Initial import.
Initial theming.
tg => turbogears
Fix other bug.
One more tg => turbogears
Add missing comma.
Add MANIFEST.in
Toshio Kuratomi (8):
Preliminary port to using jsonfas2 with csrf protection.
Switch apache config to Location
Don't need SABase here.
Fix import of python-fedora login/logout controller methods.
Fix parameter and variable to be the same
Return the appTitle as well
Move config from the wsgi script into the config file.
Fix erroneous removal of tg_flash from the master template.
14 years, 5 months
[Fedora Elections] #22: Switch to mySQL by default & revamp schema
by fedora-badges
#22: Switch to mySQL by default & revamp schema
---------------------+------------------------------------------------------
Reporter: nigelj | Owner: nigelj
Type: task | Status: new
Priority: blocker | Milestone: Release 0.2.0
Component: General | Version: 0.1.5
Keywords: |
---------------------+------------------------------------------------------
We really need to revamp the SQL schema to make it more appropriate to how
we use the application and also do ticket #21.
I've got a fair idea on how the schema will look.
--
Ticket URL: <https://fedorahosted.org/elections/ticket/22>
Fedora Elections <https://fedorahosted.org/elections/>
Fedora Elections
14 years, 5 months
elections/templates
by Nigel Jones
elections/templates/verify.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 08945cf333778989669244aa55b42da89f5d8e08
Author: Nigel Jones <nigelj(a)fedoraproject.org>
Date: Fri Dec 4 20:36:59 2009 +1000
[Ticket #30] Selected the wrong field - bad mistake.
diff --git a/elections/templates/verify.html b/elections/templates/verify.html
index 553fc12..6b65995 100644
--- a/elections/templates/verify.html
+++ b/elections/templates/verify.html
@@ -11,11 +11,11 @@
<p>Please check the below content to ensure that all of your cast votes are marked as 'valid', if you notice any elections showing that you have an invalid vote cast please contact the election administration team by creating a ticket at the <a href="https://fedorahosted.org/fedora-infrastructure/">Fedora Infrastructure ticket system</a> and select the 'Elections' component with your FAS username and the election that is marked as invalid.</p>
<h2 py:if="validvotes">Valid Votes</h2>
<ul py:if="validvotes">
- <li py:for="vote in validvotes"><a href="${tg.url('/about/' + validvotes[vote].election.alias)}">${validvotes[vote].election.description}</a></li>
+ <li py:for="vote in validvotes"><a href="${tg.url('/about/' + validvotes[vote].election.alias)}">${validvotes[vote].election.shortdesc}</a></li>
</ul>
<h2 py:if="invalidvotes">Invalid Votes</h2>
<ul py:if="invalidvotes">
- <li py:for="vote in invalidvotes"><a href="${tg.url('/about/' + invalidvotes[vote].election.alias)}">${invalidvotes[vote].election.description}</a></li>
+ <li py:for="vote in invalidvotes"><a href="${tg.url('/about/' + invalidvotes[vote].election.alias)}">${invalidvotes[vote].election.shortdesc}</a></li>
</ul>
</body>
14 years, 5 months
Changes to 'refs/tags/0.2.0-1'
by Nigel Jones
Changes since the dawn of time:
Luca Foppiano (2):
Close ticket #1 : add default sort order to candidates and to votes
Fixed #6: Write documentation
Nigel Jones (87):
mv dev.cfg & ignore
Small cleanup
Schema/Model:
Controllers:
Controllers:
Close ticket #2 (Vote confirmation page)
Update svn:ignore & start controller for editing
WIP - Edit Elections
Implement Range Voting!
Comment out the debugger, enable date checks
SCHEMA CHANGE
Gaa, handle ValueError for non integers
More changes... a results page\!
Silly mistake
Add some sanity checking
Add election and election_started to info's dict so we can disable the form because the election starts, also show results if the election has ended.
Just some WIP stuff relating to creating elections + string correction
Some working signs of adding elections... needs A LOT of work
FAS Identity Configured
Slight corrections but otherwise... IT WORKS
More identity checking - WIP
New Files - WSGI Voodoo and COPYING (GPL 2)
Additions/Deletions:
Opps, missed this one
Renames:
baseurl->tg.url changes and a small tweak to setup.py
Misc Bug Fixes
Okay, I was doing it all wrong...
Template changes, why have info links if they goto self, I think this is the cause of the 500 errors
* elections.sql
Small template name changes
Oppsie
* controllers.py:
Something went wack, I was getting DOS EOLs
Update to 0.1.0!
Small spelling corrections
More bugfixes
Merge Rickys fix and fix links as reported to webmaster
Controllers update to close Ticket #18 \(Typo after voting has been done\)
String and CSS updates
Hmmm the typo dtimms found didn't find it's way back to master.
Schema changes
Setup .gitignore
.gitignore & schema changes
Make adding candidates easier
Embargoed entry...
Add check for 'anycla' (any group bar CLA)
gitignore update
Add embargoed check
Old spec file...
Bump to 0.1.5
Update manifest.in
Fix a little oopsie!
Schema oopsie
WIP
Just to be sure...
SP Fix...
Merge branch '0.1.5'
Change where fas2 is loaded from (API change)
Make some small adjustments
Update SQL schema
I hate .txt....
Clean UPDATE-NOTES
Split off /vote/ this won't work yet...
Actually, this might just work
Readapt /admin/newe/ (new election form) and / (main election list) for new schema, also fix up SQL schema
Fix up adding new candidates
Make /about/foo work again...
Votes can now be recorded
And now one can see the results... everything now uses the new schema (I think)
Fix SQL for timestamps...
Better way to determine if to translate candidate names via FAS or not
Import FAS correctly
Grab Candidate's name from FAS when election is set to usefas - part 1
Grab Candidate's name from FAS when election is set to usefas - part 2/2
Get rid of /admin/ and make admin stuff API only...
Fix admnewe.html for now, fix API (thanks Toshio)
Update to about.html to start nomination stuff, also dos2unix a heap of files...
Commit minor edits to SQL
Just a tiny change
Random fix ups to make the current code work as the old did.
Changes/updates to SQL schema
Minor update again to bring it in line with whats actually required.
Fix missing comma
Merge branch 'master' of ssh://fedorahosted.org/git/elections
Bump to 0.2.0 for production
Missing import (oops!)
Ricky Zhou (7):
Initial import.
Initial theming.
tg => turbogears
Fix other bug.
One more tg => turbogears
Add missing comma.
Add MANIFEST.in
Toshio Kuratomi (8):
Preliminary port to using jsonfas2 with csrf protection.
Switch apache config to Location
Don't need SABase here.
Fix import of python-fedora login/logout controller methods.
Fix parameter and variable to be the same
Return the appTitle as well
Move config from the wsgi script into the config file.
Fix erroneous removal of tg_flash from the master template.
14 years, 5 months
elections/controllers.py elections/model.py elections/release.py elections/templates
by Nigel Jones
elections/controllers.py | 17 +++++++++++++++++
elections/model.py | 9 ++++++---
elections/release.py | 2 +-
elections/templates/master.html | 1 +
elections/templates/verify.html | 22 ++++++++++++++++++++++
5 files changed, 47 insertions(+), 4 deletions(-)
New commits:
commit 7eab767b9a73cdbaca9c47994215c8367f340508
Author: Nigel Jones <nigelj(a)fedoraproject.org>
Date: Fri Dec 4 20:10:45 2009 +1000
Add a verification page to the elections application.
URL is <foo>/verify
As this is a temporary solution I'm not adding it to any menus for now.
This is for Ticket #30
diff --git a/elections/controllers.py b/elections/controllers.py
index be91cf5..7e32a3a 100644
--- a/elections/controllers.py
+++ b/elections/controllers.py
@@ -121,6 +121,23 @@ class Root(controllers.RootController):
votecount = VoteTally.query.filter_by(election_id=eid).order_by(VoteTally.novotes.desc()).all()
return dict(votecount=votecount, usernamemap=usernamemap, election=election, appTitle=self.appTitle)
+ @identity.require(identity.not_anonymous())
+ @expose(template="elections.templates.verify")
+ def verify(self):
+ validvotes = {}
+ invalidvotes = {}
+ c = 0
+ allvotes = UserVoteCount.query.filter_by(voter=turbogears.identity.current.user_name).all()
+ for v in allvotes:
+ if len(v.election.candidates) == v.novotes:
+ validvotes[c] = v
+ c=c+1
+ else:
+ invalidvotes[c] = v
+ c=c+1
+ return dict(validvotes=validvotes, invalidvotes=invalidvotes, appTitle=self.appTitle)
+
+
@expose(template="elections.templates.login", allow_json=True)
def login(self, forward_url=None, *args, **kwargs):
login_dict = fc_login(forward_url, args, kwargs)
diff --git a/elections/model.py b/elections/model.py
index 77c27ab..c93cd43 100644
--- a/elections/model.py
+++ b/elections/model.py
@@ -38,10 +38,11 @@ VoteTallyTable = Table('fvotecount', metadata,
Column('novotes', Integer, nullable=False)
)
UserVoteCountTable = Table('uservotes', metadata,
- Column('election_id', Integer, primary_key=True),
- Column('voter', String, nullable=False),
+ Column('election_id', Integer, ForeignKey('elections.id'), primary_key=True),
+ Column('voter', String, nullable=False, primary_key=True),
Column('novotes', Integer, nullable=False)
)
+
#
# Classes to map to
#
@@ -63,13 +64,15 @@ class VoteTally(SABase):
class UserVoteCount(SABase):
pass
+
#
# set up mappers between tables and classes
#
mapper(Elections, ElectionsTable, properties = {
'legalVoters': relation(LegalVoters, backref='election'),
- 'candidates': relation(Candidates, backref='election')
+ 'candidates': relation(Candidates, backref='election'),
+ 'uservotes': relation(UserVoteCount, backref='election')
})
mapper(Votes, VotesTable)
mapper(Candidates, CandidatesTable, properties = {
diff --git a/elections/release.py b/elections/release.py
index 79a8b53..26f1c9c 100644
--- a/elections/release.py
+++ b/elections/release.py
@@ -24,7 +24,7 @@
# Release information about elections
-version = "0.2.0"
+version = "0.2.1"
description = "Elections Application for Fedora Project"
# long_description = "More description about your plan"
diff --git a/elections/templates/master.html b/elections/templates/master.html
index 33f5ce1..217e222 100644
--- a/elections/templates/master.html
+++ b/elections/templates/master.html
@@ -32,6 +32,7 @@
<ul class="toolbar" id="#main-toolbar">
<logintoolitem href="${tg.url('/')}" />
+ <li py:if="('elections' in tg.identity.groups)">Admin</li>
</ul>
<div py:if="tg_flash" class="flash">
${tg_flash}
diff --git a/elections/templates/verify.html b/elections/templates/verify.html
new file mode 100644
index 0000000..553fc12
--- /dev/null
+++ b/elections/templates/verify.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="master.html" />
+ <head>
+ <title>${appTitle}</title>
+ </head>
+ <body>
+ <h1>Vote Verification Page</h1>
+ <p>Please check the below content to ensure that all of your cast votes are marked as 'valid', if you notice any elections showing that you have an invalid vote cast please contact the election administration team by creating a ticket at the <a href="https://fedorahosted.org/fedora-infrastructure/">Fedora Infrastructure ticket system</a> and select the 'Elections' component with your FAS username and the election that is marked as invalid.</p>
+ <h2 py:if="validvotes">Valid Votes</h2>
+ <ul py:if="validvotes">
+ <li py:for="vote in validvotes"><a href="${tg.url('/about/' + validvotes[vote].election.alias)}">${validvotes[vote].election.description}</a></li>
+ </ul>
+ <h2 py:if="invalidvotes">Invalid Votes</h2>
+ <ul py:if="invalidvotes">
+ <li py:for="vote in invalidvotes"><a href="${tg.url('/about/' + invalidvotes[vote].election.alias)}">${invalidvotes[vote].election.description}</a></li>
+ </ul>
+
+ </body>
+</html>
14 years, 5 months