[Fedora Elections] #36: Consider hiding historical elections
by fedora-badges
#36: Consider hiding historical elections
---------------------+------------------------------------------------------
Reporter: tremble | Owner: nigelj
Type: defect | Status: new
Priority: minor | Milestone: Future Release
Component: General | Version: 0.2.1
Keywords: |
---------------------+------------------------------------------------------
The list of elections is growing.
While we want to keep the information (probably), do we really want to
display more than the last X (15? - just over two releases, would show how
a current board member was elected) months worth of election, and just
tuck the rest behind a "historical eletcions" link
--
Ticket URL: <https://fedorahosted.org/elections/ticket/36>
Fedora Elections <https://fedorahosted.org/elections/>
Fedora Elections
10 years, 1 month
[Fedora Elections] #26: First submit should be preview
by fedora-badges
#26: First submit should be preview
-------------------------+--------------------------------------------------
Reporter: mmcgrath | Owner: nigelj
Type: enhancement | Status: new
Priority: major | Milestone:
Component: General | Version: 0.1.5
Keywords: |
-------------------------+--------------------------------------------------
Minor thing but I think it might help, when you vote. The first screen to
submit to should really say "preview" instead of submit since you're not
submitting the vote until the final screen.
--
Ticket URL: <https://fedorahosted.org/elections/ticket/26>
Fedora Elections <https://fedorahosted.org/elections/>
Fedora Elections
11 years, 11 months
[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
2 commits - development.ini elections2/controllers elections2/lib elections2/templates
by Toshio くらとみ
development.ini | 3 +++
elections2/controllers/root.py | 4 ++--
elections2/lib/admin.py | 4 ++--
elections2/templates/master.html | 2 +-
4 files changed, 8 insertions(+), 5 deletions(-)
New commits:
commit ccc31815aa53d4ba4a921f908cb90440e859339c
Merge: dc8c329 5253f6c
Author: Toshio Kuratomi <toshio(a)fedoraproject.org>
Date: Thu Aug 18 09:40:47 2011 -0700
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/elections
Conflicts:
elections2/lib/admin.py
diff --cc elections2/lib/admin.py
index 70aa216,c6675de..9a44b61
--- a/elections2/lib/admin.py
+++ b/elections2/lib/admin.py
@@@ -28,7 -28,8 +28,8 @@@
#import turbogears
#from turbogears import controllers, expose, flash, redirect, config
#from turbogears import identity
-from tg import expose, flash, require, url, request, redirect
+from tg import config, expose, flash, require, url, request, redirect
+ from repoze.what import predicates
from elections2.lib.base import BaseController
from fedora.client import AuthError, AppError
from elections2 import model
commit dc8c329e1f636dfd9aa838d1c7419f8d6aa79496
Author: Toshio Kuratomi <toshio(a)fedoraproject.org>
Date: Thu Aug 18 09:39:38 2011 -0700
Make the elections administration group configurable
diff --git a/development.ini b/development.ini
index 280fe99..7204752 100644
--- a/development.ini
+++ b/development.ini
@@ -79,6 +79,9 @@ templating.mako.compiled_templates_dir = %(here)s/data/templates
# execute malicious code after an exception is raised.
#set debug = false
+# Set to a group that is allowed to administrate all elections
+admingroup = 'elections'
+
# Logging configuration
# Add additional loggers, handlers, formatters here
# Uses python's logging config file format
diff --git a/elections2/controllers/root.py b/elections2/controllers/root.py
index 54a5b23..83d4b60 100644
--- a/elections2/controllers/root.py
+++ b/elections2/controllers/root.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Main Controller"""
-from tg import expose, flash, require, url, request, redirect
+from tg import config, expose, flash, require, url, request, redirect
from pylons.i18n import ugettext as _, lazy_ugettext as l_
from tgext.admin.tgadminconfig import TGAdminConfig
from tgext.admin.controller import AdminController
@@ -224,7 +224,7 @@ class RootController(BaseController):
turbogears.flash("We are sorry, the results for this election cannot be viewed at this time because the election has not started.")
raise turbogears.redirect("/")
elif election.embargoed == 1:
- if identity.in_group('elections') :
+ if identity.in_group(config.get('admingroup', 'elections')):
pass
else :
match = 0
diff --git a/elections2/lib/admin.py b/elections2/lib/admin.py
index 19de935..70aa216 100644
--- a/elections2/lib/admin.py
+++ b/elections2/lib/admin.py
@@ -28,7 +28,7 @@
#import turbogears
#from turbogears import controllers, expose, flash, redirect, config
#from turbogears import identity
-from tg import expose, flash, require, url, request, redirect
+from tg import config, expose, flash, require, url, request, redirect
from elections2.lib.base import BaseController
from fedora.client import AuthError, AppError
from elections2 import model
@@ -44,7 +44,7 @@ import sqlalchemy, tg
identity = request.environ.get('repoze.who.identity')
class Admin(BaseController):
- allow_only = predicates.in_group("elections")
+ allow_only = predicates.in_group(config.get('admingroup', 'elections'))
def __init__(self, fas, appTitle):
#print dir(fas), fas.username
diff --git a/elections2/templates/master.html b/elections2/templates/master.html
index 7d60744..f86100c 100644
--- a/elections2/templates/master.html
+++ b/elections2/templates/master.html
@@ -37,7 +37,7 @@
<li py:if="request.identity" id="admin" class="loginlogout"><a href="${tg.url('/admin')}">Admin</a></li>
</span>
<!--
- <li py:if="('elections' in tg.identity.groups)">Admin</li>
+ <li py:if="(tg.config.get('admingroup', 'elections') in tg.identity.groups)">Admin</li>
-->
</ul>
<div py:if="tg.flash" class="flash">
12 years, 9 months
elections2/lib elections2/templates
by Kamal Ejaz Choudhri
elections2/lib/admin.py | 1 +
elections2/lib/vote.py | 1 +
elections2/templates/index.html | 4 +++-
3 files changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 5253f6cf3eb9df3d365e9207c797ac9870f196ff
Author: Kamal Ejaz <a2ninek(a)yahoo.com>
Date: Thu Aug 18 21:33:00 2011 +0500
Add lines in Admin and vote lib
diff --git a/elections2/lib/admin.py b/elections2/lib/admin.py
index 19de935..c6675de 100644
--- a/elections2/lib/admin.py
+++ b/elections2/lib/admin.py
@@ -29,6 +29,7 @@
#from turbogears import controllers, expose, flash, redirect, config
#from turbogears import identity
from tg import expose, flash, require, url, request, redirect
+from repoze.what import predicates
from elections2.lib.base import BaseController
from fedora.client import AuthError, AppError
from elections2 import model
diff --git a/elections2/lib/vote.py b/elections2/lib/vote.py
index 359e474..e5c3547 100644
--- a/elections2/lib/vote.py
+++ b/elections2/lib/vote.py
@@ -29,6 +29,7 @@
#from turbogears import controllers, expose, flash, redirect, config
#from turbogears import identity
from tg import expose, flash, require, url, request, redirect
+from repoze.what import predicates
from elections2.lib.base import BaseController
from elections2 import model
diff --git a/elections2/templates/index.html b/elections2/templates/index.html
index 09176d5..eeadcc1 100644
--- a/elections2/templates/index.html
+++ b/elections2/templates/index.html
@@ -61,7 +61,7 @@
</tr>
</table>
</py:if>
-
+
<py:if test="len(past)">
<h2>Past Elections</h2>
<table>
@@ -73,6 +73,7 @@
<th></th>
</tr>
<tr py:for="election in past">
+
<td>${election.shortdesc}</td>
<td>${election.start_date}</td>
<td>${election.end_date}</td>
@@ -103,6 +104,7 @@
</py:otherwise>
</py:choose>
</td>
+
</tr>
</table>
</py:if>
12 years, 9 months
elections.sql
by Toshio くらとみ
elections.sql | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
New commits:
commit 62180df17165d3a27c67d2c0524e1245f13caf2b
Author: Toshio Kuratomi <toshio(a)fedoraproject.org>
Date: Fri Aug 12 13:43:06 2011 -0700
Bring back the elections.sql file
diff --git a/elections.sql b/elections.sql
new file mode 100644
index 0000000..481e500
--- /dev/null
+++ b/elections.sql
@@ -0,0 +1,90 @@
+drop view electionvotes;
+drop view fvotecount;
+drop view votecount;
+drop view uservotes;
+
+drop table votes;
+drop table legalvoters;
+drop table candidates;
+drop table elections;
+
+CREATE TABLE elections (
+ id serial NOT NULL,
+-- was shortname
+ shortdesc text NOT NULL,
+-- was name
+ alias text NOT NULL,
+-- was info
+ description text NOT NULL,
+ url text NOT NULL,
+ start_date timestamp without time zone NOT NULL,
+ end_date timestamp without time zone NOT NULL,
+-- was max_seats
+ seats_elected integer NOT NULL,
+ votes_per_user integer NOT NULL,
+ embargoed integer default 0 NOT NULL,
+ usefas integer default 0 NOT NULL,
+ allow_nominations integer default 0 NOT NULL,
+ nominations_until timestamp without time zone,
+ unique (shortdesc),
+ primary key (id)
+);
+
+CREATE TABLE candidates (
+ id serial,
+ election_id integer NOT NULL,
+ name text NOT NULL,
+ url text,
+ formalname text,
+ human integer,
+ status integer,
+ foreign key (election_id) references elections (id),
+ unique (id),
+ primary key (id, election_id)
+);
+
+CREATE TABLE legalvoters (
+ id serial,
+ election_id integer not null,
+ group_name text not null,
+ foreign key (election_id) references elections (id),
+ primary key (id)
+);
+
+CREATE TABLE electionadmins (
+ id serial,
+ election_id integer not null,
+ group_name text not null,
+ foreign key (election_id) references elections (id),
+ primary key (id)
+);
+
+CREATE TABLE votes (
+ id serial,
+ voter text NOT NULL,
+ timestamp timestamp without time zone NOT NULL,
+ candidate_id integer NOT NULL,
+ weight integer NOT NULL,
+ election_id integer NOT NULL,
+ foreign key (candidate_id) references candidates(id),
+ foreign key (election_id) references elections(id),
+ primary key (id)
+);
+
+
+CREATE VIEW electionvotes AS
+ SELECT votes.election_id, count(votes.election_id) AS novotes FROM votes GROUP BY votes.election_id;
+
+
+
+
+CREATE VIEW votecount AS
+ SELECT votes.candidate_id, votes.election_id, sum(votes.weight) AS novotes FROM votes GROUP BY votes.candidate_id, votes.election_id ORDER BY sum(votes.weight) DESC;
+
+
+CREATE VIEW fvotecount AS
+ SELECT c.id, c.name, v.election_id, v.novotes FROM votecount v, candidates c WHERE (c.id = v.candidate_id) ORDER BY v.novotes DESC;
+
+
+CREATE VIEW uservotes AS
+ SELECT votes.election_id, votes.voter, count(votes.voter) AS novotes FROM votes GROUP BY votes.election_id, votes.voter;
12 years, 9 months
elections2/controllers
by Toshio くらとみ
elections2/controllers/root.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit c60cc2a9fa26f19c64736193a4bb5f9b30d4de48
Author: Toshio Kuratomi <toshio(a)fedoraproject.org>
Date: Mon Aug 1 19:43:27 2011 -0700
Correct typo in string
diff --git a/elections2/controllers/root.py b/elections2/controllers/root.py
index c8bb287..54a5b23 100644
--- a/elections2/controllers/root.py
+++ b/elections2/controllers/root.py
@@ -172,7 +172,7 @@ class RootController(BaseController):
if login_counter > 0:
flash(_('Wrong credentials'), 'warning')
if login_counter > 5:
- flash(_('Too many wront attempt -- Blocked user'), 'warning')
+ flash(_('Too many wrong attempts -- Blocked user'), 'warning')
login_dict['login_counter'] = str(login_counter)
login_dict['page'] = 'login'
login_dict['came_from'] = came_from
12 years, 9 months