aboutsummaryrefslogtreecommitdiff
path: root/poll.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-24 22:21:04 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-24 22:21:04 +0100
commit308c067fb65cc22422c8feae1f2e8691255e3f96 (patch)
treed4303b0c96c5679fefe8bfc9a5420644d95be4bb /poll.rb
parenta7466acd2a8720e0dbb87972225c8937d44addca (diff)
invite implemented
Diffstat (limited to '')
-rw-r--r--poll.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/poll.rb b/poll.rb
index b0c44ad..a0c55a9 100644
--- a/poll.rb
+++ b/poll.rb
@@ -60,7 +60,12 @@ class Poll
end
end
+ # showparticipation \in {true, false, "invite"}
def to_html(edituser = "", showparticipation = true)
+ if showparticipation == "invite"
+ showparticipation = false
+ invite = true
+ end
ret = "<table border='1' summary='Main Poll table'>\n"
sortcolumns = $cgi.include?("sort") ? $cgi.params["sort"] : ["timestamp"]
@@ -97,6 +102,7 @@ class Poll
# PARTICIPATE
ret += participate_to_html(edituser) unless @data.keys.include?(edituser) || !showparticipation
+ ret += invite_to_html if invite
# SUMMARY
ret += "<tr id='summary'><td class='name'>total</td>\n"
@@ -139,6 +145,20 @@ class Poll
ret
end
+ def invite_to_html
+ ret = <<INVITE
+<tr id='add_participant'>
+<td class='name'>
+ <input size='16' type='text' name='add_participant' />
+</td>
+<td class='checkboxes' colspan='#{@head.col_size + 1}'>
+ <input type='submit' value='Invite' />
+</td>
+</tr>
+INVITE
+
+ end
+
def participate_to_html(edituser)
checked = {}
if @data.include?(edituser)