# HG changeset patch # User bsw # Date 1643886119 -3600 # Node ID 8d36c14128d49dbbbf27df6abf21784b655ac0de # Parent 7b04f14c6d0a0b7e7f42ea4e06d44cd2edae20a5 Fixed display of attachments in initiative listing diff -r 7b04f14c6d0a -r 8d36c14128d4 app/main/initiative/_list_element.lua --- a/app/main/initiative/_list_element.lua Thu Feb 03 11:47:41 2022 +0100 +++ b/app/main/initiative/_list_element.lua Thu Feb 03 12:01:59 2022 +0100 @@ -6,21 +6,6 @@ local position = param.get("position", atom.number) -if initiative.vote_grade ~= nil then - if initiative.vote_grade > 0 then - local text = _"voted yes" - ui.container{ attr = { class = "mdl-list__item-avatar positive" }, content = function() - ui.tag{ tag = "i", attr = { class = "material-icons", title = text }, content = "thumb_up" } - end } - elseif initiative.vote_grade == 0 then - elseif initiative.vote_grade < 0 then - local text = _"voted no" - ui.container{ attr = { class = "mdl-list__item-avatar negative" }, content = function() - ui.tag{ tag = "i", attr = { class = "material-icons", title = text }, content = "thumb_down" } - end } - end -end - local class = "initiative mdl-list__item-primary-content" if initiative.rank == 1 then class = class .. " rank1" @@ -41,6 +26,20 @@ ui.container { attr = { class = "initiative_name" }, content = function() + if initiative.vote_grade ~= nil then + if initiative.vote_grade > 0 then + local text = _"voted yes" + ui.container{ attr = { class = "mdl-list__item-avatar positive" }, content = function() + ui.tag{ tag = "i", attr = { class = "material-icons", title = text }, content = "thumb_up" } + end } + elseif initiative.vote_grade == 0 then + elseif initiative.vote_grade < 0 then + local text = _"voted no" + ui.container{ attr = { class = "mdl-list__item-avatar negative" }, content = function() + ui.tag{ tag = "i", attr = { class = "material-icons", title = text }, content = "thumb_down" } + end } + end + end if not for_member and app.session.member then if initiative.member_info.supported then if initiative.member_info.satisfied then @@ -104,7 +103,7 @@ if initiative.positive_votes ~= nil then - local result_text + local result_text = "" if issue.voter_count == 0 then result_text = _("No votes (0)", { result = result }) @@ -135,11 +134,11 @@ no_count = initiative.negative_votes, no_percent = format.percent_floor(initiative.negative_votes, issue.voter_count) }) - + end ui.container { attr = { class = "result" }, content = result_text } - + end end } diff -r 7b04f14c6d0a -r 8d36c14128d4 static/lf4.css --- a/static/lf4.css Thu Feb 03 11:47:41 2022 +0100 +++ b/static/lf4.css Thu Feb 03 12:01:59 2022 +0100 @@ -592,6 +592,7 @@ .initiatives .attachment { max-width: 180px; max-height: 80px; + margin-bottom: 10px; } .competing_initiatives .initiatives .attachment {