Index: openacs-4/packages/oct-election/oct-election.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/oct-election/oct-election.info,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/oct-election/oct-election.info 14 May 2005 19:49:49 -0000 1.1
+++ openacs-4/packages/oct-election/oct-election.info 14 May 2005 20:25:01 -0000 1.2
@@ -8,7 +8,7 @@
f
oct-election
-
+
Joel Aufrecht
Web app for voting in OCT elections.
Index: openacs-4/packages/oct-election/www/election.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/oct-election/www/election.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/oct-election/www/election.tcl 14 May 2005 19:49:49 -0000 1.1
+++ openacs-4/packages/oct-election/www/election.tcl 14 May 2005 20:25:01 -0000 1.2
@@ -36,18 +36,29 @@
}
sub_class narrow
}
+ count {
+ label "Count"
+ }
}
db_multirow \
-extend {
delete_url
+ count
} candidates candidates_select {
- select candidate_id,
- label as candidate_label
- from oct_candidate
- where election = :election_id
+ select oc.candidate_id,
+ oc.label as candidate_label,
+ count(ov.candidate_id) as cand_count
+ from oct_candidate oc left outer join oct_vote ov using (candidate_id)
+ where oc.election = :election_id
+ group by oc.candidate_id, oc.label
} {
set delete_url [export_vars -base "candidate-delete" {candidate_id election_id}]
+ if {} {
+ set count $cand_count
+ } else {
+ set count "Results pending"
+ }
}
#TODO: show vote total if election is over