liquid_feedback_frontend
view env/ui/supporter_count.lua @ 1412:b42bea44f26c
Sorting unit names in registration form
| author | bsw | 
|---|---|
| date | Mon Aug 20 18:43:17 2018 +0200 (2018-08-20) | 
| parents | 32cc544d5a5b | 
| children | accb808d5b4a | 
 line source
     1 function ui.supporter_count(initiative)
     2   if initiative.supporter_count == nil then
     3     ui.tag { 
     4       attr = { class = "supporterCount" },
     5       content = _"[calculating]"
     6     }
     7   elseif initiative.issue.closed == nil then
     8     ui.tag { 
     9       attr = { class = "satisfiedSupporterCount" },
    10       content = _("#{count} supporter", { count = initiative.satisfied_supporter_count })
    11     }
    12     if initiative.potential_supporter_count and
    13         initiative.potential_supporter_count > 0 
    14     then
    15       slot.put ( " " )
    16       ui.tag { 
    17         attr = { class = "potentialSupporterCount" },
    18         content = _("(+ #{count} potential)", { count = initiative.potential_supporter_count })
    19       }
    20     end
    21   end 
    22 end
