bsw/jbe@1309: function ui.supporter_count(initiative) bsw/jbe@1309: if initiative.supporter_count == nil then bsw/jbe@1309: ui.tag { bsw/jbe@1309: attr = { class = "supporterCount" }, bsw/jbe@1309: content = _"[calculating]" bsw/jbe@1309: } bsw/jbe@1309: elseif initiative.issue.closed == nil then bsw@1850: if config.token and initiative.issue.area.unit_id == config.token.unit_id then bsw/jbe@1309: ui.tag { bsw@1850: attr = { class = "satisfiedSupporterCount" }, bsw@1850: content = _("#{count} #{token_name}", { count = initiative.satisfied_supporter_count / 100, token_name = config.token.token_name }) bsw/jbe@1309: } bsw@1850: if initiative.potential_supporter_count and bsw@1850: initiative.potential_supporter_count > 0 bsw@1850: then bsw@1850: slot.put ( " " ) bsw@1850: ui.tag { bsw@1850: attr = { class = "potentialSupporterCount" }, bsw@1850: content = _("(+ #{count} potential)", { count = initiative.potential_supporter_count / 100 }) bsw@1850: } bsw@1850: end bsw@1850: else bsw@1850: ui.tag { bsw@1850: attr = { class = "satisfiedSupporterCount" }, bsw@1850: content = _("#{count} supporter", { count = initiative.satisfied_supporter_count }) bsw@1850: } bsw@1850: if initiative.potential_supporter_count and bsw@1850: initiative.potential_supporter_count > 0 bsw@1850: then bsw@1850: slot.put ( " " ) bsw@1850: ui.tag { bsw@1850: attr = { class = "potentialSupporterCount" }, bsw@1850: content = _("(+ #{count} potential)", { count = initiative.potential_supporter_count }) bsw@1850: } bsw@1850: end bsw/jbe@1309: end bsw/jbe@1309: end bsw/jbe@1309: end