liquid_feedback_frontend

view app/main/index/index.lua @ 414:699b9fa7bc36

Integrated new event system, splitted issues in open/closed, changed navigation
author bsw
date Sat Mar 10 16:57:49 2012 +0100 (2012-03-10)
parents 9109900edad6
children 58647c8a0339
line source
1 slot.select("title", function()
2 ui.container{
3 attr = { class = "lang_chooser" },
4 content = function()
5 for i, lang in ipairs{"en", "de", "eo"} do
6 ui.link{
7 content = function()
8 ui.image{
9 static = "lang/" .. lang .. ".png",
10 attr = { style = "margin-left: 0.5em;", alt = lang }
11 }
12 end,
13 text = _('Select language "#{langcode}"', { langcode = lang }),
14 module = "index",
15 action = "set_lang",
16 params = { lang = lang },
17 routing = {
18 default = {
19 mode = "redirect",
20 module = request.get_module(),
21 view = request.get_view(),
22 id = param.get_id_cgi(),
23 params = param.get_all_cgi()
24 }
25 }
26 }
27 end
28 end
29 }
30 end)
32 slot.put_into("title", encode.html(config.app_title))
34 if app.session.member_id then
35 util.help("index.index", _"Home")
37 execute.view{
38 module = "member",
39 view = "_show",
40 params = {
41 member = app.session.member,
42 show_as_homepage = true
43 }
44 }
46 elseif config.public_access then
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 execute.view{ module = "unit", view = "_list" }
59 else
61 if config.motd_public then
62 local help_text = config.motd_public
63 ui.container{
64 attr = { class = "wiki motd" },
65 content = function()
66 slot.put(format.wiki_text(help_text))
67 end
68 }
69 end
71 ui.tag{ tag = "p", content = _"Closed user group, please login to participate." }
73 ui.form{
74 attr = { class = "login" },
75 module = 'index',
76 action = 'login',
77 routing = {
78 ok = {
79 mode = 'redirect',
80 module = param.get("redirect_module") or "index",
81 view = param.get("redirect_view") or "index",
82 id = param.get("redirect_id"),
83 },
84 error = {
85 mode = 'forward',
86 module = 'index',
87 view = 'login',
88 }
89 },
90 content = function()
91 ui.field.text{
92 attr = { id = "username_field" },
93 label = _'login name',
94 html_name = 'login',
95 value = ''
96 }
97 ui.script{ script = 'document.getElementById("username_field").focus();' }
98 ui.field.password{
99 label = _'Password',
100 html_name = 'password',
101 value = ''
102 }
103 ui.submit{
104 text = _'Login'
105 }
106 end
107 }
109 end

Impressum / About Us