liquid_feedback_frontend

view env/ui/bargraph.lua @ 3:768faea1096d

Version alpha4

Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.

Initiatives may provide a link to an external discussion platform

Direct link on every initiative page to create an alternative initiative

Bugfix: No error when clicking "neutral", when "neutral" is currently selected
author bsw
date Mon Nov 30 12:00:00 2009 +0100 (2009-11-30)
parents 5c601807d397
children 80c215dbf076
line source
1 function ui.bargraph(args)
2 ui.container{
3 attr = {
4 class = "bargraph",
5 },
6 content = function()
7 for i, bar in ipairs(args.bars) do
8 if bar.value > 0 then
9 local value = bar.value * args.width / args.max_value / 2
10 ui.container{
11 attr = {
12 style = "width: " .. tostring(value) .. "px; background-color: " .. bar.color .. ";",
13 title = tostring(bar.value)
14 },
15 content = function() slot.put(" ") end
16 }
17 end
18 end
19 end
20 }
21 end

Impressum / About Us