liquid_feedback_frontend
changeset 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 | 609e37247615 |
children | 4608babc79f2 |
files | app/main/initiative/_list_element.lua env/ui/field/rank.lua |
line diff
1.1 --- a/app/main/initiative/_list_element.lua Tue Feb 28 18:34:09 2012 +0100 1.2 +++ b/app/main/initiative/_list_element.lua Tue Feb 28 18:43:42 2012 +0100 1.3 @@ -28,8 +28,11 @@ 1.4 { 1.5 field_attr = { style = "width: 3em; text-align: center;"}, 1.6 content = function() 1.7 - if initiative.issue.accepted and initiative.issue.closed and initiative.issue.ranks_available or initiative.admitted == false then 1.8 - ui.field.rank{ image_attr = { id = icon_name }, attr = { class = "rank" }, value = initiative.rank } 1.9 + if 1.10 + initiative.issue.accepted and initiative.issue.closed 1.11 + and initiative.issue.ranks_available or initiative.admitted == false 1.12 + then 1.13 + ui.field.rank{ image_attr = { id = icon_name }, attr = { class = "rank" }, value = initiative.rank, eligible = initiative.eligible } 1.14 else 1.15 slot.put(" ") 1.16 end
2.1 --- a/env/ui/field/rank.lua Tue Feb 28 18:34:09 2012 +0100 2.2 +++ b/env/ui/field/rank.lua Tue Feb 28 18:43:42 2012 +0100 2.3 @@ -1,12 +1,13 @@ 2.4 function ui.field.rank(args) 2.5 ui.form_element(args, {fetch_value = true}, function(args) 2.6 local value = args.value 2.7 + local eligible = args.eligible 2.8 ui.tag{ 2.9 attr = { class = "rank" }, 2.10 content = function() 2.11 - if value == 1 then 2.12 + if eligible and value == 1 then 2.13 ui.image{ attr = args.image_attr, static = "icons/16/award_star_gold_2.png" } 2.14 - elseif value then 2.15 + elseif eligible and value then 2.16 ui.image{ attr = args.image_attr, static = "icons/16/award_star_silver_2.png" } 2.17 else 2.18 ui.image{ attr = args.image_attr, static = "icons/16/cross.png" }