annotate app/main/lf2/_areas.lua @ 211:4993b71b383f
First checkin of lf2 (frontend second generation) prototype
 | author | 
 bsw | 
 | date | 
 Wed Mar 02 20:06:26 2011 +0100 (2011-03-02) | 
 | parents | 
  | 
 | children | 
 3e4ad069847a  | 
 
 | rev | 
   line source | 
| 
bsw@211
 | 
     1 local areas = param.get("areas_selector", "table"):exec()
 | 
| 
bsw@211
 | 
     2 local head_content = param.get("head_content", "function")
 | 
| 
bsw@211
 | 
     3 
 | 
| 
bsw@211
 | 
     4 ui.box{ class = "areas", row_count = #areas, content = function()
 | 
| 
bsw@211
 | 
     5   if head_content then
 | 
| 
bsw@211
 | 
     6     ui.box_row{ class = "head", content = function() ui.box_col{ content = head_content } end }
 | 
| 
bsw@211
 | 
     7   end
 | 
| 
bsw@211
 | 
     8 
 | 
| 
bsw@211
 | 
     9   for i, area in ipairs(areas) do
 | 
| 
bsw@211
 | 
    10     local delegation = Delegation:by_pk(app.session.member_id, area.id)
 | 
| 
bsw@211
 | 
    11     
 | 
| 
bsw@211
 | 
    12     ui.box_row{ 
 | 
| 
bsw@211
 | 
    13       class = "area", 
 | 
| 
bsw@211
 | 
    14       toggle_content = function() 
 | 
| 
bsw@211
 | 
    15         ui.image{ static = "lf2/icon_search_crossed.png" } 
 | 
| 
bsw@211
 | 
    16       end,
 | 
| 
bsw@211
 | 
    17       content = function()
 | 
| 
bsw@211
 | 
    18         ui.box_col{ class = "name", content = function()
 | 
| 
bsw@211
 | 
    19           if delegation then
 | 
| 
bsw@211
 | 
    20             execute.view{ module = "lf2", view = "_avatars", params = { members = { delegation.trustee }, size = "small" } }
 | 
| 
bsw@211
 | 
    21           end
 | 
| 
bsw@211
 | 
    22           ui.link{ module = "lf2", view = "area", id = area.id, text = area.name }
 | 
| 
bsw@211
 | 
    23         end }
 | 
| 
bsw@211
 | 
    24       end
 | 
| 
bsw@211
 | 
    25     }
 | 
| 
bsw@211
 | 
    26     
 | 
| 
bsw@211
 | 
    27   end
 | 
| 
bsw@211
 | 
    28 
 | 
| 
bsw@211
 | 
    29 end } |