From 7effadace31c5c9efee2708e28acc4359b534b25 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Thu, 19 Nov 2009 23:39:54 +0100 Subject: better code structure --- participate.rb | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'participate.rb') diff --git a/participate.rb b/participate.rb index 7f8dce2..d134eb2 100755 --- a/participate.rb +++ b/participate.rb @@ -14,13 +14,10 @@ require "cgi" $cgi = CGI.new - olddir = File.expand_path(".") Dir.chdir("..") require "html" -$html = HTML.new require "poll" -load "charset.rb" load "config.rb" Dir.chdir(olddir) @@ -48,23 +45,26 @@ else table.add_comment($cgi["commentname"],$cgi["comment"]) if $cgi["comment"] != "" table.delete_comment($cgi["delete_comment"].to_i) if $cgi.include?("delete_comment") end +$html = HTML.new("dudle - #{table.name}") +$html.header["Cache-Control"] = "no-cache" +load "../charset.rb" $html.add_css("../dudle.css") $html.add_css("../print.css","print") $html.add_atom("atom.cgi") if File.exists?("../atom.rb") -$html.add_head("dudle - #{table.name}") -$html.htmlout += "" -$html.add_tabs +$html << "" + +$html << Dudle::tabs -$html.htmlout += < HEAD # TABLE if VCS.revno == 1 - $html.htmlout += <#{table.name}
     .
@@ -85,7 +85,7 @@ if VCS.revno == 1
 
HINT else - $html.htmlout += <history:#{table.history_to_html}

#{table.name}

@@ -95,13 +95,10 @@ else
TABLE - $html.htmlout += table.comment_to_html + $html << table.comment_to_html end -$html.htmlout += "" +$html << "" -$html.htmlout += "" - -$html.header["Cache-Control"] = "no-cache" -$cgi.out($html.header){$html.htmlout} +$html.out($cgi) end -- cgit v1.2.3