liquid_feedback_frontend

view app/main/index/login.lua @ 51:0849be391140

Public read access; Read-only API for initiatives; Prepared integration of OpenID
author bsw
date Sun Apr 04 22:05:11 2010 +0200 (2010-04-04)
parents 00d1004545f1
children c553898f64cb
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 text = _('Select language "#{langcode}"', { langcode = lang }),
28 module = "index",
29 action = "set_lang",
30 params = { lang = lang },
31 routing = {
32 default = {
33 mode = "redirect",
34 module = request.get_module(),
35 view = request.get_view(),
36 id = param.get_id_cgi(),
37 params = param.get_all_cgi()
38 }
39 }
40 }
41 end
42 end
43 }
44 end)
47 ui.tag{
48 tag = 'p',
49 content = _'You need to be logged in, to use all features of this system.'
50 }
52 ui.form{
53 attr = { class = "login" },
54 module = 'index',
55 action = 'login',
56 routing = {
57 ok = {
58 mode = 'redirect',
59 module = param.get("redirect_module") or "index",
60 view = param.get("redirect_view") or "index",
61 id = param.get("redirect_id"),
62 },
63 error = {
64 mode = 'forward',
65 module = 'index',
66 view = 'login',
67 }
68 },
69 content = function()
70 ui.field.text{
71 attr = { id = "username_field" },
72 label = _'login name',
73 html_name = 'login',
74 value = ''
75 }
76 ui.script{ script = 'document.getElementById("username_field").focus();' }
77 ui.field.password{
78 label = _'Password',
79 html_name = 'password',
80 value = ''
81 }
82 ui.submit{
83 text = _'Login'
84 }
85 end
86 }
88 if config.auth_openid_enabled then
89 ui.form{
90 attr = { class = "login" },
91 module = 'openid',
92 action = 'initiate',
93 routing = {
94 default = {
95 mode = 'forward',
96 module = 'index',
97 view = 'login',
98 }
99 },
100 content = function()
101 ui.field.text{
102 label = _'OpenID',
103 html_name = 'openid_identifier',
104 value = ''
105 }
106 ui.submit{
107 text = _'OpenID Login'
108 }
109 end
110 }
111 end

Impressum / About Us