rev |
line source |
bsw@197
|
1 local area = Area:by_id(param.get_id())
|
bsw@197
|
2
|
bsw/jbe@0
|
3
|
jorges@103
|
4 app.html_title.title = area.name
|
jorges@103
|
5 app.html_title.subtitle = _("Area")
|
jorges@103
|
6
|
bsw@197
|
7 util.help("area.show")
|
bsw@197
|
8
|
bsw@197
|
9
|
bsw/jbe@52
|
10 if config.feature_rss_enabled then
|
bsw/jbe@52
|
11 util.html_rss_head{ title = _"Initiatives in this area (last created first)", module = "initiative", view = "list_rss", params = { area_id = area.id } }
|
bsw/jbe@52
|
12 util.html_rss_head{ title = _"Initiatives in this area (last updated first)", module = "initiative", view = "list_rss", params = { area_id = area.id } }
|
bsw/jbe@52
|
13 end
|
bsw/jbe@52
|
14
|
bsw@197
|
15
|
bsw@265
|
16 slot.select("title", function()
|
bsw@271
|
17 ui.tag{ content = area.name }
|
bsw@271
|
18
|
bsw@265
|
19 if not config.single_unit_id then
|
bsw@271
|
20 slot.put(" · ")
|
bsw@265
|
21 ui.link{
|
bsw@265
|
22 content = area.unit.name,
|
bsw@265
|
23 module = "area",
|
bsw@265
|
24 view = "list",
|
bsw@265
|
25 params = { unit_id = area.unit_id }
|
bsw@265
|
26 }
|
bsw@265
|
27 end
|
bsw@197
|
28
|
bsw@265
|
29
|
bsw@265
|
30 end)
|
bsw/jbe@0
|
31
|
bsw/jbe@0
|
32 ui.container{
|
bsw/jbe@0
|
33 attr = { class = "vertical"},
|
bsw/jbe@0
|
34 content = function()
|
bsw/jbe@0
|
35 ui.field.text{ value = area.description }
|
bsw/jbe@0
|
36 end
|
bsw/jbe@0
|
37 }
|
bsw/jbe@0
|
38
|
bsw@197
|
39
|
bsw@51
|
40 if app.session.member_id then
|
bsw@271
|
41 execute.view{
|
bsw@271
|
42 module = "membership",
|
bsw@271
|
43 view = "_show_box",
|
bsw@271
|
44 params = { area = area }
|
bsw@271
|
45 }
|
bsw@271
|
46
|
bsw@271
|
47 execute.view{
|
bsw@271
|
48 module = "delegation",
|
bsw@271
|
49 view = "_show_box",
|
bsw@271
|
50 params = { area_id = area.id }
|
bsw@271
|
51 }
|
bsw@197
|
52
|
bsw@281
|
53 if app.session.member:has_voting_right_for_unit_id(area.unit_id) then
|
bsw@281
|
54 slot.select("actions", function()
|
bsw@281
|
55 ui.link{
|
bsw@281
|
56 content = function()
|
bsw@281
|
57 ui.image{ static = "icons/16/folder_add.png" }
|
bsw@281
|
58 slot.put(_"Create new issue")
|
bsw@281
|
59 end,
|
bsw@281
|
60 module = "initiative",
|
bsw@281
|
61 view = "new",
|
bsw@281
|
62 params = { area_id = area.id }
|
bsw@281
|
63 }
|
bsw@281
|
64 end)
|
bsw@281
|
65 end
|
bsw/jbe@0
|
66
|
bsw@51
|
67
|
bsw@51
|
68 end
|
bsw/jbe@0
|
69
|
bsw@277
|
70 if app.session.member then
|
bsw@277
|
71 execute.view{
|
bsw@277
|
72 module = "area",
|
bsw@277
|
73 view = "show_tab",
|
bsw@277
|
74 params = { area = area }
|
bsw@277
|
75 }
|
bsw@277
|
76 else
|
bsw@277
|
77 execute.view{
|
bsw@277
|
78 module = "issue",
|
bsw@277
|
79 view = "_list",
|
bsw@277
|
80 params = {
|
bsw@277
|
81 issues_selector = area:get_reference_selector("issues"),
|
bsw@277
|
82 filter = cgi.params["filter"],
|
bsw@277
|
83 filter_voting = param.get("filter_voting"),
|
bsw@277
|
84 for_area_list = true
|
bsw@277
|
85 }
|
bsw@277
|
86 }
|
bsw@277
|
87 end
|