diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2010-02-22 00:01:46 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2010-02-22 00:01:46 +0100 |
commit | 5676ca7738e2d53191493a3761cd11f14e83dbed (patch) | |
tree | 0c880e552cb1edb56c79ae2577b9a28a22490b86 /poll.rb | |
parent | 681cafa1480671810c0ce582d2e313150733a368 (diff) |
simpler invite participants interface
Diffstat (limited to 'poll.rb')
-rw-r--r-- | poll.rb | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -65,10 +65,6 @@ class Poll # showparticipation \in {true, false, "invite"} def to_html(edituser = "", showparticipation = true) - if showparticipation == "invite" - showparticipation = false - invite = true - end ret = "<table border='1'>\n" sortcolumns = $cgi.include?("sort") ? $cgi.params["sort"] : ["timestamp"] @@ -105,7 +101,6 @@ 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" @@ -150,7 +145,21 @@ class Poll def invite_to_html invitestr = _("Invite") - ret = <<INVITE + namestr = _("Name") + ret = <<HEAD +<table> +<tr> + <th>#{namestr}</th> + <td class='invisible'></td> +</tr> +HEAD + @data.each_key{|participant| + ret += <<ROW + <tr><td class='name'>#{participant}</td><td class='invisible'></td></tr> +ROW + } + + ret += <<INVITE <tr id='add_participant'> <td class='name'> <input size='16' type='text' name='add_participant' /> @@ -159,8 +168,9 @@ class Poll <input type='submit' value='#{invitestr}' /> </td> </tr> +</table> INVITE - + ret end def participate_to_html(edituser) |