| 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@285
 | 
    17   ui.link{
 | 
| 
bsw@285
 | 
    18     content =  area.name,
 | 
| 
bsw@285
 | 
    19     module = "area", view = "show", id = area.id
 | 
| 
bsw@285
 | 
    20   }
 | 
| 
bsw@271
 | 
    21 
 | 
| 
bsw@265
 | 
    22   if not config.single_unit_id then
 | 
| 
bsw@271
 | 
    23     slot.put(" · ")
 | 
| 
bsw@265
 | 
    24     ui.link{
 | 
| 
bsw@265
 | 
    25       content = area.unit.name,
 | 
| 
bsw@301
 | 
    26       module = "unit",
 | 
| 
bsw@301
 | 
    27       view = "show",
 | 
| 
bsw@301
 | 
    28       id = area.unit_id
 | 
| 
bsw@265
 | 
    29     }
 | 
| 
bsw@265
 | 
    30   end
 | 
| 
bsw@197
 | 
    31 
 | 
| 
bsw@265
 | 
    32 
 | 
| 
bsw@265
 | 
    33 end)
 | 
| 
bsw/jbe@0
 | 
    34 
 | 
| 
bsw/jbe@0
 | 
    35 ui.container{
 | 
| 
bsw/jbe@0
 | 
    36   attr = { class = "vertical"},
 | 
| 
bsw/jbe@0
 | 
    37   content = function()
 | 
| 
bsw/jbe@0
 | 
    38     ui.field.text{ value = area.description }
 | 
| 
bsw/jbe@0
 | 
    39   end
 | 
| 
bsw/jbe@0
 | 
    40 }
 | 
| 
bsw/jbe@0
 | 
    41 
 | 
| 
bsw@197
 | 
    42 
 | 
| 
bsw@51
 | 
    43 if app.session.member_id then
 | 
| 
bsw@271
 | 
    44   execute.view{
 | 
| 
bsw@271
 | 
    45     module = "membership",
 | 
| 
bsw@271
 | 
    46     view = "_show_box",
 | 
| 
bsw@271
 | 
    47     params = { area = area }
 | 
| 
bsw@271
 | 
    48   }
 | 
| 
bsw@271
 | 
    49 
 | 
| 
bsw@271
 | 
    50   execute.view{
 | 
| 
bsw@271
 | 
    51     module = "delegation",
 | 
| 
bsw@271
 | 
    52     view = "_show_box",
 | 
| 
bsw@271
 | 
    53     params = { area_id = area.id }
 | 
| 
bsw@271
 | 
    54   }
 | 
| 
bsw@197
 | 
    55 
 | 
| 
bsw@281
 | 
    56   if app.session.member:has_voting_right_for_unit_id(area.unit_id) then
 | 
| 
bsw@281
 | 
    57     slot.select("actions", function()
 | 
| 
bsw@281
 | 
    58       ui.link{
 | 
| 
bsw@281
 | 
    59         content = function()
 | 
| 
bsw@281
 | 
    60           ui.image{ static = "icons/16/folder_add.png" }
 | 
| 
bsw@281
 | 
    61           slot.put(_"Create new issue")
 | 
| 
bsw@281
 | 
    62         end,
 | 
| 
bsw@281
 | 
    63         module = "initiative",
 | 
| 
bsw@281
 | 
    64         view = "new",
 | 
| 
bsw@281
 | 
    65         params = { area_id = area.id }
 | 
| 
bsw@281
 | 
    66       }
 | 
| 
bsw@281
 | 
    67     end)
 | 
| 
bsw@281
 | 
    68   end
 | 
| 
bsw/jbe@0
 | 
    69 
 | 
| 
bsw@51
 | 
    70 
 | 
| 
bsw@51
 | 
    71 end
 | 
| 
bsw/jbe@0
 | 
    72 
 | 
| 
bsw@277
 | 
    73 if app.session.member then
 | 
| 
bsw@277
 | 
    74   execute.view{
 | 
| 
bsw@277
 | 
    75     module = "area",
 | 
| 
bsw@277
 | 
    76     view = "show_tab",
 | 
| 
bsw@277
 | 
    77     params = { area = area }
 | 
| 
bsw@277
 | 
    78   }
 | 
| 
bsw@277
 | 
    79 else
 | 
| 
bsw@277
 | 
    80   execute.view{
 | 
| 
bsw@277
 | 
    81     module = "issue",
 | 
| 
bsw@277
 | 
    82     view = "_list",
 | 
| 
bsw@277
 | 
    83     params = {
 | 
| 
bsw@277
 | 
    84       issues_selector = area:get_reference_selector("issues"),
 | 
| 
bsw@277
 | 
    85       filter = cgi.params["filter"],
 | 
| 
bsw@277
 | 
    86       filter_voting = param.get("filter_voting"),
 | 
| 
bsw@277
 | 
    87       for_area_list = true
 | 
| 
bsw@277
 | 
    88     }
 | 
| 
bsw@277
 | 
    89   }
 | 
| 
bsw@277
 | 
    90 end
 |