# HG changeset patch # User bsw # Date 1647953546 -3600 # Node ID 9c298b5832e7ddba0d672476706227e4c41ce336 # Parent e593570a23c50aed9c9eca4ecd231cb942535f1e Correctly determine own voting weight diff -r e593570a23c5 -r 9c298b5832e7 app/main/delegation/_info.lua --- a/app/main/delegation/_info.lua Tue Mar 22 10:35:44 2022 +0100 +++ b/app/main/delegation/_info.lua Tue Mar 22 13:52:26 2022 +0100 @@ -223,10 +223,19 @@ ui.tag{ tag = "i", attr = { id = "issue_" .. issue.id .. "_interest_icon", class = "material-icons" }, content = "star" } end } - if not issue.closed and info.own_participation and info.weight and info.weight > 1 then + + local privilege = Privilege:new_selector() + :add_where{ "member_id = ?", member.id } + :add_where{ "unit_id = ?", issue.area.unit_id } + :optional_object_mode() + :exec() + + local own_weight = privilege and privilege.weight or 0 + + if not issue.closed and info.own_participation and info.weight and info.weight > own_weight then slot.put(" ") ui.link { - attr = { class = "right" }, content = "+" .. (info.weight - 1), + attr = { class = "right" }, content = "+" .. (info.weight - own_weight), module = "interest", view = "show_incoming", params = { issue_id = issue.id, member_id = member.id }