liquid_feedback_frontend
view app/main/index/index.lua @ 276:f460555c9896
Code cleanup
| author | bsw | 
|---|---|
| date | Sun Feb 12 20:03:26 2012 +0100 (2012-02-12) | 
| parents | 7196685f9dd7 | 
| children | 9ac1ac69053d | 
 line source
     1 slot.select("title", function()
     2   if app.session.member then
     3     execute.view{
     4       module = "member_image",
     5       view = "_show",
     6       params = {
     7         member = app.session.member,
     8         image_type = "avatar"
     9       }
    10     }
    11   end
    12 end)
    14 slot.select("title", function()
    15   ui.container{
    16     attr = { class = "lang_chooser" },
    17     content = function()
    18       for i, lang in ipairs{"en", "de", "eo"} do
    19         ui.link{
    20           content = function()
    21             ui.image{
    22               static = "lang/" .. lang .. ".png",
    23               attr = { style = "margin-left: 0.5em;", alt = lang }
    24             }
    25           end,
    26           text = _('Select language "#{langcode}"', { langcode = lang }),
    27           module = "index",
    28           action = "set_lang",
    29           params = { lang = lang },
    30           routing = {
    31             default = {
    32               mode = "redirect",
    33               module = request.get_module(),
    34               view = request.get_view(),
    35               id = param.get_id_cgi(),
    36               params = param.get_all_cgi()
    37             }
    38           }
    39         }
    40       end
    41     end
    42   }
    43 end)
    45 slot.put_into("title", encode.html(config.app_title))
    47 if app.session.member_id then
    48   util.help("index.index", _"Home")
    50   execute.view{
    51     module = "member",
    52     view = "_show",
    53     params = {
    54       member = app.session.member,
    55       show_as_homepage = true
    56     }
    57   }
    59 elseif config.public_access then
    60   if config.motd_public then
    61     local help_text = config.motd_public
    62     ui.container{
    63       attr = { class = "wiki motd" },
    64       content = function()
    65         slot.put(format.wiki_text(help_text))
    66       end
    67     }
    68   end
    70   execute.view{ module = "unit", view = "_list" }
    72 else
    74   ui.tag{ content = _"Closed user group, please login to participate." }
    76 end
