From 47988b9d4bccb0b6145e1d2cf7462879576f6521 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Fri, 20 Nov 2009 10:31:24 +0100 Subject: changed interface to many tabs --- poll.rb | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) (limited to 'poll.rb') diff --git a/poll.rb b/poll.rb index de99659..89b97fe 100644 --- a/poll.rb +++ b/poll.rb @@ -47,13 +47,13 @@ class Poll end end - def to_html(edituser = "", config = false,activecolumn = nil) + def to_html(edituser = "", activecolumn = nil) ret = "\n" - ret += @head.to_html(config, activecolumn) + ret += @head.to_html(activecolumn) sort_data($cgi.include?("sort") ? $cgi.params["sort"] : ["timestamp"]).each{|participant,poll| if edituser == participant - ret += participate_to_html(edituser, config) + ret += participate_to_html(edituser) else ret += "\n" ret += "\n" @@ -124,7 +124,7 @@ class Poll ret end - def participate_to_html(edituser, config) + def participate_to_html(edituser) checked = {} if @data.include?(edituser) @head.each_columnid{|k| checked[k] = @data[edituser][k]} @@ -139,29 +139,25 @@ class Poll name='add_participant' value=\"#{edituser}\"/>" ret += "\n" - unless config - @head.each_column{|columnid,columntitle| - ret += "" + @head.each_column{|columnid,columntitle| + ret += "" + } + ret += "
" @@ -81,7 +81,7 @@ class Poll } # PARTICIPATE - ret += participate_to_html(edituser, config) unless @data.keys.include?(edituser) + ret += participate_to_html(edituser) unless @data.keys.include?(edituser) # SUMMARY ret += "
total" - [[YES, YESVAL],[NO, NOVAL],[MAYBE, MAYBEVAL]].each{|valhuman, valbinary| - ret += " - - - " - } - ret += "
- - - -
" + [[YES, YESVAL],[NO, NOVAL],[MAYBE, MAYBEVAL]].each{|valhuman, valbinary| + ret += " + + + " } - ret += "
+ + + +
" - else - ret += "" - end + ret += "
" if @data.include?(edituser) ret += "" ret += "
" -- cgit v1.2.3