aboutsummaryrefslogtreecommitdiff
path: root/poll.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-06-03 09:23:40 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-06-03 09:23:40 +0200
commitb7e5654a565ee3d76f290cf14fbd4ac5632814d5 (patch)
treee99c0da47888f4970e12f897a1714ff4b68b17e9 /poll.rb
parent23646a1a6aa8ec6399d507681bf35c863a4f6829 (diff)
cleaner interface
Diffstat (limited to 'poll.rb')
-rw-r--r--poll.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/poll.rb b/poll.rb
index a219534..2b735f8 100644
--- a/poll.rb
+++ b/poll.rb
@@ -155,8 +155,9 @@ class Poll
end
def comment_to_html
ret = "<div id='comments'>"
+ ret += "<fieldset><legend>Comments</legend>"
+
unless @comment.empty?
- ret += "<fieldset><legend>Comments</legend>"
@comment.each_with_index{|c,i|
time,name,comment = c
ret += <<COMMENT
@@ -174,8 +175,23 @@ class Poll
</form>
COMMENT
}
- ret += "</fieldset>"
end
+
+ # ADD COMMENT
+ ret += <<ADDCOMMENT
+ <form method='post' action='.'>
+ <div>
+ <fieldset>
+ <legend>
+ <input value='anonymous' type='text' name='commentname' size='1' /> says
+ </legend>
+ <textarea cols='50' rows='7' name='comment' ></textarea>
+ <br /><input type='submit' value='Submit comment' />
+ </fieldset>
+ </div>
+ </form>
+ADDCOMMENT
+ ret += "</fieldset>"
ret += "</div>\n"
ret