webmcp
view demo-app/app/main/index/login.lua @ 11:d76a8857ba62
Added ui.partial and other functions, which allow partial content replacement using XMLHttpRequests; Image support for ui.link
Also includes following changes:
- Fix for rocketcgi library to accept POST data content-types, which contain additional charset information.
- Support arrays passed as params to encode.url (only for keys ending with "[]")
- Version information changed to "1.0.7"
Documentation for added functions is not yet complete.
Also includes following changes:
- Fix for rocketcgi library to accept POST data content-types, which contain additional charset information.
- Support arrays passed as params to encode.url (only for keys ending with "[]")
- Version information changed to "1.0.7"
Documentation for added functions is not yet complete.
| author | jbe/bsw |
|---|---|
| date | Fri Feb 12 18:40:22 2010 +0100 (2010-02-12) |
| parents | 9fdfb27f8e67 |
| children |
line source
1 slot.put_into("title", encode.html(_"Password login"))
3 slot.select("main", function()
5 ui.form{
6 attr = { class = "vertical" },
7 module = "index",
8 action = "login",
9 routing = {
10 default = {
11 mode = "redirect",
12 module = "index",
13 view = "index"
14 }
15 },
16 content = function()
18 ui.container{
19 attr = { class = "lang_chooser" },
20 content = function()
21 for i, lang in ipairs{"en", "de", "es"} do
22 ui.container{
23 content = function()
24 ui.link{
25 content = function()
26 ui.image{
27 static = "lang/" .. lang .. ".png",
28 attr = { alt = lang }
29 }
30 slot.put(lang)
31 end,
32 module = "index",
33 view = "login",
34 params = { lang = lang }
35 }
36 end
37 }
38 end
39 end
40 }
42 ui.field.text{ label = _"Username", name = "ident" }
43 ui.field.text{ label = _"Password", name = "password" }
44 ui.submit{ text = _"Login" }
45 end
46 }
47 end)
