webmcp

diff demo-app/app/main/index/login.lua @ 0:9fdfb27f8e67

Version 1.0.0
author jbe/bsw
date Sun Oct 25 12:00:00 2009 +0100 (2009-10-25)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/demo-app/app/main/index/login.lua	Sun Oct 25 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +slot.put_into("title", encode.html(_"Password login"))
     1.5 +
     1.6 +slot.select("main", function()
     1.7 +
     1.8 +  ui.form{
     1.9 +    attr = { class = "vertical" },
    1.10 +    module = "index",
    1.11 +    action = "login", 
    1.12 +    routing = { 
    1.13 +      default = {
    1.14 +        mode = "redirect",
    1.15 +        module = "index",
    1.16 +        view = "index"
    1.17 +      }
    1.18 +    },
    1.19 +    content = function()
    1.20 +
    1.21 +      ui.container{
    1.22 +        attr = { class = "lang_chooser" },
    1.23 +        content = function()
    1.24 +          for i, lang in ipairs{"en", "de", "es"} do
    1.25 +            ui.container{
    1.26 +              content = function()
    1.27 +                ui.link{
    1.28 +                  content = function()
    1.29 +                    ui.image{
    1.30 +                      static = "lang/" .. lang .. ".png",
    1.31 +                      attr = { alt = lang }
    1.32 +                    }
    1.33 +                    slot.put(lang)
    1.34 +                  end,
    1.35 +                  module = "index",
    1.36 +                  view = "login",
    1.37 +                  params = { lang = lang }
    1.38 +                }
    1.39 +              end
    1.40 +            }
    1.41 +          end
    1.42 +        end
    1.43 +      }
    1.44 +
    1.45 +      ui.field.text{ label = _"Username", name = "ident" }
    1.46 +      ui.field.text{ label = _"Password", name = "password" }
    1.47 +      ui.submit{ text = _"Login" }
    1.48 +    end
    1.49 +  }
    1.50 +end)
    1.51 \ No newline at end of file

Impressum / About Us