liquid_feedback_frontend

diff app/main/index/_menu.lua @ 641:26d6d5cb4c7c

Improved language selection and made it available public
author bsw
date Mon Jun 25 19:42:26 2012 +0200 (2012-06-25)
parents
children f52f918b38b8
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/index/_menu.lua	Mon Jun 25 19:42:26 2012 +0200
     1.3 @@ -0,0 +1,104 @@
     1.4 +ui.tag{ tag = "ul", content = function()
     1.5 +
     1.6 +  if app.session.member_id then
     1.7 +    ui.tag{ tag = "li", content = function()
     1.8 +
     1.9 +      ui.link{
    1.10 +        text = _"Show profile",
    1.11 +        module = "member",
    1.12 +        view = "show",
    1.13 +        id = app.session.member_id
    1.14 +      }
    1.15 +      
    1.16 +    end }
    1.17 +    
    1.18 +    ui.tag{ tag = "li", content = function()
    1.19 +
    1.20 +      ui.link{
    1.21 +        content = function()
    1.22 +            slot.put(_"Edit profile")
    1.23 +        end,
    1.24 +        module = "member",
    1.25 +        view = "edit"
    1.26 +      }
    1.27 +
    1.28 +    end }
    1.29 +    
    1.30 +    ui.tag{ tag = "li", content = function()
    1.31 +
    1.32 +      ui.link{
    1.33 +        content = function()
    1.34 +            slot.put(_"Upload avatar/photo")
    1.35 +        end,
    1.36 +        module = "member",
    1.37 +        view = "edit_images"
    1.38 +      }
    1.39 +
    1.40 +    end }
    1.41 +      
    1.42 +    ui.tag{ tag = "li", content = function()
    1.43 +
    1.44 +      ui.link{
    1.45 +        content = _"Contacts",
    1.46 +        module = 'contact',
    1.47 +        view   = 'list'
    1.48 +      }
    1.49 +
    1.50 +    end }
    1.51 +    
    1.52 +    ui.tag{ tag = "li", content = function()
    1.53 +
    1.54 +      ui.link{
    1.55 +        text   = _"Settings",
    1.56 +        module = "member",
    1.57 +        view = "settings"
    1.58 +      }
    1.59 +
    1.60 +    end }
    1.61 +    
    1.62 +    ui.tag{ tag = "li", content = function()
    1.63 +
    1.64 +      ui.link{
    1.65 +        text   = _"Logout",
    1.66 +        module = 'index',
    1.67 +        action = 'logout',
    1.68 +        routing = {
    1.69 +          default = {
    1.70 +            mode = "redirect",
    1.71 +            module = "index",
    1.72 +            view = "index"
    1.73 +          }
    1.74 +        }
    1.75 +      }
    1.76 +    end }
    1.77 +  end
    1.78 +  
    1.79 +  for i, lang in ipairs(config.available_languages) do
    1.80 +    
    1.81 +    local langcode
    1.82 +    
    1.83 +    locale.do_with({ lang = lang }, function()
    1.84 +      langcode = _("[Name of Language]")
    1.85 +    end)
    1.86 +    
    1.87 +    ui.tag{ tag = "li", content = function()
    1.88 +      ui.link{
    1.89 +        content = _('Select language "#{langcode}"', { langcode = langcode }),
    1.90 +        module = "index",
    1.91 +        action = "set_lang",
    1.92 +        params = { lang = lang },
    1.93 +        routing = {
    1.94 +          default = {
    1.95 +            mode = "redirect",
    1.96 +            module = request.get_module(),
    1.97 +            view = request.get_view(),
    1.98 +            id = param.get_id_cgi(),
    1.99 +            params = param.get_all_cgi()
   1.100 +          }
   1.101 +        }
   1.102 +      }
   1.103 +    end }
   1.104 +  end
   1.105 +
   1.106 +end }
   1.107 +

Impressum / About Us