liquid_feedback_frontend

view app/main/_filter_view/30_navigation.lua @ 415:2113a6bb597d

Show private nav items only when logged in
author bsw
date Sat Mar 10 17:09:10 2012 +0100 (2012-03-10)
parents 699b9fa7bc36
children 990432f7dba0
line source
1 slot.put_into("app_name", config.app_title)
3 slot.select('navigation', function()
5 if config.public_access or app.session.member_id then
6 ui.link{
7 attr = { class = "logolf" },
8 content = _"Home",
9 module = 'index',
10 view = 'index'
11 }
12 end
14 if app.session.member_id then
15 ui.link{
16 content = _"Units",
17 module = 'unit',
18 view = 'list'
19 }
20 ui.link{
21 content = _"Members",
22 module = 'member',
23 view = 'list'
24 }
25 ui.link{
26 content = _"Contacts",
27 module = 'contact',
28 view = 'list'
29 }
30 end
32 if config.public_access and app.session.member == nil then
33 ui.link{
34 text = _"Login",
35 module = 'index',
36 view = 'login',
37 params = {
38 redirect_module = request.get_module(),
39 redirect_view = request.get_view(),
40 redirect_id = param.get_id()
41 }
42 }
43 end
45 if app.session.member == nil then
46 ui.link{
47 text = _"Registration",
48 module = 'index',
49 view = 'register'
50 }
51 ui.link{
52 text = _"Reset password",
53 module = 'index',
54 view = 'reset_password'
55 }
56 ui.link{
57 text = _"About / Impressum",
58 module = 'index',
59 view = 'about'
60 }
61 else
63 ui.container{ attr = { class = "member_info" }, content = function()
64 ui.link{
65 content = function()
66 execute.view{
67 module = "member_image",
68 view = "_show",
69 params = {
70 member = app.session.member,
71 image_type = "avatar",
72 show_dummy = true,
73 class = "micro_avatar",
74 }
75 }
76 ui.tag{ content = app.session.member.name }
77 end,
78 module = "member",
79 view = "show",
80 id = app.session.member_id
81 }
83 ui.link{
84 text = _"Settings",
85 module = "member",
86 view = "settings"
87 }
89 if app.session.member_id then
90 ui.link{
91 -- image = { static = "icons/16/stop.png" },
92 text = _"Logout",
93 module = 'index',
94 action = 'logout',
95 routing = {
96 default = {
97 mode = "redirect",
98 module = "index",
99 view = "index"
100 }
101 }
102 }
103 end
105 ui.link{
106 text = _"About",
107 module = 'index',
108 view = 'about'
109 }
111 if app.session.member.admin then
113 slot.put(" ")
115 ui.link{
116 attr = { class = { "admin_only" } },
117 text = _"Admin",
118 module = 'admin',
119 view = 'index'
120 }
122 end
123 end }
125 end
127 end)
129 if config.app_logo then
130 slot.select("logo", function()
131 ui.image{ static = config.app_logo }
132 end)
133 end
135 execute.inner()

Impressum / About Us