From 1f066293d7bdd11f2c112f94e327259684d774c8 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Thu, 26 Nov 2009 13:04:54 +0100 Subject: implemented choose-css --- index.cgi | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) (limited to 'index.cgi') diff --git a/index.cgi b/index.cgi index dbd8cce..e1737fc 100755 --- a/index.cgi +++ b/index.cgi @@ -19,36 +19,24 @@ # along with dudle. If not, see . # ############################################################################ -require "yaml" -require "cgi" - - if __FILE__ == $0 -$cgi = CGI.new if File.exists?("config.rb") - load "config.rb" + require "dudle" else puts "\nPlease configure me in the file config.rb" exit end -require "poll" -require "html" -$html = HTML.new("dudle") -load "charset.rb" -$html.add_css("dudle.css") -$htlm.add_atom("atom.cgi") if File.exists?("atom.cgi") - - $html << "

dudle

" +$d = Dudle.new("Home") if $cgi.include?("create_poll") && $cgi.include?("poll_url") POLLNAME=$cgi["create_poll"] if $cgi["poll_url"] == "" POLLURL = `pwgen -1`.chomp else - POLLURL=$cgi["poll_url"] + OLLURL=$cgi["poll_url"] end @@ -71,18 +59,16 @@ if $cgi.include?("create_poll") && $cgi.include?("poll_url") } Poll.new(POLLNAME,$cgi["poll_type"]) Dir.chdir("..") - escapedsite = SITEURL + CGI.escapeHTML(CGI.escape(POLLURL)) + "/edit_columns.cgi" - escapedsite.gsub!("+"," ") - $html.header["status"] = "REDIRECT" - $html.header["Cache-Control"] = "no-cache" - $html.header["Location"] = escapedsite - $html << "The poll was created successfully. The link to your new poll is:
#{escapedsite}" + $d.html.header["status"] = "REDIRECT" + $d.html.header["Cache-Control"] = "no-cache" + $d.html.header["Location"] = SITEURL + "/edit_columns.cgi" + $d << "The poll was created successfully. The link to your new poll is:
#{escapedsite}" end end -unless $html.header["status"] == "REDIRECT" +unless $d.html.header["status"] == "REDIRECT" - $html << <Create New Poll
@@ -114,7 +100,7 @@ unless $html.header["status"] == "REDIRECT" CREATE if defined?(createnotice) - $html << < NOTICE end - $html << < CREATE - $html << NOTICE - $html << "" + $d << NOTICE end -$html.out($cgi) +$d.out($cgi) end -- cgit v1.2.3
#{createnotice} @@ -122,15 +108,14 @@ CREATE