liquid_feedback_frontend

diff app/main/area/_list.lua @ 375:89d32158bfd5

Show unit delegatee on member area list, optical enhancements on member area list
author bsw
date Sun Mar 04 14:18:41 2012 +0100 (2012-03-04)
parents 76d7eafb3893
children 2dae61588cee
line diff
     1.1 --- a/app/main/area/_list.lua	Sat Mar 03 17:30:16 2012 +0100
     1.2 +++ b/app/main/area/_list.lua	Sun Mar 04 14:18:41 2012 +0100
     1.3 @@ -1,4 +1,5 @@
     1.4  local areas_selector = param.get("areas_selector", "table")
     1.5 +local hide_membership = param.get("hide_membership", atom.boolean)
     1.6  
     1.7  areas_selector
     1.8    :reset_fields()
     1.9 @@ -35,35 +36,22 @@
    1.10  
    1.11      ui.container{ attr = { class = "area" }, content = function()
    1.12  
    1.13 -      ui.container{ attr = { class = "info" }, content = function()
    1.14 -
    1.15 -        ui.container{ attr = { class = "bar" }, content = function()
    1.16 -          if area.member_weight and area.direct_member_count then
    1.17 -            local max_value = MemberCount:get()
    1.18 -            ui.bargraph{
    1.19 -              max_value = max_value,
    1.20 -              width = 100,
    1.21 -              bars = {
    1.22 -                { color = "#444", value = area.direct_member_count },
    1.23 -                { color = "#777", value = area.member_weight - area.direct_member_count },
    1.24 -                { color = "#ddd", value = max_value - area.member_weight },
    1.25 -              }
    1.26 +      ui.container{ attr = { class = "bar" }, content = function()
    1.27 +        if area.member_weight and area.direct_member_count then
    1.28 +          local max_value = MemberCount:get()
    1.29 +          ui.bargraph{
    1.30 +            max_value = max_value,
    1.31 +            width = 100,
    1.32 +            bars = {
    1.33 +              { color = "#444", value = area.direct_member_count },
    1.34 +              { color = "#777", value = area.member_weight - area.direct_member_count },
    1.35 +              { color = "#ddd", value = max_value - area.member_weight },
    1.36              }
    1.37 -          end
    1.38 -        end }
    1.39 +          }
    1.40 +        end
    1.41 +      end }
    1.42  
    1.43 -        ui.container{ attr = { class = "name" }, content = function()
    1.44 -            ui.link{
    1.45 -              text = area.name,
    1.46 -              module = "area",
    1.47 -              view = "show",
    1.48 -              id = area.id
    1.49 -            }
    1.50 -            slot.put(" ")
    1.51 -            ui.tag{ content = "" }
    1.52 -          end
    1.53 -        }
    1.54 -        
    1.55 +      if not hide_membership then
    1.56          ui.container{ attr = { class = "membership" }, content = function()
    1.57            if area.is_member then
    1.58              local text = _"Member of area"
    1.59 @@ -75,31 +63,41 @@
    1.60              slot.put('<img src="null.png" width="16" height="1" />')
    1.61            end
    1.62          end }
    1.63 -          
    1.64 -        ui.container{ attr = { class = "delegatee" }, content = function()
    1.65 -          if area.trustee_member_id then
    1.66 -            local trustee_member = Member:by_id(area.trustee_member_id)
    1.67 -            local text = _("Area delegated to '#{name}'", { name = area.trustee_member_name })
    1.68 -            local text = _"delegated to"
    1.69 -            ui.image{
    1.70 -              attr = { class = "delegation_arrow", alt = text, title = text },
    1.71 -              static = "delegation_arrow_24_horizontal.png"
    1.72 +      end
    1.73 +
    1.74 +      ui.container{ attr = { class = "delegatee" }, content = function()
    1.75 +        if area.trustee_member_id then
    1.76 +          local trustee_member = Member:by_id(area.trustee_member_id)
    1.77 +          local text = _("Area delegated to '#{name}'", { name = area.trustee_member_name })
    1.78 +          ui.image{
    1.79 +            attr = { class = "delegation_arrow", alt = text, title = text },
    1.80 +            static = "delegation_arrow_24_horizontal.png"
    1.81 +          }
    1.82 +          execute.view{
    1.83 +            module = "member_image",
    1.84 +            view = "_show",
    1.85 +            params = {
    1.86 +              member = trustee_member,
    1.87 +              image_type = "avatar",
    1.88 +              show_dummy = true,
    1.89 +              class = "micro_avatar",
    1.90 +              popup_text = text
    1.91              }
    1.92 -            execute.view{
    1.93 -              module = "member_image",
    1.94 -              view = "_show",
    1.95 -              params = {
    1.96 -                member = trustee_member,
    1.97 -                image_type = "avatar",
    1.98 -                show_dummy = true,
    1.99 -                class = "micro_avatar",
   1.100 -                popup_text = text
   1.101 -              }
   1.102 -            }
   1.103 -          else
   1.104 -            slot.put('<img src="null.png" width="24" height="1" />')
   1.105 -          end
   1.106 -        end }
   1.107 +          }
   1.108 +        else
   1.109 +          slot.put('<img src="null.png" width="41" height="1" />')
   1.110 +        end
   1.111 +      end }
   1.112 +  
   1.113 +      ui.container{ attr = { class = "name" }, content = function()
   1.114 +        ui.link{
   1.115 +          text = area.name,
   1.116 +          module = "area",
   1.117 +          view = "show",
   1.118 +          id = area.id
   1.119 +        }
   1.120 +        slot.put(" ")
   1.121 +        ui.tag{ content = "" }
   1.122        end }
   1.123  
   1.124        ui.container{ attr = { class = "phases" }, content = function()
   1.125 @@ -166,7 +164,7 @@
   1.126  
   1.127        end }
   1.128        
   1.129 -      slot.put("<br /")
   1.130 +      slot.put("<br />")
   1.131      end }
   1.132      
   1.133    end

Impressum / About Us