aboutsummaryrefslogtreecommitdiff
path: root/poll.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2011-05-27 15:14:52 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2011-05-27 15:14:52 +0200
commit2411b8e804a98bba43da4ad2b341e73d7b748a07 (patch)
tree953d241e81bacb52607e3229b22de2cb988ae052 /poll.rb
parent388ad0a2b2bd88d56cd38a9755ca2c23928c4bdb (diff)
add thead, tbody and to main table
Diffstat (limited to 'poll.rb')
-rw-r--r--poll.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/poll.rb b/poll.rb
index dea71a8..1d6389b 100644
--- a/poll.rb
+++ b/poll.rb
@@ -107,10 +107,11 @@ class Poll
end
def to_html(showparticipation = true)
# border=1 for textbrowsers ;--)
- ret = "<table class='polltable' border='1'>\n"
+ ret = "<table id='participanttable' class='polltable' border='1'>\n"
sortcolumns = $cgi.include?("sort") ? $cgi.params["sort"] : ["timestamp"]
- ret += @head.to_html(sortcolumns)
+ ret += "<thead>#{@head.to_html(sortcolumns)}</thead>"
+ ret += "<tbody id='participants'>"
sort_data(sortcolumns).each{|participant,poll|
if $cgi["edituser"] == participant
ret += participate_to_html
@@ -141,6 +142,7 @@ class Poll
@@table_html_hooks.each{|hook| ret += hook.call(ret)}
+ ret += "</tbody><tbody>"
# PARTICIPATE
ret += participate_to_html unless @data.keys.include?($cgi["edituser"]) || !showparticipation
@@ -171,7 +173,7 @@ class Poll
}
ret += "<td class='invisible'></td></tr>"
- ret += "</table>\n"
+ ret += "</tbody></table>\n"
ret
end