liquid_feedback_frontend
view env/ui/field/rank.lua @ 334:0ec49ed35954
Interpret eligible field of initiative correctly when displaying winner badges in initiative listing
author | bsw |
---|---|
date | Tue Feb 28 18:43:42 2012 +0100 (2012-02-28) |
parents | 00d1004545f1 |
children |
line source
1 function ui.field.rank(args)
2 ui.form_element(args, {fetch_value = true}, function(args)
3 local value = args.value
4 local eligible = args.eligible
5 ui.tag{
6 attr = { class = "rank" },
7 content = function()
8 if eligible and value == 1 then
9 ui.image{ attr = args.image_attr, static = "icons/16/award_star_gold_2.png" }
10 elseif eligible and value then
11 ui.image{ attr = args.image_attr, static = "icons/16/award_star_silver_2.png" }
12 else
13 ui.image{ attr = args.image_attr, static = "icons/16/cross.png" }
14 end
15 if value then
16 ui.tag{
17 attr = { class = "value" },
18 content = tostring(value)
19 }
20 end
21 end
22 }
23 end)
24 end