From c933e165e5e76fbc5b44336bd88a3e930c8d2e48 Mon Sep 17 00:00:00 2001
From: Benjamin Kellermann
Date: Sun, 14 Jun 2009 22:29:43 +0200
Subject: put historynav to poll class
---
participate.rb | 74 +++++++++++++++++++++-------------------------------------
1 file changed, 27 insertions(+), 47 deletions(-)
(limited to 'participate.rb')
diff --git a/participate.rb b/participate.rb
index 6cb0a3c..feca58f 100644
--- a/participate.rb
+++ b/participate.rb
@@ -15,6 +15,20 @@ if $cgi.include?("revision")
table = YAML::load(VCS.cat(REVISION, "data.yaml"))
else
table = YAML::load_file("data.yaml")
+
+ if $cgi.include?("add_participant")
+ agreed = {}
+ $cgi.params.each{|k,v|
+ if k =~ /^add_participant_checked_/
+ agreed[k.gsub(/^add_participant_checked_/,"")] = v[0]
+ end
+ }
+
+ table.add_participant($cgi["add_participant"],agreed)
+ end
+
+ table.add_comment($cgi["commentname"],$cgi["comment"]) if $cgi["comment"] != ""
+ table.delete_comment($cgi["delete_comment"].to_i) if $cgi.include?("delete_comment")
end
$htmlout += <
-
-
- #{BACK}
- config
+
HEAD
-
-# HISTORY
-MAXREV=VCS.revno
-REVISION=MAXREV unless defined?(REVISION)
-log = VCS.history
-log.shift
-log.collect!{|s| s.scan(/\nrevno:.*\ncommitter.*\n.*\ntimestamp: (.*)\nmessage:\n (.*)/).flatten}
-log.collect!{|t,c| [DateTime.parse(t),c]}
-
-$htmlout +=" history:"
-
-((REVISION-2)..(REVISION+2)).each do |i|
- if i >0 && i<=MAXREV
- $htmlout += " "
- $htmlout += "" if REVISION != i
- $htmlout += "#{i}"
- $htmlout += "" if REVISION != i
- end
-end
-$htmlout += " "
-
# TABLE
-$htmlout += "#{table.name}
"
-if $cgi.include?("add_participant")
- agreed = {}
- $cgi.params.each{|k,v|
- if k =~ /^add_participant_checked_/
- agreed[k.gsub(/^add_participant_checked_/,"")] = v[0]
- end
- }
-
- table.add_participant($cgi["add_participant"],agreed)
-end
-
-table.add_comment($cgi["commentname"],$cgi["comment"]) if $cgi["comment"] != ""
-table.delete_comment($cgi["delete_comment"].to_i) if $cgi.include?("delete_comment")
-
-# POLL
-$htmlout += <#{table.name}
-
+
-POLLTABLE
+TABLE
$htmlout += table.comment_to_html
-
$htmlout += ""
--
cgit v1.2.3