liquid_feedback_frontend
view app/main/area/show.lua @ 51:0849be391140
Public read access; Read-only API for initiatives; Prepared integration of OpenID
author | bsw |
---|---|
date | Sun Apr 04 22:05:11 2010 +0200 (2010-04-04) |
parents | 00d1004545f1 |
children | 88ac7798b562 |
line source
1 local area = Area:new_selector():add_where{ "id = ?", param.get_id() }:single_object_mode():exec()
3 slot.put_into("title", encode.html(_"Area '#{name}'":gsub("#{name}", area.name)))
5 ui.container{
6 attr = { class = "vertical"},
7 content = function()
8 ui.field.text{ value = area.description }
9 end
10 }
12 if app.session.member_id then
13 slot.select("actions", function()
14 ui.link{
15 content = function()
16 ui.image{ static = "icons/16/folder_add.png" }
17 slot.put(_"Create new issue")
18 end,
19 module = "initiative",
20 view = "new",
21 params = { area_id = area.id }
22 }
23 end)
24 end
26 util.help("area.show")
28 if app.session.member_id then
29 execute.view{
30 module = "membership",
31 view = "_show_box",
32 params = { area = area }
33 }
35 execute.view{
36 module = "delegation",
37 view = "_show_box",
38 params = { area_id = area.id }
39 }
41 end
43 --[[
44 for i, issue in ipairs(area.issues) do
45 local head_name = "issue_head_content_" .. tostring(issue.id)
46 local name = "issue_content_" .. tostring(issue.id)
47 local icon_name = "issue_icon_" .. tostring(issue.id)
48 ui.container{
49 attr = { class = "ui_tabs" },
50 content = function()
51 local onclick =
52 'if (ui_tabs_active["' .. name .. '"]) {' ..
53 'el=document.getElementById("' .. name .. '");' ..
54 'el.innerHTML="";' ..
55 'el.style.display="none";' ..
56 'ui_tabs_active["' .. name .. '"]=false' ..
57 '} else {' ..
58 'ui_tabs_active["' .. name .. '"]=true;' ..
59 'document.getElementById("' .. name .. '").style.display="block"; ' ..
60 'var hourglass_el = document.getElementById("' .. icon_name .. '");' ..
61 'var hourglass_src = hourglass_el.src;' ..
62 'hourglass_el.src = "' .. encode.url{ static = "icons/16/connect.png" } .. '";' ..
63 'partialMultiLoad(' ..
64 '{ trace: "trace", system_error: "system_error", ' .. name .. '_title: "title", ' .. name .. '_actions: "actions", ' .. name .. '_content: "default" },' ..
65 '{},' ..
66 '"error",' ..
67 '"' .. request.get_relative_baseurl() .. 'issue/show/' .. tostring(issue.id) .. '.html?&_webmcp_json_slots[]=title&_webmcp_json_slots[]=actions&_webmcp_json_slots[]=default&_webmcp_json_slots[]=trace&_webmcp_json_slots[]=system_error&dyn=1",' ..
68 '{},' ..
69 '{},' ..
70 'function() {' ..
71 'hourglass_el.src = hourglass_src;' ..
72 '},' ..
73 'function() {' ..
74 'hourglass_el.src = hourglass_src;' ..
75 '}' ..
76 '); ' ..
77 '}' ..
78 'return(false);'
79 ui.link{
80 attr = {
81 name = name,
82 class = "ui_tabs_accordeon_head",
83 id = head_name,
84 onclick = onclick,
85 },
86 module = "issue",
87 view = "show",
88 id = issue.id,
89 params = params,
90 anchor = name,
91 content = function()
92 ui.image{
93 attr = { id = icon_name },
94 static = "icons/16/script.png"
95 }
96 ui.container{
97 attr = { style = "float: right;" },
98 content = function()
100 end
101 }
102 slot.put(tostring(issue.id))
103 end
104 }
105 end
106 }
108 ui.container{
109 attr = {
110 id = name,
111 class = "ui_tabs_accordeon_content",
112 },
113 content = function()
114 ui.container{ attr = { id = name .. "_title", }, content = function() slot.put(" ") end }
115 ui.container{ attr = { id = name .. "_actions", }, content = function() slot.put(" ") end }
116 ui.container{ attr = { id = name .. "_content", }, content = function()
117 execute.view{
118 module = "initiative",
119 view = "_list",
120 params = {
121 issue = issue,
122 initiatives_selector = issue:get_reference_selector("initiatives"),
123 limit = 3,
124 per_page = 3,
125 no_sort = true,
126 }
127 }
128 end }
129 end
130 }
132 if config.user_tab_mode == "accordeon_all_expanded" then
133 ui.script{ script = 'document.getElementById("' .. head_name .. '").onclick();' }
134 end
135 end
136 --]]
138 execute.view{
139 module = "area",
140 view = "show_tab",
141 params = { area = area }
142 }