liquid_feedback_frontend
view app/main/index/index.lua @ 379:9e4cab06cba5
Added missing unit.list.en/de.txt files
author | jbe |
---|---|
date | Mon Mar 05 11:15:22 2012 +0100 (2012-03-05) |
parents | 5a0d5369b21d |
children | 9109900edad6 |
line source
1 slot.select("title", function()
2 if app.session.member then
3 execute.view{
4 module = "member_image",
5 view = "_show",
6 params = {
7 member = app.session.member,
8 image_type = "avatar"
9 }
10 }
11 end
12 end)
14 slot.select("title", function()
15 ui.container{
16 attr = { class = "lang_chooser" },
17 content = function()
18 for i, lang in ipairs{"en", "de", "eo"} do
19 ui.link{
20 content = function()
21 ui.image{
22 static = "lang/" .. lang .. ".png",
23 attr = { style = "margin-left: 0.5em;", alt = lang }
24 }
25 end,
26 text = _('Select language "#{langcode}"', { langcode = lang }),
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)
45 slot.put_into("title", encode.html(config.app_title))
47 if app.session.member_id then
48 util.help("index.index", _"Home")
50 execute.view{
51 module = "member",
52 view = "_show",
53 params = {
54 member = app.session.member,
55 show_as_homepage = true
56 }
57 }
59 elseif config.public_access then
60 if config.motd_public then
61 local help_text = config.motd_public
62 ui.container{
63 attr = { class = "wiki motd" },
64 content = function()
65 slot.put(format.wiki_text(help_text))
66 end
67 }
68 end
70 execute.view{ module = "unit", view = "_list" }
72 else
74 ui.tag{ tag = "p", content = _"Closed user group, please login to participate." }
76 ui.form{
77 attr = { class = "login" },
78 module = 'index',
79 action = 'login',
80 routing = {
81 ok = {
82 mode = 'redirect',
83 module = param.get("redirect_module") or "index",
84 view = param.get("redirect_view") or "index",
85 id = param.get("redirect_id"),
86 },
87 error = {
88 mode = 'forward',
89 module = 'index',
90 view = 'login',
91 }
92 },
93 content = function()
94 ui.field.text{
95 attr = { id = "username_field" },
96 label = _'login name',
97 html_name = 'login',
98 value = ''
99 }
100 ui.script{ script = 'document.getElementById("username_field").focus();' }
101 ui.field.password{
102 label = _'Password',
103 html_name = 'password',
104 value = ''
105 }
106 ui.submit{
107 text = _'Login'
108 }
109 end
110 }
112 end