liquid_feedback_frontend
view app/main/membership/_show_box.lua @ 276:f460555c9896
Code cleanup
| author | bsw | 
|---|---|
| date | Sun Feb 12 20:03:26 2012 +0100 (2012-02-12) | 
| parents | ec86db506312 | 
| children | bde068b37608 | 
 line source
     1 local area = param.get("area", "table")
     3 local membership = Membership:by_pk(area.id, app.session.member.id)
     5 slot.select("interest", function()
     7   if membership then
     9     ui.container{
    10       attr = { 
    11         class = "head head_active",
    12         onclick = "document.getElementById('membership_content').style.display = 'block';"
    13       },
    14       content = function()
    15         ui.image{
    16           static = "icons/16/user_green.png"
    17         }
    18         slot.put(_"You are member")
    20         ui.image{
    21           static = "icons/16/dropdown.png"
    22         }
    23       end
    24     }
    26     ui.container{
    27       attr = { class = "content", id = "membership_content" },
    28       content = function()
    29         ui.container{
    30           attr = {
    31             class = "close",
    32             style = "cursor: pointer;",
    33             onclick = "document.getElementById('membership_content').style.display = 'none';"
    34           },
    35           content = function()
    36             ui.image{ static = "icons/16/cross.png" }
    37           end
    38         }
    39         ui.link{
    40           text    = _"Remove my membership",
    41           module  = "membership",
    42           action  = "update",
    43           params  = { area_id = area.id, delete = true },
    44           routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    45         }
    46       end
    47     }
    48   else
    49     ui.link{
    50       image  = { static = "icons/16/user_add.png" },
    51       text   = _"Become a member",
    52       module = "membership",
    53       action = "update",
    54       params = { area_id = area.id },
    55       routing = {
    56         default = {
    57           mode = "redirect",
    58           module = "area",
    59           view = "show",
    60           id = area.id
    61         }
    62       }
    63     }
    64   end
    66 end)
