liquid_feedback_frontend
view app/main/member/show.lua @ 56:5a1f67c90e85
Translated new entries to EO, fixed two typos.
| author | Dinu Gherman | 
|---|---|
| date | Fri Apr 16 14:51:30 2010 +0200 (2010-04-16) | 
| parents | 00d1004545f1 | 
| children | 4f39f0a0d5b5 | 
 line source
     1 local member = Member:by_id(param.get_id())
     3 slot.select("title", function()
     4   execute.view{
     5     module = "member_image",
     6     view = "_show",
     7     params = {
     8       member = member,
     9       image_type = "avatar"
    10     }
    11   }
    12 end)
    14 slot.put_into("title", encode.html(_"Member '#{member}'":gsub("#{member}", member.name)))
    16 if member.id ~= app.session.member.id then
    17   --TODO performance
    18   local contact = Contact:by_pk(app.session.member.id, member.id)
    19   if contact then
    20     slot.select("actions", function()
    21       ui.container{
    22         attr = { class = "interest" },
    23         content = _"You have saved this member as contact."
    24       }
    25       ui.link{
    26         image  = { static = "icons/16/book_delete.png" },
    27         text   = _"Remove from contacts",
    28         module = "contact",
    29         action = "remove_member",
    30         id     = contact.other_member_id,
    31         routing = {
    32           default = {
    33             mode = "redirect",
    34             module = request.get_module(),
    35             view = request.get_view(),
    36             id = param.get_id_cgi(),
    37             params = param.get_all_cgi()
    38           }
    39         }
    40       }
    41     end)
    42   else
    43     slot.select("actions", function()
    44       ui.link{
    45         image   = { static = "icons/16/book_add.png" },
    46         text    = _"Add to my contacts",
    47         module  = "contact",
    48         action  = "add_member",
    49         id      = member.id,
    50         routing = {
    51           default = {
    52             mode = "redirect",
    53             module = request.get_module(),
    54             view = request.get_view(),
    55             id = param.get_id_cgi(),
    56             params = param.get_all_cgi()
    57           }
    58         }
    59       }
    60     end)
    61   end
    62 end
    64 slot.select("actions", function()
    65   ui.link{
    66     content = function()
    67       ui.image{ static = "icons/16/clock_edit.png" }
    68       slot.put(encode.html(_"Show name history"))
    69     end,
    70     module  = "member",
    71     view    = "history",
    72     id      = member.id
    73   }
    74 end)
    76 util.help("member.show", _"Member page")
    78 execute.view{
    79   module = "member",
    80   view = "_show",
    81   params = { member = member }
    82 }
