aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-10-24 18:40:40 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-10-24 18:40:40 +0200
commit5aff0fbb822b6e3ae57f1826fcfb5edc7a251e1a (patch)
treedd77e9fc1cb6b6a51576a400a74c15313c56894a
parentf32796e819791331ee54a0687f3b2e585063d8e1 (diff)
do not show comments on unconfigured poll
-rwxr-xr-xparticipate.rb33
-rw-r--r--poll.rb26
2 files changed, 30 insertions, 29 deletions
diff --git a/participate.rb b/participate.rb
index 7d0550a..d828079 100755
--- a/participate.rb
+++ b/participate.rb
@@ -83,8 +83,34 @@ $htmlout += <<HEAD
HEAD
# TABLE
-$htmlout += <<TABLE
-<h1>#{table.name}</h1>
+ $htmlout += "<h1>#{table.name}</h1>"
+if VCS.revno == 1
+ $htmlout += <<HINT
+<pre
+ style="font-family:Courier New,Courier,monospace;
+ letter-spacing:0;
+ margin-top: -8ex;
+ line-height:95%;"
+>
+ .
+ .:;:.
+.:;;;;;:.
+ ;;;;;
+ ;;;;;
+ ;;;;;
+ ;;;;; Please press the config link on
+ ;:;;; the top left corner of this page
+ ;;; : to configure this poll!
+ ;:;
+ ;.: .
+ : .
+ . .
+
+ .
+</pre>
+HINT
+else
+ $htmlout += <<TABLE
<div id='polltable'>
<form method='post' action='.'>
#{table.to_html($cgi['edituser'])}
@@ -92,7 +118,8 @@ $htmlout += <<TABLE
</div>
TABLE
-$htmlout += table.comment_to_html
+ $htmlout += table.comment_to_html
+end
$htmlout += "</body>"
diff --git a/poll.rb b/poll.rb
index 547c83e..931ca5d 100644
--- a/poll.rb
+++ b/poll.rb
@@ -64,32 +64,6 @@ EDITDELETE
ret
end
def to_html(edituser = "", config = false,activecolumn = nil)
- if VCS.revno == 1 && !config
- return <<HINT
-<pre
- style="font-family:Courier New,Courier,monospace;
- letter-spacing:0;
- margin-top: -8ex;
- line-height:95%;"
->
- .
- .:;:.
-.:;;;;;:.
- ;;;;;
- ;;;;;
- ;;;;;
- ;;;;; Please press the config link on
- ;:;;; the top left corner of this page
- ;;; : to configure this poll!
- ;:;
- ;.: .
- : .
- . .
-
- .
-</pre>
-HINT
- end
ret = "<table border='1'>\n"
ret += head_to_html(config, activecolumn)