################################
# Author: Benjamin Kellermann #
# Licence: CC-by-sa 3.0 #
# see Licence #
################################
olddir = File.expand_path(".")
Dir.chdir("..")
require "poll"
require "datepoll"
Dir.chdir(olddir)
if $cgi.include?("revision")
REVISION=$cgi["revision"].to_i
table = YAML::load(VCS.cat(REVISION, "data.yaml"))
else
table = YAML::load_file("data.yaml")
end
$htmlout += <
dudle - #{table.name}
#{table.name}
HEAD
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.include?("comment")
table.delete_comment($cgi["delete_comment"].to_i) if $cgi.include?("delete_comment")
# POLL
$htmlout += <
POLLTABLE
$htmlout += table.comment_to_html
# ADD COMMENT
$htmlout += <