liquid_feedback_frontend
changeset 1826:8d36c14128d4
Fixed display of attachments in initiative listing
author | bsw |
---|---|
date | Thu Feb 03 12:01:59 2022 +0100 (2022-02-03) |
parents | 7b04f14c6d0a |
children | a5e1de39e19a |
files | app/main/initiative/_list_element.lua static/lf4.css |
line diff
1.1 --- a/app/main/initiative/_list_element.lua Thu Feb 03 11:47:41 2022 +0100 1.2 +++ b/app/main/initiative/_list_element.lua Thu Feb 03 12:01:59 2022 +0100 1.3 @@ -6,21 +6,6 @@ 1.4 1.5 local position = param.get("position", atom.number) 1.6 1.7 -if initiative.vote_grade ~= nil then 1.8 - if initiative.vote_grade > 0 then 1.9 - local text = _"voted yes" 1.10 - ui.container{ attr = { class = "mdl-list__item-avatar positive" }, content = function() 1.11 - ui.tag{ tag = "i", attr = { class = "material-icons", title = text }, content = "thumb_up" } 1.12 - end } 1.13 - elseif initiative.vote_grade == 0 then 1.14 - elseif initiative.vote_grade < 0 then 1.15 - local text = _"voted no" 1.16 - ui.container{ attr = { class = "mdl-list__item-avatar negative" }, content = function() 1.17 - ui.tag{ tag = "i", attr = { class = "material-icons", title = text }, content = "thumb_down" } 1.18 - end } 1.19 - end 1.20 -end 1.21 - 1.22 local class = "initiative mdl-list__item-primary-content" 1.23 if initiative.rank == 1 then 1.24 class = class .. " rank1" 1.25 @@ -41,6 +26,20 @@ 1.26 ui.container { 1.27 attr = { class = "initiative_name" }, 1.28 content = function() 1.29 + if initiative.vote_grade ~= nil then 1.30 + if initiative.vote_grade > 0 then 1.31 + local text = _"voted yes" 1.32 + ui.container{ attr = { class = "mdl-list__item-avatar positive" }, content = function() 1.33 + ui.tag{ tag = "i", attr = { class = "material-icons", title = text }, content = "thumb_up" } 1.34 + end } 1.35 + elseif initiative.vote_grade == 0 then 1.36 + elseif initiative.vote_grade < 0 then 1.37 + local text = _"voted no" 1.38 + ui.container{ attr = { class = "mdl-list__item-avatar negative" }, content = function() 1.39 + ui.tag{ tag = "i", attr = { class = "material-icons", title = text }, content = "thumb_down" } 1.40 + end } 1.41 + end 1.42 + end 1.43 if not for_member and app.session.member then 1.44 if initiative.member_info.supported then 1.45 if initiative.member_info.satisfied then 1.46 @@ -104,7 +103,7 @@ 1.47 1.48 if initiative.positive_votes ~= nil then 1.49 1.50 - local result_text 1.51 + local result_text = "" 1.52 1.53 if issue.voter_count == 0 then 1.54 result_text = _("No votes (0)", { result = result }) 1.55 @@ -135,11 +134,11 @@ 1.56 no_count = initiative.negative_votes, 1.57 no_percent = format.percent_floor(initiative.negative_votes, issue.voter_count) 1.58 }) 1.59 - 1.60 + 1.61 end 1.62 1.63 ui.container { attr = { class = "result" }, content = result_text } 1.64 - 1.65 + 1.66 end 1.67 1.68 end }
2.1 --- a/static/lf4.css Thu Feb 03 11:47:41 2022 +0100 2.2 +++ b/static/lf4.css Thu Feb 03 12:01:59 2022 +0100 2.3 @@ -592,6 +592,7 @@ 2.4 .initiatives .attachment { 2.5 max-width: 180px; 2.6 max-height: 80px; 2.7 + margin-bottom: 10px; 2.8 } 2.9 2.10 .competing_initiatives .initiatives .attachment {