diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-25 09:54:56 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-25 09:54:56 +0100 |
commit | a885e4d8b3842709c71e077ea991342c7f4aa814 (patch) | |
tree | a9910749064f8f3294d45f912c6f7093b31be480 /delete_poll.rb | |
parent | d36cdabf0a200fd774ec631e2374191443788f99 (diff) |
distinguish between title and url
Diffstat (limited to 'delete_poll.rb')
-rwxr-xr-x | delete_poll.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/delete_poll.rb b/delete_poll.rb index 871272c..d2681ed 100755 --- a/delete_poll.rb +++ b/delete_poll.rb @@ -30,10 +30,19 @@ require "ftools" if __FILE__ == $0 -POLL = File.basename(File.expand_path(".")) $cgi = CGI.new -load "../html.rb" -$html = HTML.new("dudle - #{POLL} - Delete") + +olddir = File.expand_path(".") +Dir.chdir("..") +load "html.rb" +load "config.rb" +require "poll" +require "yaml" +Dir.chdir(olddir) + +POLLNAME = YAML::load_file("data.yaml").name +POLL = File.basename(File.expand_path(".")) +$html = HTML.new("dudle - #{POLLNAME} - Delete") $html.header["Cache-Control"] = "no-cache" @@ -95,9 +104,9 @@ end $html << <<TABLE #{Dudle::tabs("Delete Poll")} <div id='main'> - <h1>#{POLL}</h1> + <h1>#{POLLNAME}</h1> <h2>Delete this Poll</h2> - You want to delete the poll named <b>#{POLL}</b>.<br /> + You want to delete the poll named <b>#{POLLNAME}</b>.<br /> This is an irreversible action!<br /> If you are sure in what you are doing, please type into the form “#{QUESTIONS[CONFIRM]}” #{hint} |