liquid_feedback_frontend

diff app/main/lf2/_area.lua @ 212:3e4ad069847a

Some more work at 2nd generation frontend code
author bsw
date Thu Mar 03 18:39:00 2011 +0100 (2011-03-03)
parents 4993b71b383f
children 1dab81353eb1
line diff
     1.1 --- a/app/main/lf2/_area.lua	Wed Mar 02 20:06:26 2011 +0100
     1.2 +++ b/app/main/lf2/_area.lua	Thu Mar 03 18:39:00 2011 +0100
     1.3 @@ -11,8 +11,8 @@
     1.4  ui.box{ class = "area", content = function()
     1.5  
     1.6    ui.box_row{ class = "head", content = function()
     1.7 -    ui.box_col{ class = "left name", content = area.name } 
     1.8 -    ui.box_col{ class = "right", content = _("#{direct_count}+#{delegated_count} Mitglieder", {
     1.9 +    ui.box_col{ class = "head left name", content = area.name } 
    1.10 +    ui.box_col{ class = "right", content = _("#{direct_count}+#{delegated_count} members", {
    1.11        direct_count = area.direct_member_count,
    1.12        delegated_count = area.member_weight - area.direct_member_count 
    1.13      } ) }
    1.14 @@ -22,21 +22,24 @@
    1.15      ui.box_row{ class = "description", content = function() ui.box_col{ content = area.description } end }
    1.16    end
    1.17    
    1.18 -  ui.box_row{ class = "member_count", content = function()
    1.19 -  end }
    1.20 -
    1.21 -  ui.box_row{ content = function()
    1.22 -    ui.box_col{ class = "left", content = function()
    1.23 -      execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } }
    1.24 +  if #trustees > 1 then
    1.25 +    ui.box_row{ content = function()
    1.26 +      ui.box_col{ class = "left", content = function()
    1.27 +        execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } }
    1.28 +      end }
    1.29 +      if trustees[1].scope_out == "area" then
    1.30 +        text = _"Change or revoke area delegation..."
    1.31 +      else
    1.32 +        text = _"Set area delegation..."
    1.33 +      end  
    1.34 +      ui.box_col{ class = "right", content = function()
    1.35 +        ui.link{
    1.36 +          text = text,
    1.37 +          module = "lf2", view = "delegation", params = { area_id = area.id }
    1.38 +        }    
    1.39 +      end }
    1.40      end }
    1.41 -    ui.box_col{ class = "right", content = function()
    1.42 -      ui.tag{ content = _"[Change] or [revoke] area delegation [prefix]" }
    1.43 -      ui.link{ text = _"[Change] or [revoke] area delegation [change]" }
    1.44 -      ui.tag{ content = _"[Change] or [revoke] area delegation [midpart]" }
    1.45 -      ui.link{ text = _"[Change] or [revoke] area delegation [revoke]" }
    1.46 -      ui.tag{ content = _"[Change] or [revoke] area delegation [suffix]" }
    1.47 -    end }
    1.48 -  end }
    1.49 +  end
    1.50  
    1.51    ui.box_row{ content = function()
    1.52      ui.box_col{ class = "left", content = function()
    1.53 @@ -63,11 +66,14 @@
    1.54            text = _"Give up membership"
    1.55          }
    1.56        end
    1.57 -      if not trustees then
    1.58 +      if #trustees == 1 then
    1.59          if membership then
    1.60            slot.put(" · ")
    1.61          end
    1.62 -        ui.link{ text = _"Delegate area...", module = "lf2", view = "delegation" }
    1.63 +        ui.link{
    1.64 +          text = _"Set area delegation...",
    1.65 +          module = "lf2", view = "delegation", params = { area_id = area.id }
    1.66 +        }    
    1.67        end
    1.68      end }
    1.69    end }

Impressum / About Us