diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-26 00:15:10 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-26 00:15:10 +0100 |
commit | 54386017ceacacb2a6990a29bffc7f93982572e4 (patch) | |
tree | 762f8f6b6aa504ca7ffc767bd5c43e1c2212e3ea /invite_participants.rb | |
parent | 5ebf12ea5b30cd9a7c5c31bff087d7703f1e149c (diff) |
heavy code restructuring, moved common code to dudle.rb
Diffstat (limited to 'invite_participants.rb')
-rwxr-xr-x | invite_participants.rb | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/invite_participants.rb b/invite_participants.rb index 6c9204a..abb1ddc 100755 --- a/invite_participants.rb +++ b/invite_participants.rb @@ -19,47 +19,23 @@ # along with dudle. If not, see <http://www.gnu.org/licenses/>. # ############################################################################ -require "yaml" -require "cgi" - - if __FILE__ == $0 -$cgi = CGI.new - -olddir = File.expand_path(".") -Dir.chdir("..") -require "html" -load "config.rb" -require "poll" -Dir.chdir(olddir) - +load "../dudle.rb" -table = YAML::load_file("data.yaml") +$d = Dudle.new("Invite Participants") if $cgi.include?("add_participant") - table.add_participant("",$cgi["add_participant"],{}) + $d.table.add_participant("",$cgi["add_participant"],{}) end -$html = HTML.new("dudle - #{table.name} - Invite Participants") -$html.header["Cache-Control"] = "no-cache" -load "../charset.rb" -$html.add_css("../dudle.css") - -$html << "<body>" -$html << Dudle::tabs("Invite Participants") - -$html << <<TABLE - <div id='main'> - <h1>#{table.name}</h1> +$d << <<TABLE <h2>Invite Participants</h2> <form method='post' action=''> - #{table.to_html("","invite")} + #{$d.table.to_html("","invite")} </form> TABLE -$html << "</div></body>" - -$html.out($cgi) +$d.out($cgi) end |