aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhistory.rb2
-rw-r--r--poll.rb8
-rw-r--r--pollhead.rb6
3 files changed, 8 insertions, 8 deletions
diff --git a/history.rb b/history.rb
index e49f2e2..1d438c6 100755
--- a/history.rb
+++ b/history.rb
@@ -60,7 +60,7 @@ if defined?(REVISION)
else
$html << "<h2>Current Poll</h2>"
end
-$html << table.to_html
+$html << table.to_html("",false)
$html << "<h2>History</h2>"
$html << "<div id='history'>#{table.history_to_html}</div>"
diff --git a/poll.rb b/poll.rb
index 3ecd2ab..97ae081 100644
--- a/poll.rb
+++ b/poll.rb
@@ -60,10 +60,10 @@ class Poll
end
end
- def to_html(edituser = "", activecolumn = nil, participation = true)
+ def to_html(edituser = "", showparticipation = true)
ret = "<table border='1'>\n"
- ret += @head.to_html(activecolumn)
+ ret += @head.to_html
sort_data($cgi.include?("sort") ? $cgi.params["sort"] : ["timestamp"]).each{|participant,poll|
if edituser == participant
ret += participate_to_html(edituser)
@@ -71,7 +71,7 @@ class Poll
ret += "<tr class='participantrow'>\n"
ret += "<td class='name' #{edituser == participant ? "id='active'":""}>"
ret += participant
- ret += "<span class='edituser'> <sup><a href=\"?edituser=#{CGI.escapeHTML(CGI.escape(participant))}\">#{EDIT}</a></sup></span>"
+ ret += "<span class='edituser'> <sup><a href=\"?edituser=#{CGI.escapeHTML(CGI.escape(participant))}\">#{EDIT}</a></sup></span>" if showparticipation
ret += "</td>\n"
@head.each_column{|columnid,columntitle|
klasse = poll[columnid]
@@ -94,7 +94,7 @@ class Poll
}
# PARTICIPATE
- ret += participate_to_html(edituser) unless @data.keys.include?(edituser)
+ ret += participate_to_html(edituser) unless @data.keys.include?(edituser) || !showparticipation
# SUMMARY
ret += "<tr id='summary'><td class='name'>total</td>\n"
diff --git a/pollhead.rb b/pollhead.rb
index 35d397c..f062b13 100644
--- a/pollhead.rb
+++ b/pollhead.rb
@@ -78,13 +78,13 @@ class PollHead
end
end
- def to_html(config = false,activecolumn = nil)
+ def to_html(showeditbuttons = false,activecolumn = nil)
ret = "<tr><th><a href='?sort=name'>Name</a></th>\n"
@data.each{|columntitle,columndescription|
ret += "<th"
ret += " id='active' " if activecolumn == columntitle
ret += "><a title=\"#{columndescription}\" href=\"?sort=#{CGI.escapeHTML(CGI.escape(columntitle))}\">#{CGI.escapeHTML(columntitle)}</a>"
- if config
+ if showeditbuttons
ret += <<EDITDELETE
<div>
<small>
@@ -125,7 +125,7 @@ EDITDELETE
</form>
<fieldset><legend>Preview</legend>
<table>
-#{to_html(true)}
+#{to_html(true,activecolumn)}
</table>
</fieldset>
END