################################ # 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 += <
#{table.to_html}
POLLTABLE $htmlout += table.comment_to_html # ADD COMMENT $htmlout += <
Comment


ADDCOMMENT # HISTORY MAXREV=VCS.revno REVISION=MAXREV unless defined?(REVISION) log = VCS.history log.collect!{|s| s.scan(/\nrevno:.*\ncommitter.*\n.*\ntimestamp: (.*)\nmessage:\n (.*)/).flatten} log.shift log.collect!{|t,c| [DateTime.parse(t),c]} $htmlout += <
browse history HISTORY ((REVISION-2)..(REVISION+2)).each do |i| if i >0 && i<=MAXREV if REVISION == i $htmlout += "" $htmlout += "" $htmlout += "" $htmlout += "" end end $htmlout += "
rev time description of change
#{i}" else $htmlout += "
" $htmlout += "#{i}" end $htmlout += "#{log[i-1][0].strftime('%d.%m, %H:%M')}#{log[i-1][1]}
" $htmlout += "
" $htmlout += "" $htmlout +=<
Configure the Poll config
CONFIG $htmlout += ""