liquid_feedback_frontend
view app/main/member/_sidebar_contacts.lua @ 1060:d6ab5f231178
Fixed error when displaying initiatives in polling mode, made inline help for phases available
| author | bsw | 
|---|---|
| date | Wed Jul 16 21:50:26 2014 +0200 (2014-07-16) | 
| parents | 701a5cf6b067 | 
| children | 8be69c8d99a8 | 
 line source
     1 local member = param.get("member", "table")
     3 local public_contacts_selector = Contact:build_selector{
     4   public = true,
     5   member_id = member.id,
     6   order = "name"
     7 }
     9 local private_contacts_selector = Contact:build_selector{
    10   public = false,
    11   member_id = member.id,
    12   order = "name"
    13 }
    15 ui.sidebar( "tab-members", function()
    17   ui.sidebarHead( function()
    18     ui.heading { level = 2, content = _"Published contacts" }
    19   end )
    21   --ui.sidebarSection( function()
    23     if public_contacts_selector:count() == 0 then
    24       ui.sidebarSection( function()
    25         ui.field.text{ value = _"No published contacts" }
    26       end )
    27     else
    28       ui.paginate{
    29         selector = public_contacts_selector,
    30         name = "contacts",
    31         content = function()
    32           local contacts = public_contacts_selector:exec()
    33           for i, contact in ipairs(contacts) do
    34             ui.sidebarSection( "sidebarRowNarrow", function()
    35               execute.view{ module = "member_image", view = "_show", params = {
    36                 member_id = contact.other_member.id, class = "micro_avatar", 
    37                 popup_text = contact.other_member.name,
    38                 image_type = "avatar", show_dummy = true,
    39               } }
    40               slot.put(" ")
    41               ui.link{
    42                 content = contact.other_member.name,
    43                 module = "member",
    44                 view = "show",
    45                 id = contact.other_member.id
    46               }
    47             end )
    48           end
    49         end
    50       }
    51     end
    52   --end )
    55   if member.id == app.session.member.id and private_contacts_selector:count() > 0 then
    57     ui.sidebarHead( function()
    58       ui.heading { level = 2, content = _"Private contacts" }
    59     end )
    61     ui.paginate{
    62       selector = private_contacts_selector,
    63       name = "contacts",
    64       content = function()
    65         local contacts = private_contacts_selector:exec()
    66         for i, contact in ipairs(contacts) do
    67           ui.sidebarSection( "sidebarRowNarrow", function()
    68             execute.view{ module = "member_image", view = "_show", params = {
    69               member_id = contact.other_member.id, class = "micro_avatar", 
    70               popup_text = contact.other_member.name,
    71               image_type = "avatar", show_dummy = true,
    72             } }
    73             slot.put(" ")
    74             ui.link{
    75               content = contact.other_member.name,
    76               module = "member",
    77               view = "show",
    78               id = contact.other_member.id
    79             }
    80           end )
    81         end
    82       end
    83     }
    85   end
    86 end )
