liquid_feedback_frontend
view 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 | 
 line source
     1 local areas = param.get("areas_selector", "table"):exec()
     2 local head_content = param.get("head_content", "function")
     4 ui.box{ class = "areas", row_count = #areas, content = function()
     5   if head_content then
     6     ui.box_row{ class = "head", content = function() ui.box_col{ content = head_content } end }
     7   end
     9   for i, area in ipairs(areas) do
    10     local delegation = Delegation:by_pk(app.session.member_id, area.id)
    12     ui.box_row{ 
    13       class = "area", 
    14       toggle_content = function() 
    15         ui.image{ static = "lf2/icon_search_crossed.png" } 
    16       end,
    17       content = function()
    18         ui.box_col{ class = "name", content = function()
    19           if delegation then
    20             execute.view{ module = "lf2", view = "_avatars", params = { members = { delegation.trustee }, size = "small" } }
    21           end
    22           ui.link{ module = "lf2", view = "area", id = area.id, text = area.name }
    23         end }
    24       end
    25     }
    27   end
    29 end }
