liquid_feedback_frontend
diff env/ui/supporter_count.lua @ 1850:accb808d5b4a
Added token based voting
| author | bsw |
|---|---|
| date | Tue Mar 22 10:19:22 2022 +0100 (2022-03-22) |
| parents | 32cc544d5a5b |
| children |
line diff
1.1 --- a/env/ui/supporter_count.lua Thu Feb 03 16:10:39 2022 +0100 1.2 +++ b/env/ui/supporter_count.lua Tue Mar 22 10:19:22 2022 +0100 1.3 @@ -5,18 +5,34 @@ 1.4 content = _"[calculating]" 1.5 } 1.6 elseif initiative.issue.closed == nil then 1.7 - ui.tag { 1.8 - attr = { class = "satisfiedSupporterCount" }, 1.9 - content = _("#{count} supporter", { count = initiative.satisfied_supporter_count }) 1.10 - } 1.11 - if initiative.potential_supporter_count and 1.12 - initiative.potential_supporter_count > 0 1.13 - then 1.14 - slot.put ( " " ) 1.15 + if config.token and initiative.issue.area.unit_id == config.token.unit_id then 1.16 ui.tag { 1.17 - attr = { class = "potentialSupporterCount" }, 1.18 - content = _("(+ #{count} potential)", { count = initiative.potential_supporter_count }) 1.19 + attr = { class = "satisfiedSupporterCount" }, 1.20 + content = _("#{count} #{token_name}", { count = initiative.satisfied_supporter_count / 100, token_name = config.token.token_name }) 1.21 } 1.22 + if initiative.potential_supporter_count and 1.23 + initiative.potential_supporter_count > 0 1.24 + then 1.25 + slot.put ( " " ) 1.26 + ui.tag { 1.27 + attr = { class = "potentialSupporterCount" }, 1.28 + content = _("(+ #{count} potential)", { count = initiative.potential_supporter_count / 100 }) 1.29 + } 1.30 + end 1.31 + else 1.32 + ui.tag { 1.33 + attr = { class = "satisfiedSupporterCount" }, 1.34 + content = _("#{count} supporter", { count = initiative.satisfied_supporter_count }) 1.35 + } 1.36 + if initiative.potential_supporter_count and 1.37 + initiative.potential_supporter_count > 0 1.38 + then 1.39 + slot.put ( " " ) 1.40 + ui.tag { 1.41 + attr = { class = "potentialSupporterCount" }, 1.42 + content = _("(+ #{count} potential)", { count = initiative.potential_supporter_count }) 1.43 + } 1.44 + end 1.45 end 1.46 end 1.47 end