liquid_feedback_frontend
view app/main/index/login.lua @ 157:24e47baf5f9b
strip html from fallback title
if the slot is used for title, make sure the html is stripped from it
if the slot is used for title, make sure the html is stripped from it
| author | Daniel Poelzleithner <poelzi@poelzi.org> |
|---|---|
| date | Fri Oct 08 20:31:09 2010 +0200 (2010-10-08) |
| parents | 07953b0ef62c |
| children | 068ad175ebd7 |
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))
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 ui.tag{
58 tag = 'p',
59 content = _'You need to be logged in, to use all features of this system.'
60 }
62 ui.form{
63 attr = { class = "login" },
64 module = 'index',
65 action = 'login',
66 routing = {
67 ok = {
68 mode = 'redirect',
69 module = param.get("redirect_module") or "index",
70 view = param.get("redirect_view") or "index",
71 id = param.get("redirect_id"),
72 },
73 error = {
74 mode = 'forward',
75 module = 'index',
76 view = 'login',
77 }
78 },
79 content = function()
80 ui.field.text{
81 attr = { id = "username_field" },
82 label = _'login name',
83 html_name = 'login',
84 value = ''
85 }
86 ui.script{ script = 'document.getElementById("username_field").focus();' }
87 ui.field.password{
88 label = _'Password',
89 html_name = 'password',
90 value = ''
91 }
92 ui.submit{
93 text = _'Login'
94 }
95 end
96 }
98 if config.auth_openid_enabled then
99 ui.form{
100 attr = { class = "login" },
101 module = 'openid',
102 action = 'initiate',
103 routing = {
104 default = {
105 mode = 'forward',
106 module = 'index',
107 view = 'login',
108 }
109 },
110 content = function()
111 ui.field.text{
112 label = _'OpenID',
113 html_name = 'openid_identifier',
114 value = ''
115 }
116 ui.submit{
117 text = _'OpenID Login'
118 }
119 end
120 }
121 end
