liquid_feedback_frontend
view app/main/membership/_show_box.lua @ 189:94075385f7ab
Added tag beta29 for changeset b25322737af5
| author | bsw | 
|---|---|
| date | Mon Nov 08 01:44:05 2010 +0100 (2010-11-08) | 
| parents | ca006681befc | 
| children | ec86db506312 | 
 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         if membership.autoreject == true then
    21           ui.image{
    22             static = "icons/16/thumb_down_red.png"
    23           }
    24         end
    26         ui.image{
    27           static = "icons/16/dropdown.png"
    28         }
    29       end
    30     }
    32     ui.container{
    33       attr = { class = "content", id = "membership_content" },
    34       content = function()
    35         ui.container{
    36           attr = {
    37             class = "close",
    38             style = "cursor: pointer;",
    39             onclick = "document.getElementById('membership_content').style.display = 'none';"
    40           },
    41           content = function()
    42             ui.image{ static = "icons/16/cross.png" }
    43           end
    44         }
    45         ui.link{
    46           text    = _"Remove my membership",
    47           module  = "membership",
    48           action  = "update",
    49           params  = { area_id = area.id, delete = true },
    50           routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    51         }
    52         if membership.autoreject then
    53           ui.field.text{ value = _"Autoreject is on." }
    54           ui.link{
    55             text    = _"Remove autoreject",
    56             module  = "membership",
    57             action  = "update",
    58             params  = { area_id = area.id, autoreject = false },
    59             routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    60           }
    61         else
    62           ui.field.text{ value = _"Autoreject is off." }
    63           ui.link{
    64             text    = _"Set autoreject",
    65             module  = "membership",
    66             action  = "update",
    67             params  = { area_id = area.id, autoreject = true },
    68             routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    69           }
    70         end
    71       end
    72     }
    73   else
    74     ui.link{
    75       image  = { static = "icons/16/user_add.png" },
    76       text   = _"Become a member",
    77       module = "membership",
    78       action = "update",
    79       params = { area_id = area.id },
    80       routing = {
    81         default = {
    82           mode = "redirect",
    83           module = "area",
    84           view = "show",
    85           id = area.id
    86         }
    87       }
    88     }
    89   end
    91 end)
