liquid_feedback_frontend

diff env/ui/supporter_count.lua @ 1309:32cc544d5a5b

Cumulative patch for upcoming frontend version 4
author bsw/jbe
date Sun Jul 15 14:07:29 2018 +0200 (2018-07-15)
parents
children accb808d5b4a
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/env/ui/supporter_count.lua	Sun Jul 15 14:07:29 2018 +0200
     1.3 @@ -0,0 +1,22 @@
     1.4 +function ui.supporter_count(initiative)
     1.5 +  if initiative.supporter_count == nil then
     1.6 +    ui.tag { 
     1.7 +      attr = { class = "supporterCount" },
     1.8 +      content = _"[calculating]"
     1.9 +    }
    1.10 +  elseif initiative.issue.closed == nil then
    1.11 +    ui.tag { 
    1.12 +      attr = { class = "satisfiedSupporterCount" },
    1.13 +      content = _("#{count} supporter", { count = initiative.satisfied_supporter_count })
    1.14 +    }
    1.15 +    if initiative.potential_supporter_count and
    1.16 +        initiative.potential_supporter_count > 0 
    1.17 +    then
    1.18 +      slot.put ( " " )
    1.19 +      ui.tag { 
    1.20 +        attr = { class = "potentialSupporterCount" },
    1.21 +        content = _("(+ #{count} potential)", { count = initiative.potential_supporter_count })
    1.22 +      }
    1.23 +    end
    1.24 +  end 
    1.25 +end

Impressum / About Us