bsw/jbe@0: function ui.field.rank(args) bsw/jbe@0: ui.form_element(args, {fetch_value = true}, function(args) bsw/jbe@0: local value = args.value bsw@334: local eligible = args.eligible bsw/jbe@0: ui.tag{ bsw/jbe@0: attr = { class = "rank" }, bsw/jbe@0: content = function() bsw@334: if eligible and value == 1 then bsw/jbe@19: ui.image{ attr = args.image_attr, static = "icons/16/award_star_gold_2.png" } bsw@334: elseif eligible and value then bsw/jbe@19: ui.image{ attr = args.image_attr, static = "icons/16/award_star_silver_2.png" } bsw/jbe@0: else bsw/jbe@19: ui.image{ attr = args.image_attr, static = "icons/16/cross.png" } bsw/jbe@0: end bsw/jbe@0: if value then bsw/jbe@0: ui.tag{ bsw/jbe@0: attr = { class = "value" }, bsw/jbe@0: content = tostring(value) bsw/jbe@0: } bsw/jbe@0: end bsw/jbe@0: end bsw/jbe@0: } bsw/jbe@0: end) bsw/jbe@0: end