diff options
Diffstat (limited to 'participate.rb')
-rwxr-xr-x | participate.rb | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/participate.rb b/participate.rb index ff7da89..5153f0d 100755 --- a/participate.rb +++ b/participate.rb @@ -24,9 +24,11 @@ if __FILE__ == $0 load "../dudle.rb" $d = Dudle.new +edit = false unless $cgi.include?("cancel") if $cgi.include?("delete_participant_confirm") $d.table.delete($cgi["delete_participant_confirm"]) + edit = true elsif $cgi.include?("add_participant") agreed = {} $cgi.params.each{|k,v| @@ -36,23 +38,29 @@ unless $cgi.include?("cancel") } $d.table.add_participant($cgi["olduser"],$cgi["add_participant"],agreed) + edit = true end end -$d.table.add_comment($cgi["commentname"],$cgi["comment"]) if $cgi["comment"] != "" -$d.table.delete_comment($cgi["delete_comment"]) if $cgi.include?("delete_comment") +if $cgi["comment"] != "" + $d.table.add_comment($cgi["commentname"],$cgi["comment"]) + edit = true +end +if $cgi.include?("delete_comment") + $d.table.delete_comment($cgi["delete_comment"]) + edit = true +end -$d.html.add_atom("atom.cgi") if File.exists?("../atom.rb") +if edit + $d.html.header["status"] = "REDIRECT" + $d.html.header["Cache-Control"] = "no-cache" + $d.html.header["Location"] = SITEURL + $d << _("The changes were saved, you should be redirected to %{link}.") % {:link => "<a href=\"#{SITEURL}\">#{SITEURL}</a>"} -reloadstr = _("Reload") -$d << <<END -<form method='get' action='.'> -<div> -<input value='#{reloadstr}' type='submit'/> -</div> -</form> -END +else + +$d.html.add_atom("atom.cgi") if File.exists?("../atom.rb") # TABLE $d << <<HTML @@ -65,5 +73,7 @@ $d << <<HTML #{$d.table.comment_to_html} HTML +end + $d.out end |