webmcp

view demo-app/app/main/_filter_view/30_topnav.lua @ 226:17baf126ea88

Fixed typo in execute._create_sorted_execution_list(...)
author jbe
date Fri Feb 27 22:31:07 2015 +0100 (2015-02-27)
parents 774a891dc74f
children
line source
1 -- display navigation only, if user is logged in
2 if app.session.user_id == nil then
3 execute.inner()
4 return
5 end
7 slot.select("topnav", function()
8 ui.link{
9 attr = { class = "nav" },
10 text = _"Home",
11 module = "index",
12 view = "index"
13 }
14 ui.link{
15 attr = { class = "nav" },
16 text = _"Media",
17 module = "medium"
18 }
19 ui.link{
20 attr = { class = "nav" },
21 text = _"Media types",
22 module = "media_type"
23 }
24 ui.link{
25 attr = { class = "nav" },
26 text = _"Genres",
27 module = "genre"
28 }
29 if app.session.user.admin then
30 ui.link{
31 attr = { class = "nav" },
32 text = _"Users",
33 module = "user"
34 }
35 end
36 ui.container{
37 attr = { class = "nav lang_chooser" },
38 content = function()
39 for i, lang in ipairs{"en", "de", "es"} do
40 ui.container{
41 content = function()
42 ui.link{
43 content = function()
44 ui.image{
45 static = "lang/" .. lang .. ".png",
46 attr = { alt = lang }
47 }
48 slot.put(lang)
49 end,
50 module = "index",
51 action = "set_lang",
52 params = { lang = lang },
53 routing = {
54 default = {
55 mode = "redirect",
56 module = request.get_module(),
57 view = request.get_view(),
58 id = request.get_id_string(),
59 params = request.get_param_strings()
60 }
61 }
62 }
63 end
64 }
65 end
66 end
67 }
69 ui.link{
70 attr = { class = "nav" },
71 text = _"Logout",
72 module = "index",
73 action = "logout",
74 redirect_to = {
75 ok = {
76 module = "index",
77 view = "login"
78 }
79 }
80 }
81 end)
83 execute.inner()

Impressum / About Us