liquid_feedback_frontend

diff app/main/area/_head.lua @ 526:18cd8595459b

Fixes for public access
author bsw
date Fri May 18 19:21:45 2012 +0200 (2012-05-18)
parents 63d6549cc00b
children 305329da1c75
line diff
     1.1 --- a/app/main/area/_head.lua	Fri May 18 19:07:07 2012 +0200
     1.2 +++ b/app/main/area/_head.lua	Fri May 18 19:21:45 2012 +0200
     1.3 @@ -2,84 +2,80 @@
     1.4  
     1.5  execute.view{ module = "unit", view = "_head", params = { unit = area.unit } }
     1.6  
     1.7 -slot.select("head", function()
     1.8 +ui.container{ attr = { class = "area_head" }, content = function()
     1.9  
    1.10 -  ui.container{ attr = { class = "area_head" }, content = function()
    1.11 -
    1.12 -    execute.view{ module = "delegation", view = "_info", params = { area = area } }
    1.13 +  execute.view{ module = "delegation", view = "_info", params = { area = area } }
    1.14  
    1.15 -    ui.container{ attr = { class = "title" }, content = function()
    1.16 -      -- area name
    1.17 -      ui.link{
    1.18 -        module = "area", view = "show", id = area.id,
    1.19 -        attr = { class = "area_name" }, content = area.name 
    1.20 -      }
    1.21 -    end }
    1.22 -    
    1.23 -    ui.container{ attr = { class = "content" }, content = function()
    1.24 +  ui.container{ attr = { class = "title" }, content = function()
    1.25 +    -- area name
    1.26 +    ui.link{
    1.27 +      module = "area", view = "show", id = area.id,
    1.28 +      attr = { class = "area_name" }, content = area.name 
    1.29 +    }
    1.30 +  end }
    1.31 +  
    1.32 +  ui.container{ attr = { class = "content" }, content = function()
    1.33  
    1.34 -      -- actions (members with appropriate voting right only)
    1.35 -      if app.session.member_id then
    1.36 +    -- actions (members with appropriate voting right only)
    1.37 +    if app.session.member_id then
    1.38  
    1.39 -        -- membership
    1.40 -        local membership = Membership:by_pk(area.id, app.session.member.id)
    1.41 +      -- membership
    1.42 +      local membership = Membership:by_pk(area.id, app.session.member.id)
    1.43  
    1.44 -        if membership then
    1.45 -          
    1.46 -          ui.tag{ content = _"You are member" }
    1.47 -          
    1.48 -          slot.put(" ")
    1.49 -          
    1.50 -          ui.tag{ content = function()
    1.51 -            slot.put("(")
    1.52 -            ui.link{
    1.53 -              text    = _"Withdraw",
    1.54 -              module  = "membership",
    1.55 -              action  = "update",
    1.56 -              params  = { area_id = area.id, delete = true },
    1.57 -              routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    1.58 -            }
    1.59 -            slot.put(")")
    1.60 -          end }
    1.61 -          
    1.62 -          slot.put(" · ")
    1.63 +      if membership then
    1.64 +        
    1.65 +        ui.tag{ content = _"You are member" }
    1.66 +        
    1.67 +        slot.put(" ")
    1.68 +        
    1.69 +        ui.tag{ content = function()
    1.70 +          slot.put("(")
    1.71 +          ui.link{
    1.72 +            text    = _"Withdraw",
    1.73 +            module  = "membership",
    1.74 +            action  = "update",
    1.75 +            params  = { area_id = area.id, delete = true },
    1.76 +            routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    1.77 +          }
    1.78 +          slot.put(")")
    1.79 +        end }
    1.80 +        
    1.81 +        slot.put(" · ")
    1.82  
    1.83 -        elseif app.session.member:has_voting_right_for_unit_id(area.unit_id) then
    1.84 -          ui.link{
    1.85 -            text   = _"Become a member",
    1.86 -            module = "membership",
    1.87 -            action = "update",
    1.88 -            params = { area_id = area.id },
    1.89 -            routing = {
    1.90 -              default = {
    1.91 -                mode = "redirect",
    1.92 -                module = "area",
    1.93 -                view = "show",
    1.94 -                id = area.id
    1.95 -              }
    1.96 +      elseif app.session.member:has_voting_right_for_unit_id(area.unit_id) then
    1.97 +        ui.link{
    1.98 +          text   = _"Become a member",
    1.99 +          module = "membership",
   1.100 +          action = "update",
   1.101 +          params = { area_id = area.id },
   1.102 +          routing = {
   1.103 +            default = {
   1.104 +              mode = "redirect",
   1.105 +              module = "area",
   1.106 +              view = "show",
   1.107 +              id = area.id
   1.108              }
   1.109            }
   1.110 -
   1.111 -          slot.put(" · ")
   1.112 -
   1.113 -        end
   1.114 +        }
   1.115  
   1.116 -        -- create new issue
   1.117 -        if app.session.member:has_voting_right_for_unit_id(area.unit_id) then
   1.118 -          ui.link{
   1.119 -            content = function()
   1.120 -              slot.put(_"Create new issue")
   1.121 -            end,
   1.122 -            module = "initiative",
   1.123 -            view = "new",
   1.124 -            params = { area_id = area.id }
   1.125 -          }
   1.126 -        end
   1.127 +        slot.put(" · ")
   1.128  
   1.129        end
   1.130  
   1.131 -    end }
   1.132 -    
   1.133 +      -- create new issue
   1.134 +      if app.session.member:has_voting_right_for_unit_id(area.unit_id) then
   1.135 +        ui.link{
   1.136 +          content = function()
   1.137 +            slot.put(_"Create new issue")
   1.138 +          end,
   1.139 +          module = "initiative",
   1.140 +          view = "new",
   1.141 +          params = { area_id = area.id }
   1.142 +        }
   1.143 +      end
   1.144 +
   1.145 +    end
   1.146 +
   1.147    end }
   1.148 -
   1.149 -end)
   1.150 \ No newline at end of file
   1.151 +  
   1.152 +end }
   1.153 \ No newline at end of file

Impressum / About Us