liquid_feedback_frontend

changeset 1666:f582e3d6434c

Fixed display of pie chart
author bsw
date Mon Feb 15 15:31:12 2021 +0100 (2021-02-15)
parents 97dfef4eb2d7
children 36fb14503a84
files app/main/initiative/_list.lua app/main/initiative/_list_element.lua
line diff
     1.1 --- a/app/main/initiative/_list.lua	Mon Feb 15 15:24:26 2021 +0100
     1.2 +++ b/app/main/initiative/_list.lua	Mon Feb 15 15:31:12 2021 +0100
     1.3 @@ -64,17 +64,16 @@
     1.4              class = class .. " satisfied"
     1.5            end
     1.6          end
     1.7 +        local position
     1.8 +        if not ommit_initiative_id then
     1.9 +          position = i
    1.10 +        end
    1.11          ui.tag {
    1.12            tag = "li", attr = { class = class },
    1.13            content = function ()
    1.14 -            if i == 1 and not ommit_initiative_id and not for_member and (
    1.15 -              initiative.issue.state == "finished_with_winner" 
    1.16 -              or initiative.issue.state == "finished_without_winner"
    1.17 -            ) then
    1.18 -              util.initiative_pie(initiative)
    1.19 -            end
    1.20              execute.view {
    1.21                module = "initiative", view = "_list_element", params = {
    1.22 +                position = position,
    1.23                  initiative = initiative, for_event = for_event, for_member = for_member
    1.24                }
    1.25              }
     2.1 --- a/app/main/initiative/_list_element.lua	Mon Feb 15 15:24:26 2021 +0100
     2.2 +++ b/app/main/initiative/_list_element.lua	Mon Feb 15 15:31:12 2021 +0100
     2.3 @@ -4,6 +4,8 @@
     2.4  
     2.5  local issue = initiative.issue
     2.6  
     2.7 +local position = param.get("position", atom.number)
     2.8 +
     2.9  if initiative.vote_grade ~= nil then
    2.10    if initiative.vote_grade > 0 then
    2.11      local text = _"voted yes"
    2.12 @@ -30,6 +32,12 @@
    2.13  ui.container{
    2.14    attr = { class = class },
    2.15    content = function ()
    2.16 +    if position == 1 and not for_member and (
    2.17 +      initiative.issue.state == "finished_with_winner" 
    2.18 +      or initiative.issue.state == "finished_without_winner"
    2.19 +    ) then
    2.20 +      util.initiative_pie(initiative)
    2.21 +    end
    2.22      ui.container {
    2.23        attr = { class = "initiative_name" },
    2.24        content = function()

Impressum / About Us