fedora-vote vote.cgi,1.5,1.6 votingdb.sql,1.4,1.5

Toshio Ernie Kuratomi (toshio) fedora-extras-commits at redhat.com
Fri Jun 16 15:50:53 UTC 2006


Author: toshio

Update of /cvs/fedora/fedora-vote
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31194

Modified Files:
	vote.cgi votingdb.sql 
Log Message:
* vote.cgi: Explanation that you can only vote once in this election.  Once
  you cast your vote you're done.
* votingdb.sql: Comment out everything to help prevent us from accidentally
  destroying the database.  To reverse the changes, remove the leading
  '-- ' from every line.



Index: vote.cgi
===================================================================
RCS file: /cvs/fedora/fedora-vote/vote.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vote.cgi	13 Jun 2006 08:15:46 -0000	1.5
+++ vote.cgi	16 Jun 2006 15:50:51 -0000	1.6
@@ -37,7 +37,7 @@
         </SCRIPT>
         <form NAME="%s" method="post" action="castvote.cgi"/>
           <h2>Ballot for %s Election</h2>
-          <p><b>Vote for %d candidates:</b></p>
+          <p><b>Vote for no more than %d candidates:</b></p>
             <table>
               <tr>
                 <th>Candidate</th>
@@ -61,6 +61,10 @@
             candidateNumber, candidateTuple[0]))
     content.append('''
             </table>
+            <p>Please note: Once you submit your ballot, your vote will be
+            recorded in the database and you won't be able to change it.  No
+            revoting is allowed for this election.
+            </p>
             <p class="votesubmission">
               <input type="submit" value="Submit Ballot" />
             </p>


Index: votingdb.sql
===================================================================
RCS file: /cvs/fedora/fedora-vote/votingdb.sql,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- votingdb.sql	15 Jun 2006 14:21:12 -0000	1.4
+++ votingdb.sql	16 Jun 2006 15:50:51 -0000	1.5
@@ -1,65 +1,73 @@
--- Definition of the SQL database for keeping ballot information
-drop database elections;
-create database elections;
-\c elections;
-
--- Identify a specific election
-create table election (
-id serial,
-start_date timestamp not null,
-end_date timestamp not null,
-common_name text unique not null,
--- For elections with no maximum number of seats, max_seats should be a
--- negative number.
-max_seats integer not null,
-primary key (id)
-);
-
--- Identify the account groups who can vote
-create table legalVoters (
-election_id integer references election(id),
--- This references cvsacct(project_group(id))
-group_id integer,
-primary key (election_id, group_id)
-);
-
--- A ballot submitted by a voter
-create table ballots (
--- voter is a reference to the cvsacct(person(id))) field.
-voter integer,
-id serial,
-election_id integer references election(id),
-unique (voter, election_id),
-primary key (id)
-);
-
--- The candidates for a specific election
-create table candidates (
--- id is a reference to the cvsacct(person(id))) field.
-id integer,
-election_id integer references election(id),
-primary key (id, election_id)
-);
-
--- Votes from a ballot for a candidate in a specific election
-create table votes (
-ballot_id integer references ballots(id),
-candidate_id integer,
-election_id integer references election(id),
-points integer not null,
-foreign key (candidate_id, election_id) references candidates(id, election_id),
-primary key (election_id, ballot_id, candidate_id)
-);
-
--- Running tallysheet of votes for each candidate in all the elections
-create view tallysheet as
-select sum(points) as vote_count, id, candidates.election_id from candidates, votes where candidates.id = candidate_id group by id, candidates.election_id order by candidates.election_id, vote_count desc;
-
-grant select on tallysheet to apache;
-grant select on election to apache;
-grant select on candidates to apache;
-grant select on legalVoters to apache;
-grant select on ballots to apache;
-grant insert on ballots to apache;
-grant insert on votes to apache;
-grant update on ballots_id_seq to apache;
+-- -- Definition of the SQL database for keeping ballot information
+-- -- drop database elections;
+-- -- create database elections;
+-- -- \c elections;
+-- 
+-- -- Cleanup
+-- drop view tallysheet;
+-- drop table votes;
+-- drop table ballots;
+-- drop table legalVoters;
+-- drop table candidates;
+-- drop table election;
+-- 
+-- -- Identify a specific election
+-- create table election (
+-- id serial,
+-- start_date timestamp not null,
+-- end_date timestamp not null,
+-- common_name text unique not null,
+-- -- For elections with no maximum number of seats, max_seats should be a
+-- -- negative number.
+-- max_seats integer not null,
+-- primary key (id)
+-- );
+-- 
+-- -- Identify the account groups who can vote
+-- create table legalVoters (
+-- election_id integer references election(id),
+-- -- This references cvsacct(project_group(id))
+-- group_id integer,
+-- primary key (election_id, group_id)
+-- );
+-- 
+-- -- A ballot submitted by a voter
+-- create table ballots (
+-- -- voter is a reference to the cvsacct(person(id))) field.
+-- voter integer,
+-- id serial,
+-- election_id integer references election(id),
+-- unique (voter, election_id),
+-- primary key (id)
+-- );
+-- 
+-- -- The candidates for a specific election
+-- create table candidates (
+-- -- id is a reference to the cvsacct(person(id))) field.
+-- id integer,
+-- election_id integer references election(id),
+-- primary key (id, election_id)
+-- );
+-- 
+-- -- Votes from a ballot for a candidate in a specific election
+-- create table votes (
+-- ballot_id integer references ballots(id),
+-- candidate_id integer,
+-- election_id integer references election(id),
+-- points integer not null,
+-- foreign key (candidate_id, election_id) references candidates(id, election_id),
+-- primary key (election_id, ballot_id, candidate_id)
+-- );
+-- 
+-- -- Running tallysheet of votes for each candidate in all the elections
+-- create view tallysheet as
+-- select sum(points) as vote_count, id, candidates.election_id from candidates, votes where candidates.id = candidate_id group by id, candidates.election_id order by candidates.election_id, vote_count desc;
+-- 
+-- grant select on tallysheet to apache;
+-- grant select on election to apache;
+-- grant select on candidates to apache;
+-- grant select on legalVoters to apache;
+-- grant select on ballots to apache;
+-- grant insert on ballots to apache;
+-- grant insert on votes to apache;
+-- grant update on ballots_id_seq to apache;




More information about the fedora-extras-commits mailing list