r38 - trunk
by lfoppiano@fedoraproject.org
Author: lfoppiano
Date: 2008-05-29 11:44:50 +0000 (Thu, 29 May 2008)
New Revision: 38
Modified:
trunk/README.txt
Log:
Fixed #6: Write documentation
Modified: trunk/README.txt
===================================================================
--- trunk/README.txt 2008-05-29 10:41:00 UTC (rev 37)
+++ trunk/README.txt 2008-05-29 11:44:50 UTC (rev 38)
@@ -1,4 +1,64 @@
-elections
+Documentation
-This is a TurboGears (http://www.turbogears.org) project. It can be
-started by running the start-elections.py script.
\ No newline at end of file
+* What is fedora-election?
+fedora-elections is a web application written in python and based on
+TurboGears which aim to help to make decisions where is necessary to
+give a preferences.
+This project is developed over fedoraproject requests, but,
+can be easily adapt to be used from any other association/project.
+Fedora-elections is integrated with Fedora Account System (FAS) and
+provides an agile and easy interface to make decision using votes.
+
+
+* Installation
+You can get files by svn repository. You need a valid FAS account in
+particular you need to upload your ssh public key because svn require
+authentication also to checkout/update.
+
+Before launch fedora-elections, you need this packages installed on your
+machine:
+ - postgresql-server
+ - TurboGears
+ - CherryPy
+ - python-fedora (you need to enable fedora testing-updates repository)
+
+Before start fedora elections you need to set-up property your database.
+
+Copy your dev-dist.cfg to dev.cfg and start to edit it. This is your
+development configuration file. prod.cfg is your Production configuration
+file.
+
+ - sqlite
+SQLite is useful to quick start because doesn't need any type of
+configuration.
+You have just to edit dev.cfg and make sure you have a line like this:
+
+ sqlalchemy.dburi="sqlite://path_of_your_database"
+
+ - PostgreSQL
+First of all you need to create and configure an user and database
+and give permission on it.
+
+su - postgres
+createuse felections
+createdb -O felections felections
+psql felections felection < /path/to/election/trunk/elections.sql
+
+(don't forget to edit your pg_sql.conf data and assign to felections on
+your host)
+
+* How to start
+Fedora-elections can be started by running the
+start-elections.py script.
+
+
+* How to contribute
+If you find bug or want to propose ideas or stuff to be implemented or if
+you are interested to became a developer for this project just
+ask on #fedora-admin irc channel on irc.freenode.net or use our
+web site https://fedorahosted.org/elections.
+
+* Licence
+fedora-elections is licenced under GPL v2.
+
+
15 years, 11 months
r37 - in branches/0.1.0-STABLE/elections: . templates
by Nigel Jones
Author: nigelj
Date: 2008-05-29 10:41:00 +0000 (Thu, 29 May 2008)
New Revision: 37
Modified:
branches/0.1.0-STABLE/elections/controllers.py
branches/0.1.0-STABLE/elections/templates/about.html
branches/0.1.0-STABLE/elections/templates/ballot.html
branches/0.1.0-STABLE/elections/templates/confirm.html
branches/0.1.0-STABLE/elections/templates/results.html
Log:
Merge bugfixes from trunk
Modified: branches/0.1.0-STABLE/elections/controllers.py
===================================================================
--- branches/0.1.0-STABLE/elections/controllers.py 2008-05-29 10:32:35 UTC (rev 36)
+++ branches/0.1.0-STABLE/elections/controllers.py 2008-05-29 10:41:00 UTC (rev 37)
@@ -113,7 +113,7 @@
raise turbogears.redirect("/about/" + str(election.name))
candidates = Candidates.query.filter_by(election_id=eid).order_by(Candidates.name).all()
- uservote = UserVoteCount.query.filter_by(election_id=eid, voter=tg.identity.current.user_name).all()
+ uservote = UserVoteCount.query.filter_by(election_id=eid, voter=turbogears.identity.current.user_name).all()
#Before we do *ANYTHING* check if voting hasn't begun/has ended
curtime = datetime.utcnow()
@@ -142,7 +142,7 @@
turbogears.flash("Invalid Ballot!")
raise turbogears.redirect("/")
for uvote in uvotes:
- Votes(voter=tg.identity.current.user_name, candidate_id=uvote, weight=uvotes[uvote], election_id=eid)
+ Votes(voter=turbogears.identity.current.user_name, candidate_id=uvote, weight=uvotes[uvote], election_id=eid)
turbogears.flash("Saved!")
raise turbogears.redirect("/")
else:
@@ -167,7 +167,7 @@
turbogears.flash("Invalid Ballot!")
raise turbogears.redirect("/")
- return dict(voteinfo=uvotes, candidates=candidates, election=election, voter=kw['name'])
+ return dict(voteinfo=uvotes, candidates=candidates, election=election)
@expose(template="elections.templates.results")
def results(self,eid=None):
Modified: branches/0.1.0-STABLE/elections/templates/about.html
===================================================================
--- branches/0.1.0-STABLE/elections/templates/about.html 2008-05-29 10:32:35 UTC (rev 36)
+++ branches/0.1.0-STABLE/elections/templates/about.html 2008-05-29 10:41:00 UTC (rev 37)
@@ -10,10 +10,10 @@
<!-- Also need to list eligable voting groups... -->
<h1>${election.name}</h1>
<p>${election.info}</p>
- <p><a href="${candidates[0].election.url}">[More Information]</a></p>
+ <p py:if="election.url"><a href="${election.url}">[More Information]</a></p>
<table border="1" cellpadding="1">
<tr py:for="candidate in candidates">
- <td>${candidate.name} <small><a href="${candidate.url}">[info]</a></small></td>
+ <td>${candidate.name} <small py:if="candidate.url"><a href="${candidate.url}">[info]</a></small></td>
</tr>
<!-- This link is okay, but one should appear if the election has public results -->
<tr>
Modified: branches/0.1.0-STABLE/elections/templates/ballot.html
===================================================================
--- branches/0.1.0-STABLE/elections/templates/ballot.html 2008-05-29 10:32:35 UTC (rev 36)
+++ branches/0.1.0-STABLE/elections/templates/ballot.html 2008-05-29 10:41:00 UTC (rev 37)
@@ -9,11 +9,11 @@
<body>
<h1>${election.name}</h1>
<p>${election.info}</p>
- <p><a href="${election.url}">[More Information]</a></p>
+ <p py:if="election.url"><a href="${election.url}">[More Information]</a></p>
<form action="${tg.url('/vote/' + str(election.id))}" method="post">
<table border="1" cellpadding="1">
<tr py:for="candidate in candidates">
- <td>${candidate.name} <small><a href="${candidate.url}">[info]</a></small></td>
+ <td>${candidate.name} <small py:if="candidate.url"><a href="${candidate.url}">[info]</a></small></td>
<td><input type="text" name="${candidate.id}" value="" /></td>
</tr>
<tr>
Modified: branches/0.1.0-STABLE/elections/templates/confirm.html
===================================================================
--- branches/0.1.0-STABLE/elections/templates/confirm.html 2008-05-29 10:32:35 UTC (rev 36)
+++ branches/0.1.0-STABLE/elections/templates/confirm.html 2008-05-29 10:41:00 UTC (rev 37)
@@ -9,11 +9,11 @@
<body>
<h1>Confirm Vote in ${election.name}</h1>
<p>${election.info}</p>
- <p><a href="${election.url}">[More Information]</a></p>
+ <p py:if="election.url"><a href="${election.url}">[More Information]</a></p>
<form action="${tg.url('/vote/' + str(election.id))}" method="post">
<table border="1" cellpadding="1">
<tr py:for="candidate in candidates">
- <td>${candidate.name} <small><a href="${candidate.url}">[info]</a></small></td>
+ <td>${candidate.name} <small py:if="candidate.url"><a href="${candidate.url}">[info]</a></small></td>
<td><input type="text" name="${candidate.id}" value="${voteinfo[candidate.id]}" readonly="readonly" /></td>
</tr>
<tr>
Modified: branches/0.1.0-STABLE/elections/templates/results.html
===================================================================
--- branches/0.1.0-STABLE/elections/templates/results.html 2008-05-29 10:32:35 UTC (rev 36)
+++ branches/0.1.0-STABLE/elections/templates/results.html 2008-05-29 10:41:00 UTC (rev 37)
@@ -9,10 +9,10 @@
<body>
<h1>${election.name} Results</h1>
<p>${election.info}</p>
- <p><a href="${election.url}">[More Information]</a></p>
+ <p py:if="candidate.url"><a href="${election.url}">[More Information]</a></p>
<table border="1" cellpadding="1">
<tr py:for="candcount in votecount">
- <td>${candcount.candidate.name} <small><a href="${candcount.candidate.url}">[info]</a></small></td>
+ <td>${candcount.candidate.name} <small py:if="candcount.candidate.url"><a href="${candcount.candidate.url}">[info]</a></small></td>
<td>${candcount.novotes}</td>
</tr>
</table>
15 years, 11 months
r36 - trunk/elections/templates
by Nigel Jones
Author: nigelj
Date: 2008-05-29 10:32:35 +0000 (Thu, 29 May 2008)
New Revision: 36
Modified:
trunk/elections/templates/about.html
trunk/elections/templates/ballot.html
trunk/elections/templates/confirm.html
trunk/elections/templates/results.html
Log:
Template changes, why have info links if they goto self, I think this is the cause of the 500 errors
Modified: trunk/elections/templates/about.html
===================================================================
--- trunk/elections/templates/about.html 2008-05-29 07:32:26 UTC (rev 35)
+++ trunk/elections/templates/about.html 2008-05-29 10:32:35 UTC (rev 36)
@@ -10,10 +10,10 @@
<!-- Also need to list eligable voting groups... -->
<h1>${election.name}</h1>
<p>${election.info}</p>
- <p><a href="${candidates[0].election.url}">[More Information]</a></p>
+ <p py:if="election.url"><a href="${election.url}">[More Information]</a></p>
<table border="1" cellpadding="1">
<tr py:for="candidate in candidates">
- <td>${candidate.name} <small><a href="${candidate.url}">[info]</a></small></td>
+ <td>${candidate.name} <small py:if="candidate.url"><a href="${candidate.url}">[info]</a></small></td>
</tr>
<!-- This link is okay, but one should appear if the election has public results -->
<tr>
Modified: trunk/elections/templates/ballot.html
===================================================================
--- trunk/elections/templates/ballot.html 2008-05-29 07:32:26 UTC (rev 35)
+++ trunk/elections/templates/ballot.html 2008-05-29 10:32:35 UTC (rev 36)
@@ -9,11 +9,11 @@
<body>
<h1>${election.name}</h1>
<p>${election.info}</p>
- <p><a href="${election.url}">[More Information]</a></p>
+ <p py:if="election.url"><a href="${election.url}">[More Information]</a></p>
<form action="${tg.url('/vote/' + str(election.id))}" method="post">
<table border="1" cellpadding="1">
<tr py:for="candidate in candidates">
- <td>${candidate.name} <small><a href="${candidate.url}">[info]</a></small></td>
+ <td>${candidate.name} <small py:if="candidate.url"><a href="${candidate.url}">[info]</a></small></td>
<td><input type="text" name="${candidate.id}" value="" /></td>
</tr>
<tr>
Modified: trunk/elections/templates/confirm.html
===================================================================
--- trunk/elections/templates/confirm.html 2008-05-29 07:32:26 UTC (rev 35)
+++ trunk/elections/templates/confirm.html 2008-05-29 10:32:35 UTC (rev 36)
@@ -9,11 +9,11 @@
<body>
<h1>Confirm Vote in ${election.name}</h1>
<p>${election.info}</p>
- <p><a href="${election.url}">[More Information]</a></p>
+ <p py:if="election.url"><a href="${election.url}">[More Information]</a></p>
<form action="${tg.url('/vote/' + str(election.id))}" method="post">
<table border="1" cellpadding="1">
<tr py:for="candidate in candidates">
- <td>${candidate.name} <small><a href="${candidate.url}">[info]</a></small></td>
+ <td>${candidate.name} <small py:if="candidate.url"><a href="${candidate.url}">[info]</a></small></td>
<td><input type="text" name="${candidate.id}" value="${voteinfo[candidate.id]}" readonly="readonly" /></td>
</tr>
<tr>
Modified: trunk/elections/templates/results.html
===================================================================
--- trunk/elections/templates/results.html 2008-05-29 07:32:26 UTC (rev 35)
+++ trunk/elections/templates/results.html 2008-05-29 10:32:35 UTC (rev 36)
@@ -9,10 +9,10 @@
<body>
<h1>${election.name} Results</h1>
<p>${election.info}</p>
- <p><a href="${election.url}">[More Information]</a></p>
+ <p py:if="candidate.url"><a href="${election.url}">[More Information]</a></p>
<table border="1" cellpadding="1">
<tr py:for="candcount in votecount">
- <td>${candcount.candidate.name} <small><a href="${candcount.candidate.url}">[info]</a></small></td>
+ <td>${candcount.candidate.name} <small py:if="candcount.candidate.url"><a href="${candcount.candidate.url}">[info]</a></small></td>
<td>${candcount.novotes}</td>
</tr>
</table>
15 years, 11 months