# HG changeset patch # User bsw # Date 1330451022 -3600 # Node ID 0ec49ed35954ad51f5ac316adac6aa4d69a8a5b7 # Parent 609e37247615136e3398bdbfccbd51392e41f736 Interpret eligible field of initiative correctly when displaying winner badges in initiative listing diff -r 609e37247615 -r 0ec49ed35954 app/main/initiative/_list_element.lua --- a/app/main/initiative/_list_element.lua Tue Feb 28 18:34:09 2012 +0100 +++ b/app/main/initiative/_list_element.lua Tue Feb 28 18:43:42 2012 +0100 @@ -28,8 +28,11 @@ { field_attr = { style = "width: 3em; text-align: center;"}, content = function() - if initiative.issue.accepted and initiative.issue.closed and initiative.issue.ranks_available or initiative.admitted == false then - ui.field.rank{ image_attr = { id = icon_name }, attr = { class = "rank" }, value = initiative.rank } + if + initiative.issue.accepted and initiative.issue.closed + and initiative.issue.ranks_available or initiative.admitted == false + then + ui.field.rank{ image_attr = { id = icon_name }, attr = { class = "rank" }, value = initiative.rank, eligible = initiative.eligible } else slot.put(" ") end diff -r 609e37247615 -r 0ec49ed35954 env/ui/field/rank.lua --- a/env/ui/field/rank.lua Tue Feb 28 18:34:09 2012 +0100 +++ b/env/ui/field/rank.lua Tue Feb 28 18:43:42 2012 +0100 @@ -1,12 +1,13 @@ function ui.field.rank(args) ui.form_element(args, {fetch_value = true}, function(args) local value = args.value + local eligible = args.eligible ui.tag{ attr = { class = "rank" }, content = function() - if value == 1 then + if eligible and value == 1 then ui.image{ attr = args.image_attr, static = "icons/16/award_star_gold_2.png" } - elseif value then + elseif eligible and value then ui.image{ attr = args.image_attr, static = "icons/16/award_star_silver_2.png" } else ui.image{ attr = args.image_attr, static = "icons/16/cross.png" }