aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2011-04-15 14:37:33 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2011-04-15 14:37:33 +0200
commit560495b91aeb83cacb23fe4025fee7c76f2de7c6 (patch)
tree761766571a254648afb9145e31b19c314a9b6c47
parente22ae14b085424e4226ca386ad9845a90023664b (diff)
change strings to achieve same length for all types
-rw-r--r--classic.css14
-rw-r--r--default.css8
-rw-r--r--poll.rb22
-rw-r--r--print.css6
4 files changed, 26 insertions, 24 deletions
diff --git a/classic.css b/classic.css
index 1a75d0f..e438404 100644
--- a/classic.css
+++ b/classic.css
@@ -27,10 +27,10 @@ a.comment_sort, a.top_bottom_ref {
}
-td.ayes, td.bmaybe, td.cno { cursor:default; }
-td.ayes{ background-color:#0F0; }
-td.cno { background-color:#F00; }
-td.bmaybe { background-color:#FF0; }
+td.a_yes__, td.b_maybe, td.c_no___ { cursor:default; }
+td.a_yes__{ background-color:#0F0; }
+td.c_no___ { background-color:#F00; }
+td.b_maybe { background-color:#FF0; }
td.undecided { background-color:#DDD;color:#666 }
td.checkboxes {
background-color: #DDD;
@@ -42,9 +42,9 @@ table.checkboxes{
width: 100%;
border-collapse: collapse;
}
-td.input-cno { background-color: #F00 }
-td.input-ayes { background-color: #0F0}
-td.input-bmaybe { background-color: #FF0}
+td.input-c_no___ { background-color: #F00 }
+td.input-a_yes__ { background-color: #0F0}
+td.input-b_maybe { background-color: #FF0}
label { cursor: pointer; }
diff --git a/default.css b/default.css
index 6c0b717..2eafd3d 100644
--- a/default.css
+++ b/default.css
@@ -36,11 +36,11 @@ a.comment_sort, a.top_bottom_ref {
font-size: small;
}
-td.ayes, td.bmaybe, td.cno { cursor:default;}
-td.ayes, tr.input-ayes td, input.chosen { background-color:#9C6}
+td.a_yes__, td.b_maybe, td.c_no___ { cursor:default;}
+td.a_yes__, tr.input-a_yes__ td, input.chosen { background-color:#9C6}
input.chosen:hover { background-color: #8B5 }
-td.cno, tr.input-cno td { background-color:#F96 }
-td.bmaybe, tr.input-bmaybe td { background-color:#FF6}
+td.c_no___, tr.input-c_no___ td { background-color:#F96 }
+td.b_maybe, tr.input-b_maybe td { background-color:#FF6}
td.undecided { background-color:#DDD }
td.checkboxes {
diff --git a/poll.rb b/poll.rb
index 372caf7..5c88c08 100644
--- a/poll.rb
+++ b/poll.rb
@@ -46,9 +46,9 @@ class String
end
class Poll
attr_reader :head, :name
- YESVAL = "ayes"
- MAYBEVAL = "bmaybe"
- NOVAL = "cno"
+ YESVAL = "a_yes__"
+ MAYBEVAL = "b_maybe"
+ NOVAL = "c_no___"
def initialize name,type
@name = name
@@ -112,17 +112,19 @@ class Poll
ret += "<tr class='participantrow'>\n"
ret += userstring(participant,showparticipation)
@head.columns.each{|column|
- klasse = poll[column]
- case klasse
+ case poll[column]
when nil
value = UNKNOWN
klasse = "undecided"
- when YESVAL
+ when /yes/ # allow anything containing yes (backward compatibility)
value = YES
- when NOVAL
+ klasse = YESVAL
+ when /no/
value = NO
- when MAYBEVAL
+ klasse = NOVAL
+ when /maybe/
value = MAYBE
+ klasse = MAYBEVAL
end
ret += "<td class='#{klasse}' title=\"#{CGI.escapeHTML(participant)}: #{CGI.escapeHTML(column.to_s)}\">#{value}</td>\n"
}
@@ -140,9 +142,9 @@ class Poll
yes = 0
undecided = 0
@data.each_value{|participant|
- if participant[column] == YESVAL
+ if participant[column] =~ /yes/
yes += 1
- elsif !participant.has_key?(column) or participant[column] == MAYBEVAL
+ elsif !participant.has_key?(column) or participant[column] =~ /maybe/
undecided += 1
end
}
diff --git a/print.css b/print.css
index 527ef68..01eb8cd 100644
--- a/print.css
+++ b/print.css
@@ -153,9 +153,9 @@ tr#summary td.sum[title|='0%']{
}
-td.ayes, input.chosen { background-color:#9c6; }
-td.cno { background-color:#F96; }
-td.bmaybe { background-color:#FF6; }
+td.a_yes__, input.chosen { background-color:#9c6; }
+td.c_no___ { background-color:#F96; }
+td.b_maybe { background-color:#FF6; }
td.undecided { background-color:#DDD;color:#666 }
td.name {