From 54386017ceacacb2a6990a29bffc7f93982572e4 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Thu, 26 Nov 2009 00:15:10 +0100 Subject: heavy code restructuring, moved common code to dudle.rb --- invite_participants.rb | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'invite_participants.rb') 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 . # ############################################################################ -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 << "" -$html << Dudle::tabs("Invite Participants") - -$html << < -

#{table.name}

+$d << <
Invite Participants - #{table.to_html("","invite")} + #{$d.table.to_html("","invite")} TABLE -$html << "" - -$html.out($cgi) +$d.out($cgi) end -- cgit v1.2.3