liquid_feedback_frontend

view app/main/_filter_view/30_navigation.lua @ 241:6725c13b6ce0

Add initial unit support
author bsw
date Fri Dec 30 02:59:43 2011 +0100 (2011-12-30)
parents 0849be391140
children 272193cc190e
line source
1 slot.put_into("app_name", config.app_title)
3 slot.select('navigation', function()
5 if app.session.member then
6 ui.link{
7 image = { static = "icons/16/house.png" },
8 text = _"Home",
9 module = 'index',
10 view = 'index'
11 }
12 end
14 if app.session.member or config.public_access then
16 local units = Unit:get_flattened_tree()
18 ui.form{
19 module = "index", action = "set_current_units",
20 routing = { default = { mode = "redirect", module = "area", view = "list" } },
21 content = function()
22 ui.tag{
23 tag = "select",
24 attr = { name = "unit_ids", onchange = "this.form.submit();" },
25 content = function ()
26 for i, unit in ipairs(units) do
27 local selected
28 -- TODO support multiple units
29 if unit.id == param.get("units", atom.integer) then
30 selected = "selected"
31 end
32 ui.tag{
33 tag = "option",
34 attr = { value = unit.id, selected = selected },
35 content = unit.name
36 }
37 end
38 end
39 }
40 end
41 }
43 ui.link{
44 image = { static = "icons/16/package.png" },
45 text = _"Areas",
46 module = 'area',
47 view = 'list'
48 }
50 end
52 if app.session.member == nil then
53 ui.link{
54 image = { static = "icons/16/key.png" },
55 text = _"Login",
56 module = 'index',
57 view = 'login',
58 params = {
59 redirect_module = request.get_module(),
60 redirect_view = request.get_view(),
61 redirect_id = param.get_id()
62 }
63 }
64 ui.link{
65 image = { static = "icons/16/book_edit.png" },
66 text = _"Registration",
67 module = 'index',
68 view = 'register'
69 }
70 ui.link{
71 image = { static = "icons/16/key_forgot.png" },
72 text = _"Reset password",
73 module = 'index',
74 view = 'reset_password'
75 }
76 ui.link{
77 image = { static = "icons/16/information.png" },
78 text = _"About / Impressum",
79 module = 'index',
80 view = 'about'
81 }
82 else
84 ui.link{
85 image = { static = "icons/16/time.png" },
86 text = _"Timeline",
87 module = "timeline",
88 view = "index"
89 }
91 ui.link{
92 image = { static = "icons/16/group.png" },
93 text = _"Members",
94 module = 'member',
95 view = 'list',
96 params = { member_list = "newest" }
97 }
99 ui.link{
100 image = { static = "icons/16/book_edit.png" },
101 text = _"Contacts",
102 module = 'contact',
103 view = 'list'
104 }
106 ui.link{
107 image = { static = "icons/16/information.png" },
108 text = _"About",
109 module = 'index',
110 view = 'about'
111 }
113 if app.session.member.admin then
115 slot.put(" ")
117 ui.link{
118 attr = { class = { "admin_only" } },
119 image = { static = "icons/16/cog.png" },
120 text = _"Admin",
121 module = 'admin',
122 view = 'index'
123 }
125 end
126 end
128 end)
130 if config.app_logo then
131 slot.select("logo", function()
132 ui.image{ static = config.app_logo }
133 end)
134 end
136 execute.inner()

Impressum / About Us