liquid_feedback_frontend
view app/main/index/index.lua @ 0:3bfb2fcf7ab9
Version alpha1
| author | bsw/jbe | 
|---|---|
| date | Wed Nov 18 12:00:00 2009 +0100 (2009-11-18) | 
| parents | |
| children | 80c215dbf076 | 
 line source
     1 slot.select("title", function()
     2   ui.image{
     3     attr = { class = "avatar" },
     4     module = "member",
     5     view = "avatar",
     6     extension = "jpg",
     7     id = app.session.member.id
     8   }
     9 end)
    11 slot.select("title", function()
    12   ui.container{
    13     attr = { class = "lang_chooser" },
    14     content = function()
    15       for i, lang in ipairs{"en", "de"} do
    16         ui.link{
    17           content = function()
    18             ui.image{
    19               static = "lang/" .. lang .. ".png",
    20               attr = { style = "margin-left: 0.5em;", alt = lang }
    21             }
    22           end,
    23           module = "index",
    24           action = "set_lang",
    25           params = { lang = lang },
    26           routing = {
    27             default = {
    28               mode = "redirect",
    29               module = request.get_module(),
    30               view = request.get_view(),
    31               id = param.get_id_cgi(),
    32               params = param.get_all_cgi()
    33             }
    34           }
    35         }
    36       end
    37     end
    38   }
    39 end)
    41 slot.put_into("title", encode.html(config.app_title))
    43 slot.select("actions", function()
    44   slot.put(_"Logged in as:")
    45   slot.put(" <b>")
    46   slot.put(app.session.member.login)
    47   slot.put("</b> | ")
    49   ui.link{
    50     content = function()
    51         ui.image{ static = "icons/16/user_gray.png" }
    52         slot.put(_"Upload avatar")
    53     end,
    54     module = "member",
    55     view = "edit_avatar"
    56   }
    58   ui.link{
    59     content = function()
    60         ui.image{ static = "icons/16/application_form.png" }
    61         slot.put(_"Edit my page")
    62     end,
    63     module = "member",
    64     view = "edit"
    65   }
    67   ui.link{
    68     content = function()
    69         ui.image{ static = "icons/16/key.png" }
    70         slot.put(_"Change password")
    71     end,
    72     module = "index",
    73     view = "change_password"
    74   }
    75 end)
    77 execute.view{
    78   module = "member",
    79   view = "_show",
    80   params = { member = app.session.member }
    81 }
