# HG changeset patch # User bsw # Date 1613399472 -3600 # Node ID f582e3d6434c73efdd8297e5057658ad299fbdf4 # Parent 97dfef4eb2d761a697a2eb0a0cfab54d83f94064 Fixed display of pie chart diff -r 97dfef4eb2d7 -r f582e3d6434c app/main/initiative/_list.lua --- a/app/main/initiative/_list.lua Mon Feb 15 15:24:26 2021 +0100 +++ b/app/main/initiative/_list.lua Mon Feb 15 15:31:12 2021 +0100 @@ -64,17 +64,16 @@ class = class .. " satisfied" end end + local position + if not ommit_initiative_id then + position = i + end ui.tag { tag = "li", attr = { class = class }, content = function () - if i == 1 and not ommit_initiative_id and not for_member and ( - initiative.issue.state == "finished_with_winner" - or initiative.issue.state == "finished_without_winner" - ) then - util.initiative_pie(initiative) - end execute.view { module = "initiative", view = "_list_element", params = { + position = position, initiative = initiative, for_event = for_event, for_member = for_member } } diff -r 97dfef4eb2d7 -r f582e3d6434c app/main/initiative/_list_element.lua --- a/app/main/initiative/_list_element.lua Mon Feb 15 15:24:26 2021 +0100 +++ b/app/main/initiative/_list_element.lua Mon Feb 15 15:31:12 2021 +0100 @@ -4,6 +4,8 @@ local issue = initiative.issue +local position = param.get("position", atom.number) + if initiative.vote_grade ~= nil then if initiative.vote_grade > 0 then local text = _"voted yes" @@ -30,6 +32,12 @@ ui.container{ attr = { class = class }, content = function () + if position == 1 and not for_member and ( + initiative.issue.state == "finished_with_winner" + or initiative.issue.state == "finished_without_winner" + ) then + util.initiative_pie(initiative) + end ui.container { attr = { class = "initiative_name" }, content = function()