liquid_feedback_frontend
annotate 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
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 |
rev | line source |
---|---|
bsw/jbe@0 | 1 function ui.bargraph(args) |
bsw/jbe@0 | 2 ui.container{ |
bsw/jbe@0 | 3 attr = { |
bsw/jbe@0 | 4 class = "bargraph", |
bsw/jbe@0 | 5 }, |
bsw/jbe@0 | 6 content = function() |
bsw/jbe@0 | 7 for i, bar in ipairs(args.bars) do |
bsw@2 | 8 if bar.value > 0 then |
bsw@2 | 9 local value = bar.value * args.width / args.max_value / 2 |
bsw@2 | 10 ui.container{ |
bsw@2 | 11 attr = { |
bsw@2 | 12 style = "width: " .. tostring(value) .. "px; background-color: " .. bar.color .. ";", |
bsw@2 | 13 title = tostring(bar.value) |
bsw@2 | 14 }, |
bsw@2 | 15 content = function() slot.put(" ") end |
bsw@2 | 16 } |
bsw@2 | 17 end |
bsw/jbe@0 | 18 end |
bsw/jbe@0 | 19 end |
bsw/jbe@0 | 20 } |
bsw/jbe@0 | 21 end |