liquid_feedback_frontend
diff app/main/initiative/_list_element.lua @ 551:c1dc3b14a4f3
Initiative and initiative member_info preloading
| author | bsw |
|---|---|
| date | Fri Jun 15 19:00:43 2012 +0200 (2012-06-15) |
| parents | 3e4f6534bb15 |
| children | 53f93f0ffa6e |
line diff
1.1 --- a/app/main/initiative/_list_element.lua Tue May 29 20:52:49 2012 +0200 1.2 +++ b/app/main/initiative/_list_element.lua Fri Jun 15 19:00:43 2012 +0200 1.3 @@ -59,30 +59,40 @@ 1.4 end } 1.5 1.6 ui.container{ attr = { class = "interest" }, content = function() 1.7 - if initiative.is_initiator then 1.8 + if initiative.member_info.initiated then 1.9 local label = _"You are initiator of this initiative" 1.10 ui.image{ 1.11 attr = { alt = label, title = label }, 1.12 static = "icons/16/user_edit.png" 1.13 } 1.14 - elseif initiative.is_supporter then 1.15 - local label = _"You are supporter of this initiative" 1.16 - ui.image{ 1.17 - attr = { alt = label, title = label }, 1.18 - static = "icons/16/thumb_up_green.png" 1.19 - } 1.20 - elseif initiative.is_potential_supporter then 1.21 - local label = _"You are potentially supporter of this initiative" 1.22 - ui.image{ 1.23 - attr = { alt = label, title = label }, 1.24 - static = "icons/16/thumb_up.png" 1.25 - } 1.26 - elseif initiative.is_supporter_via_delegation then 1.27 - local label = _"You are supporter of this initiative via delegation" 1.28 - ui.image{ 1.29 - attr = { alt = label, title = label }, 1.30 - static = "icons/16/thumb_up_green.png" 1.31 - } 1.32 + elseif initiative.member_info.directly_supported then 1.33 + if initiative.member_info.satisfied then 1.34 + local label = _"You are supporter of this initiative" 1.35 + ui.image{ 1.36 + attr = { alt = label, title = label }, 1.37 + static = "icons/16/thumb_up_green.png" 1.38 + } 1.39 + else 1.40 + local label = _"You are potential supporter of this initiative" 1.41 + ui.image{ 1.42 + attr = { alt = label, title = label }, 1.43 + static = "icons/16/thumb_up.png" 1.44 + } 1.45 + end 1.46 + elseif initiative.member_info.supported then 1.47 + if initiative.member_info.satisfied then 1.48 + local label = _"You are supporter of this initiative via delegation" 1.49 + ui.image{ 1.50 + attr = { alt = label, title = label }, 1.51 + static = "icons/16/thumb_up_green_arrow.png" 1.52 + } 1.53 + else 1.54 + local label = _"You are potential supporter of this initiative via delegation" 1.55 + ui.image{ 1.56 + attr = { alt = label, title = label }, 1.57 + static = "icons/16/thumb_up_arrow.png" 1.58 + } 1.59 + end 1.60 end 1.61 end } 1.62