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 | |
parent | 681cafa1480671810c0ce582d2e313150733a368 (diff) |
simpler invite participants interface
-rwxr-xr-x | invite_participants.rb | 2 | ||||
-rw-r--r-- | poll.rb | 24 |
2 files changed, 18 insertions, 8 deletions
diff --git a/invite_participants.rb b/invite_participants.rb index a62ab1d..ce487ff 100755 --- a/invite_participants.rb +++ b/invite_participants.rb @@ -35,7 +35,7 @@ inviteparticipantsstr = _("Invite Participants") $d << <<TABLE <h2>#{inviteparticipantsstr}</h2> <form method='post' action=''> - #{$d.table.to_html("","invite")} + #{$d.table.invite_to_html} </form> TABLE @@ -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) |