annotate app/main/member/_menu.lua @ 579:a06634d17718
Make available languages configurable
author |
bsw |
date |
Wed Jun 20 11:31:59 2012 +0200 (2012-06-20) |
parents |
63d6549cc00b |
children |
95f214d91956 |
rev |
line source |
bsw@525
|
1 ui.tag{ tag = "ul", content = function()
|
bsw@525
|
2
|
bsw@525
|
3 ui.tag{ tag = "li", content = function()
|
bsw@525
|
4
|
bsw@525
|
5 ui.link{
|
bsw@525
|
6 text = _"Show profile",
|
bsw@525
|
7 module = "member",
|
bsw@525
|
8 view = "show",
|
bsw@525
|
9 id = app.session.member_id
|
bsw@525
|
10 }
|
bsw@525
|
11
|
bsw@525
|
12 end }
|
bsw@525
|
13
|
bsw@525
|
14 ui.tag{ tag = "li", content = function()
|
bsw@525
|
15
|
bsw@525
|
16 ui.link{
|
bsw@525
|
17 content = function()
|
bsw@525
|
18 slot.put(_"Edit profile")
|
bsw@525
|
19 end,
|
bsw@525
|
20 module = "member",
|
bsw@525
|
21 view = "edit"
|
bsw@525
|
22 }
|
bsw@525
|
23
|
bsw@525
|
24 end }
|
bsw@525
|
25
|
bsw@525
|
26 ui.tag{ tag = "li", content = function()
|
bsw@525
|
27
|
bsw@525
|
28 ui.link{
|
bsw@525
|
29 content = function()
|
bsw@525
|
30 slot.put(_"Upload avatar/photo")
|
bsw@525
|
31 end,
|
bsw@525
|
32 module = "member",
|
bsw@525
|
33 view = "edit_images"
|
bsw@525
|
34 }
|
bsw@525
|
35
|
bsw@525
|
36 end }
|
bsw@525
|
37
|
bsw@525
|
38 ui.tag{ tag = "li", content = function()
|
bsw@525
|
39
|
bsw@525
|
40 ui.link{
|
bsw@525
|
41 content = _"Contacts",
|
bsw@525
|
42 module = 'contact',
|
bsw@525
|
43 view = 'list'
|
bsw@525
|
44 }
|
bsw@525
|
45
|
bsw@525
|
46 end }
|
bsw@525
|
47
|
bsw@525
|
48 ui.tag{ tag = "li", content = function()
|
bsw@525
|
49
|
bsw@525
|
50 ui.link{
|
bsw@525
|
51 text = _"Settings",
|
bsw@525
|
52 module = "member",
|
bsw@525
|
53 view = "settings"
|
bsw@525
|
54 }
|
bsw@525
|
55
|
bsw@525
|
56 end }
|
bsw@525
|
57
|
bsw@525
|
58 ui.tag{ tag = "li", content = function()
|
bsw@525
|
59
|
bsw@525
|
60 ui.link{
|
bsw@525
|
61 text = _"Logout",
|
bsw@525
|
62 module = 'index',
|
bsw@525
|
63 action = 'logout',
|
bsw@525
|
64 routing = {
|
bsw@525
|
65 default = {
|
bsw@525
|
66 mode = "redirect",
|
bsw@525
|
67 module = "index",
|
bsw@525
|
68 view = "index"
|
bsw@525
|
69 }
|
bsw@525
|
70 }
|
bsw@525
|
71 }
|
bsw@525
|
72 end }
|
bsw@525
|
73
|
bsw@525
|
74 ui.tag{ tag = "li", content = function()
|
bsw@525
|
75 ui.tag{ tag = "span", content = _"Select language" }
|
bsw@525
|
76 end }
|
bsw@525
|
77
|
bsw@579
|
78 for i, lang in ipairs(config.available_languages) do
|
bsw@525
|
79 ui.tag{ tag = "li", content = function()
|
bsw@525
|
80 ui.link{
|
bsw@579
|
81 content = _('Select language "#{langcode}"', { langcode = lang }),
|
bsw@525
|
82 module = "index",
|
bsw@525
|
83 action = "set_lang",
|
bsw@525
|
84 params = { lang = lang },
|
bsw@525
|
85 routing = {
|
bsw@525
|
86 default = {
|
bsw@525
|
87 mode = "redirect",
|
bsw@525
|
88 module = request.get_module(),
|
bsw@525
|
89 view = request.get_view(),
|
bsw@525
|
90 id = param.get_id_cgi(),
|
bsw@525
|
91 params = param.get_all_cgi()
|
bsw@525
|
92 }
|
bsw@525
|
93 }
|
bsw@525
|
94 }
|
bsw@525
|
95 end }
|
bsw@525
|
96 end
|
bsw@525
|
97
|
bsw@525
|
98 end }
|
bsw@525
|
99
|