liquid_feedback_frontend
view app/main/index/login.lua @ 369:5a0d5369b21d
Login at startpage when no public_access
| author | bsw |
|---|---|
| date | Thu Mar 01 12:25:46 2012 +0100 (2012-03-01) |
| parents | 068ad175ebd7 |
| children | 58647c8a0339 |
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, Chrome, 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))
14 app.html_title.title = _"Login"
16 slot.select("title", function()
17 ui.container{
18 attr = { class = "lang_chooser" },
19 content = function()
20 for i, lang in ipairs{"en", "de", "eo"} do
21 ui.link{
22 content = function()
23 ui.image{
24 static = "lang/" .. lang .. ".png",
25 attr = { style = "margin-left: 0.5em;", alt = lang }
26 }
27 end,
28 text = _('Select language "#{langcode}"', { langcode = lang }),
29 module = "index",
30 action = "set_lang",
31 params = { lang = lang },
32 routing = {
33 default = {
34 mode = "redirect",
35 module = request.get_module(),
36 view = request.get_view(),
37 id = param.get_id_cgi(),
38 params = param.get_all_cgi()
39 }
40 }
41 }
42 end
43 end
44 }
45 end)
47 if config.motd_public then
48 local help_text = config.motd_public
49 ui.container{
50 attr = { class = "wiki motd" },
51 content = function()
52 slot.put(format.wiki_text(help_text))
53 end
54 }
55 end
57 if config.public_access then
58 ui.tag{
59 tag = 'p',
60 content = _'You need to be logged in, to use all features of this system.'
61 }
62 else
63 ui.tag{ tag = "p", content = _"Closed user group, please login to participate." }
64 end
66 ui.form{
67 attr = { class = "login" },
68 module = 'index',
69 action = 'login',
70 routing = {
71 ok = {
72 mode = 'redirect',
73 module = param.get("redirect_module") or "index",
74 view = param.get("redirect_view") or "index",
75 id = param.get("redirect_id"),
76 },
77 error = {
78 mode = 'forward',
79 module = 'index',
80 view = 'login',
81 }
82 },
83 content = function()
84 ui.field.text{
85 attr = { id = "username_field" },
86 label = _'login name',
87 html_name = 'login',
88 value = ''
89 }
90 ui.script{ script = 'document.getElementById("username_field").focus();' }
91 ui.field.password{
92 label = _'Password',
93 html_name = 'password',
94 value = ''
95 }
96 ui.submit{
97 text = _'Login'
98 }
99 end
100 }
102 if config.auth_openid_enabled then
103 ui.form{
104 attr = { class = "login" },
105 module = 'openid',
106 action = 'initiate',
107 routing = {
108 default = {
109 mode = 'forward',
110 module = 'index',
111 view = 'login',
112 }
113 },
114 content = function()
115 ui.field.text{
116 label = _'OpenID',
117 html_name = 'openid_identifier',
118 value = ''
119 }
120 ui.submit{
121 text = _'OpenID Login'
122 }
123 end
124 }
125 end
