liquid_feedback_frontend
view env/ui/field/rank.lua @ 1016:aab9dc793570
Corrected wrong usage of initiative list partial view in admin cancel issue
| author | bsw | 
|---|---|
| date | Sun Aug 11 22:09:01 2013 +0200 (2013-08-11) | 
| parents | 0ec49ed35954 | 
| 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
