liquid_feedback_frontend
changeset 29:b195682957dc beta11
Bugfix related to word-wrap in initiative head
author | bsw |
---|---|
date | Sun Feb 21 17:34:26 2010 +0100 (2010-02-21) |
parents | 3e4b58cf2ad2 |
children | abcac05b1091 |
files | app/main/initiative/_list_element.lua config/default.lua static/style.css |
line diff
1.1 --- a/app/main/initiative/_list_element.lua Sun Feb 21 15:50:01 2010 +0100 1.2 +++ b/app/main/initiative/_list_element.lua Sun Feb 21 17:34:26 2010 +0100 1.3 @@ -60,123 +60,128 @@ 1.4 }, 1.5 content = function() 1.6 1.7 - ui.container{ 1.8 - attr = { style = "float: left; width: 4em;"}, 1.9 - content = function() 1.10 - if initiative.issue.accepted and initiative.issue.closed and initiative.issue.ranks_available or initiative.admitted == false then 1.11 - ui.field.rank{ image_attr = { id = icon_name }, attr = { class = "rank" }, value = initiative.rank } 1.12 - elseif web20 then 1.13 - ui.image{ 1.14 - attr = { 1.15 - width = 16, 1.16 - height = 16, 1.17 - id = icon_name, 1.18 - style = "float: left;" 1.19 - }, 1.20 - static = "icons/16/script.png" 1.21 - } 1.22 - else 1.23 - slot.put(" ") 1.24 - end 1.25 - end 1.26 - } 1.27 + ui.list{ 1.28 + attr = { class = "nohover" }, 1.29 + records = { { a = 1} }, 1.30 + columns = { 1.31 + { 1.32 + field_attr = { style = "width: 4em; padding: 0;"}, 1.33 + content = function() 1.34 + if initiative.issue.accepted and initiative.issue.closed and initiative.issue.ranks_available or initiative.admitted == false then 1.35 + ui.field.rank{ image_attr = { id = icon_name }, attr = { class = "rank" }, value = initiative.rank } 1.36 + elseif web20 then 1.37 + ui.image{ 1.38 + attr = { 1.39 + width = 16, 1.40 + height = 16, 1.41 + id = icon_name, 1.42 + style = "float: left;" 1.43 + }, 1.44 + static = "icons/16/script.png" 1.45 + } 1.46 + else 1.47 + slot.put(" ") 1.48 + end 1.49 + end 1.50 + }, 1.51 1.52 - ui.container{ 1.53 - attr = { style = "float: left; width: 110px;"}, 1.54 - content = function() 1.55 - if initiative.issue.accepted and initiative.issue.closed then 1.56 - if initiative.issue.ranks_available then 1.57 - if initiative.negative_votes and initiative.positive_votes then 1.58 - local max_value = initiative.issue.voter_count 1.59 + { 1.60 + field_attr = { style = "width: 110px; padding: 0;"}, 1.61 + content = function() 1.62 + if initiative.issue.accepted and initiative.issue.closed then 1.63 + if initiative.issue.ranks_available then 1.64 + if initiative.negative_votes and initiative.positive_votes then 1.65 + local max_value = initiative.issue.voter_count 1.66 + ui.bargraph{ 1.67 + max_value = max_value, 1.68 + width = 100, 1.69 + bars = { 1.70 + { color = "#0a0", value = initiative.positive_votes }, 1.71 + { color = "#aaa", value = max_value - initiative.negative_votes - initiative.positive_votes }, 1.72 + { color = "#a00", value = initiative.negative_votes }, 1.73 + } 1.74 + } 1.75 + else 1.76 + slot.put(" ") 1.77 + end 1.78 + else 1.79 + slot.put(_"Counting of votes") 1.80 + end 1.81 + elseif initiative.issue.population then 1.82 + local max_value = initiative.issue.population 1.83 ui.bargraph{ 1.84 max_value = max_value, 1.85 width = 100, 1.86 bars = { 1.87 - { color = "#0a0", value = initiative.positive_votes }, 1.88 - { color = "#aaa", value = max_value - initiative.negative_votes - initiative.positive_votes }, 1.89 - { color = "#a00", value = initiative.negative_votes }, 1.90 + { color = "#0a0", value = (initiative.satisfied_supporter_count or 0) }, 1.91 + { color = "#bbb", value = (initiative.supporter_count or 0) - (initiative.satisfied_supporter_count or 0) }, 1.92 + { color = "#eee", value = max_value - (initiative.supporter_count or 0) }, 1.93 } 1.94 } 1.95 else 1.96 slot.put(" ") 1.97 end 1.98 - else 1.99 - slot.put(_"Counting of votes") 1.100 end 1.101 - elseif initiative.issue.population then 1.102 - local max_value = initiative.issue.population 1.103 - ui.bargraph{ 1.104 - max_value = max_value, 1.105 - width = 100, 1.106 - bars = { 1.107 - { color = "#0a0", value = (initiative.satisfied_supporter_count or 0) }, 1.108 - { color = "#bbb", value = (initiative.supporter_count or 0) - (initiative.satisfied_supporter_count or 0) }, 1.109 - { color = "#eee", value = max_value - (initiative.supporter_count or 0) }, 1.110 - } 1.111 - } 1.112 - else 1.113 - slot.put(" ") 1.114 - end 1.115 - end 1.116 - } 1.117 - 1.118 - ui.container{ 1.119 - attr = { style = "float: left;"}, 1.120 - content = function() 1.121 - local link_class 1.122 - if initiative.revoked then 1.123 - link_class = "revoked" 1.124 - end 1.125 - ui.link{ 1.126 - attr = { id = link_name, class = link_class }, 1.127 + }, 1.128 + 1.129 + { 1.130 + field_attr = { style = "padding: 0;"}, 1.131 content = function() 1.132 - local name 1.133 - if initiative.name_highlighted then 1.134 - name = encode.highlight(initiative.name_highlighted) 1.135 - else 1.136 - name = encode.html(initiative.name) 1.137 + local link_class 1.138 + if initiative.revoked then 1.139 + link_class = "revoked" 1.140 end 1.141 - slot.put(name) 1.142 - end, 1.143 - module = module, 1.144 - view = view, 1.145 - id = id, 1.146 - params = params, 1.147 + ui.link{ 1.148 + attr = { id = link_name, class = link_class }, 1.149 + content = function() 1.150 + local name 1.151 + if initiative.name_highlighted then 1.152 + name = encode.highlight(initiative.name_highlighted) 1.153 + else 1.154 + name = encode.html(initiative.shortened_name) 1.155 + end 1.156 + slot.put(name) 1.157 + end, 1.158 + module = module, 1.159 + view = view, 1.160 + id = id, 1.161 + params = params, 1.162 + } 1.163 + 1.164 + if initiative.issue.state == "new" then 1.165 + ui.image{ 1.166 + static = "icons/16/new.png" 1.167 + } 1.168 + end 1.169 + if initiative.is_supporter then 1.170 + slot.put(" ") 1.171 + local label = _"You are supporting this initiative" 1.172 + ui.image{ 1.173 + attr = { alt = label, title = label }, 1.174 + static = "icons/16/thumb_up_green.png" 1.175 + } 1.176 + end 1.177 + if initiative.is_potential_supporter then 1.178 + slot.put(" ") 1.179 + local label = _"You are potential supporter of this initiative" 1.180 + ui.image{ 1.181 + attr = { alt = label, title = label }, 1.182 + static = "icons/16/thumb_up.png" 1.183 + } 1.184 + end 1.185 + if initiative.is_initiator then 1.186 + slot.put(" ") 1.187 + local label = _"You are iniator of this initiative" 1.188 + ui.image{ 1.189 + attr = { alt = label, title = label }, 1.190 + static = "icons/16/user_edit.png" 1.191 + } 1.192 + end 1.193 + 1.194 + end 1.195 } 1.196 - end 1.197 - } 1.198 - 1.199 - if initiative.issue.state == "new" then 1.200 - ui.image{ 1.201 - static = "icons/16/new.png" 1.202 } 1.203 - end 1.204 - if initiative.is_supporter then 1.205 - slot.put(" ") 1.206 - local label = _"You are supporting this initiative" 1.207 - ui.image{ 1.208 - attr = { alt = label, title = label }, 1.209 - static = "icons/16/thumb_up_green.png" 1.210 - } 1.211 - end 1.212 - if initiative.is_potential_supporter then 1.213 - slot.put(" ") 1.214 - local label = _"You are potential supporter of this initiative" 1.215 - ui.image{ 1.216 - attr = { alt = label, title = label }, 1.217 - static = "icons/16/thumb_up.png" 1.218 - } 1.219 - end 1.220 - if initiative.is_initiator then 1.221 - slot.put(" ") 1.222 - local label = _"You are iniator of this initiative" 1.223 - ui.image{ 1.224 - attr = { alt = label, title = label }, 1.225 - static = "icons/16/user_edit.png" 1.226 - } 1.227 - end 1.228 - 1.229 - slot.put("<br style='clear: left' />") 1.230 + } 1.231 end 1.232 } 1.233 end
2.1 --- a/config/default.lua Sun Feb 21 15:50:01 2010 +0100 2.2 +++ b/config/default.lua Sun Feb 21 17:34:26 2010 +0100 2.3 @@ -1,5 +1,5 @@ 2.4 config.app_name = "LiquidFeedback" 2.5 -config.app_version = "beta10" 2.6 +config.app_version = "beta11" 2.7 2.8 config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" 2.9