liquid_feedback_frontend

view app/main/index/login.lua @ 15:a3ac899559de

Esperanto support activated in frontend
author bsw
date Sun Jan 31 22:34:45 2010 +0100 (2010-01-31)
parents 77d58efe99fd
children 00d1004545f1
line source
1 local warning_text = _"Some JavaScript based functions (voting in particular) will not work.\nFor this beta, please use a current version of Firefox, Safari, Opera(?), Konqueror or another (more) standard compliant browser.\nAlternative access without JavaScript will be available soon."
3 ui.script{ static = "js/browser_warning.js" }
4 ui.script{ script = "checkBrowser(" .. encode.json(_"Your web browser is not fully supported yet." .. " " .. warning_text:gsub("\n", "\n\n")) .. ");" }
6 ui.tag{
7 tag = "noscript",
8 content = function()
9 slot.put(_"JavaScript is disabled or not available." .. " " .. encode.html_newlines(warning_text))
10 end
11 }
13 slot.put_into("title", encode.html(config.app_title))
15 slot.select("title", function()
16 ui.container{
17 attr = { class = "lang_chooser" },
18 content = function()
19 for i, lang in ipairs{"en", "de", "eo"} do
20 ui.link{
21 content = function()
22 ui.image{
23 static = "lang/" .. lang .. ".png",
24 attr = { style = "margin-left: 0.5em;", alt = lang }
25 }
26 end,
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)
46 local lang = locale.get("lang")
47 local basepath = request.get_app_basepath()
48 local file_name = basepath .. "/locale/motd/" .. lang .. "_public.txt"
49 local file = io.open(file_name)
50 if file ~= nil then
51 local help_text = file:read("*a")
52 if #help_text > 0 then
53 ui.container{
54 attr = { class = "motd wiki" },
55 content = function()
56 slot.put(format.wiki_text(help_text))
57 end
58 }
59 end
60 end
64 ui.tag{
65 tag = 'p',
66 content = _'You need to be logged in, to use this system.'
67 }
69 ui.form{
70 attr = { class = "login" },
71 module = 'index',
72 action = 'login',
73 routing = {
74 ok = {
75 mode = 'redirect',
76 module = 'index',
77 view = 'index'
78 },
79 error = {
80 mode = 'forward',
81 module = 'index',
82 view = 'login',
83 }
84 },
85 content = function()
86 ui.field.text{
87 attr = { id = "username_field" },
88 label = _'login name',
89 html_name = 'login',
90 value = ''
91 }
92 ui.script{ script = 'document.getElementById("username_field").focus();' }
93 ui.field.password{
94 label = _'Password',
95 html_name = 'password',
96 value = ''
97 }
98 ui.submit{
99 text = _'Login'
100 }
101 end
102 }

Impressum / About Us