liquid_feedback_frontend

diff app/main/area/_head.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents 3378ea16007f
children 32cc544d5a5b
line diff
     1.1 --- a/app/main/area/_head.lua	Thu Jul 10 01:02:43 2014 +0200
     1.2 +++ b/app/main/area/_head.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -1,110 +1,39 @@
     1.4  local area = param.get("area", "table")
     1.5  local member = param.get("member", "table")
     1.6  
     1.7 -local show_content = param.get("show_content", atom.boolean)
     1.8 +ui.title ( function ()
     1.9  
    1.10 -if app.session.member_id then
    1.11 -  area:load_delegation_info_once_for_member_id(app.session.member_id)
    1.12 -end
    1.13 +  -- unit link
    1.14 +  ui.link {
    1.15 +    attr = { class = "unit" },
    1.16 +    content = function()
    1.17 +      ui.tag{ attr = { class = "name" }, content = area.unit.name }
    1.18 +    end,
    1.19 +    module = "unit", view = "show",
    1.20 +    id = area.unit.id
    1.21 +  }
    1.22  
    1.23 -if not param.get("hide_unit", atom.boolean) then
    1.24 -  execute.view{ module = "unit", view = "_head", params = { unit = area.unit, member = member } }
    1.25 -end
    1.26 +  ui.tag { attr = { class = "spacer" }, content = function()
    1.27 +    slot.put ( " ยป " )
    1.28 +  end }
    1.29  
    1.30 -ui.container{ attr = { class = "area_head" }, content = function()
    1.31 -
    1.32 -  execute.view{ module = "delegation", view = "_info", params = { area = area, member = member } }
    1.33 +  ui.tag { attr = { class = "area" }, content = function()
    1.34 +    -- area link
    1.35 +    ui.link {
    1.36 +      content = function()
    1.37 +        ui.tag{ attr = { class = "name" }, content = area.name }
    1.38 +      end,
    1.39 +      module = "area", view = "show",
    1.40 +      id = area.id
    1.41 +    }
    1.42 +    
    1.43 +    slot.put ( " " )
    1.44  
    1.45 -  ui.container{ attr = { class = "title" }, content = function()
    1.46 -    -- area name
    1.47 -    ui.link{
    1.48 -      module = "area", view = "show", id = area.id,
    1.49 -      attr = { class = "area_name" }, content = area.name 
    1.50 +    execute.view {
    1.51 +      module = "delegation", view = "_info", params = { 
    1.52 +        area = area, member = member, for_title = true
    1.53 +      }
    1.54      }
    1.55    end }
    1.56    
    1.57 -  if show_content then
    1.58 -    
    1.59 -    ui.container{ attr = { class = "content" }, content = function()
    1.60 -
    1.61 -      -- actions (members with appropriate voting right only)
    1.62 -      if member then
    1.63 -
    1.64 -        -- membership
    1.65 -        local membership = Membership:by_pk(area.id, member.id)
    1.66 -
    1.67 -        if membership then
    1.68 -          
    1.69 -          if app.session.member_id == member.id then
    1.70 -            ui.tag{ content = _"You are participating in this area" }
    1.71 -            slot.put(" ")
    1.72 -            ui.tag{ content = function()
    1.73 -              slot.put("(")
    1.74 -              ui.link{
    1.75 -                text    = _"Withdraw",
    1.76 -                module  = "membership",
    1.77 -                action  = "update",
    1.78 -                params  = { area_id = area.id, delete = true },
    1.79 -                routing = {
    1.80 -                  default = {
    1.81 -                    mode = "redirect",
    1.82 -                    module = request.get_module(),
    1.83 -                    view = request.get_view(),
    1.84 -                    id = param.get_id_cgi(),
    1.85 -                    params = param.get_all_cgi()
    1.86 -                  }
    1.87 -                }
    1.88 -              }
    1.89 -              slot.put(")")
    1.90 -            end }
    1.91 -          else
    1.92 -            ui.tag{ content = _"Member is participating in this area" }
    1.93 -          end
    1.94 -
    1.95 -        elseif app.session.member_id == member.id and member:has_voting_right_for_unit_id(area.unit_id) then
    1.96 -          ui.link{
    1.97 -            text   = _"Participate in this area",
    1.98 -            module = "membership",
    1.99 -            action = "update",
   1.100 -            params = { area_id = area.id },
   1.101 -            routing = {
   1.102 -              default = {
   1.103 -                mode = "redirect",
   1.104 -                module = request.get_module(),
   1.105 -                view = request.get_view(),
   1.106 -                id = param.get_id_cgi(),
   1.107 -                params = param.get_all_cgi()
   1.108 -              }
   1.109 -            }
   1.110 -          }
   1.111 -        end
   1.112 -        
   1.113 -        if app.session.member_id == member.id and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
   1.114 -
   1.115 -          slot.put(" · ")
   1.116 -          if area.delegation_info.own_delegation_scope ~= "area" then
   1.117 -            ui.link{ text = _"Delegate area", module = "delegation", view = "show", params = { area_id = area.id } }
   1.118 -          else
   1.119 -            ui.link{ text = _"Change area delegation", module = "delegation", view = "show", params = { area_id = area.id } }
   1.120 -          end
   1.121 -          slot.put(" · ")
   1.122 -
   1.123 -          ui.link{
   1.124 -            content = function()
   1.125 -              slot.put(_"Create new issue")
   1.126 -            end,
   1.127 -            module = "initiative",
   1.128 -            view = "new",
   1.129 -            params = { area_id = area.id }
   1.130 -          }
   1.131 -        end
   1.132 -
   1.133 -      end
   1.134 -
   1.135 -    end }
   1.136 -
   1.137 -  else
   1.138 -    slot.put("<br />")
   1.139 -  end
   1.140 -
   1.141 -end }
   1.142 \ No newline at end of file
   1.143 +end )
   1.144 \ No newline at end of file

Impressum / About Us