| rev | 
   line source | 
| 
bsw@1045
 | 
     1 local units = Unit:get_flattened_tree{ active = true }
 | 
| 
bsw@1045
 | 
     2 local policies = Policy:build_selector{}:add_order_by("index"):exec()
 | 
| 
bsw@1045
 | 
     3 
 | 
| 
bsw@1045
 | 
     4 slot.put_into("title", _"Manage system settings")
 | 
| 
bsw/jbe@0
 | 
     5 
 | 
| 
bsw@1045
 | 
     6 ui.sidebar( "tab-members", function()
 | 
| 
bsw@1045
 | 
     7   ui.sidebarHead( function()
 | 
| 
bsw@1045
 | 
     8     ui.heading { level = 2, content = _"Members" }
 | 
| 
bsw@1045
 | 
     9   end )
 | 
| 
bsw@1045
 | 
    10   
 | 
| 
bsw@1045
 | 
    11   ui.sidebarSection( function()
 | 
| 
bsw@1045
 | 
    12     ui.tag { tag = "ul", attr = { class = "ul" }, content = function()
 | 
| 
bsw@1045
 | 
    13       ui.tag { tag = "li", content = function()
 | 
| 
bsw@1045
 | 
    14         ui.form{
 | 
| 
bsw@1045
 | 
    15           module = "admin", view = "member_list",
 | 
| 
bsw@1045
 | 
    16           content = function()
 | 
| 
bsw@1045
 | 
    17           
 | 
| 
bsw@1045
 | 
    18             ui.field.text{ label = _"search", name = "search" }
 | 
| 
bsw@1045
 | 
    19             
 | 
| 
bsw@1045
 | 
    20             ui.submit{ value = _"search" }
 | 
| 
bsw@1045
 | 
    21           
 | 
| 
bsw@1045
 | 
    22           end
 | 
| 
bsw@1045
 | 
    23         }
 | 
| 
bsw@1045
 | 
    24       end }
 | 
| 
bsw@1045
 | 
    25     end }
 | 
| 
bsw@1045
 | 
    26   end )
 | 
| 
bsw@1045
 | 
    27   ui.sidebarSection( "moreLink", function()
 | 
| 
bsw@1045
 | 
    28     ui.link{
 | 
| 
bsw@1045
 | 
    29       text = _"Register new member",
 | 
| 
bsw@1045
 | 
    30       module = "admin",
 | 
| 
bsw@1045
 | 
    31       view = "member_edit"
 | 
| 
bsw@1045
 | 
    32     }
 | 
| 
bsw@1045
 | 
    33   end )
 | 
| 
bsw@1045
 | 
    34 end )
 | 
| 
bsw/jbe@0
 | 
    35 
 | 
| 
bsw@1045
 | 
    36 ui.sidebar( "tab-whatcanido", function()
 | 
| 
bsw@1045
 | 
    37   ui.sidebarHead( function()
 | 
| 
bsw@1045
 | 
    38     ui.heading { level = 2, content = _"Cancel issue" }
 | 
| 
bsw@1045
 | 
    39   end )
 | 
| 
bsw@1045
 | 
    40   
 | 
| 
bsw@1045
 | 
    41   ui.sidebarSection( function()
 | 
| 
bsw@1045
 | 
    42     ui.form{
 | 
| 
bsw@1045
 | 
    43       module = "admin",
 | 
| 
bsw@1045
 | 
    44       view = "cancel_issue",
 | 
| 
bsw@1045
 | 
    45       content = function()
 | 
| 
bsw@1045
 | 
    46         ui.tag { tag = "ul", attr = { class = "ul" }, content = function()
 | 
| 
bsw@1045
 | 
    47           ui.tag { tag = "li", content = function()
 | 
| 
bsw@1045
 | 
    48             ui.field.text{ label = _"Issue #", name = "id" }
 | 
| 
bsw@1045
 | 
    49             ui.submit{ text = _"cancel issue" }
 | 
| 
bsw@1045
 | 
    50           end }
 | 
| 
bsw@1045
 | 
    51         end }
 | 
| 
bsw@1045
 | 
    52       end
 | 
| 
bsw@1045
 | 
    53     }
 | 
| 
bsw@1045
 | 
    54   end )
 | 
| 
bsw@1045
 | 
    55 end )
 | 
| 
bsw@1045
 | 
    56 
 | 
| 
bsw@1045
 | 
    57 ui.sidebar("tab-whatcanido", function()
 | 
| 
bsw@1045
 | 
    58   ui.sidebarHead( function()
 | 
| 
bsw@1045
 | 
    59     ui.heading { level = 2, content = _"Policies" }
 | 
| 
bsw@1045
 | 
    60   end )
 | 
| 
bsw@1045
 | 
    61   
 | 
| 
bsw@1045
 | 
    62   ui.sidebarSection( function()
 | 
| 
bsw@1045
 | 
    63     ui.tag { tag = "ul", attr = { class = "ul" }, content = function()
 | 
| 
bsw@1045
 | 
    64       for i, policy in ipairs(policies) do
 | 
| 
bsw@1045
 | 
    65         ui.tag { tag = "li", content = function()
 | 
| 
bsw@1045
 | 
    66           ui.link{
 | 
| 
bsw@1045
 | 
    67             content = policy.name,
 | 
| 
bsw@1045
 | 
    68             module = "admin",
 | 
| 
bsw@1045
 | 
    69             view = "policy_show",
 | 
| 
bsw@1045
 | 
    70             id = policy.id
 | 
| 
bsw@1045
 | 
    71           }
 | 
| 
bsw@1045
 | 
    72         end }
 | 
| 
bsw@1045
 | 
    73       end
 | 
| 
bsw@1045
 | 
    74     end }
 | 
| 
bsw@1045
 | 
    75   end )
 | 
| 
bsw@1045
 | 
    76   ui.sidebarSection( "moreLink", function()
 | 
| 
bsw@371
 | 
    77     ui.link{
 | 
| 
bsw@1045
 | 
    78       text = _"Create new policy",
 | 
| 
bsw@1045
 | 
    79       module = "admin",
 | 
| 
bsw@1045
 | 
    80       view = "policy_show"
 | 
| 
bsw@1045
 | 
    81     }
 | 
| 
bsw@1045
 | 
    82   end )
 | 
| 
bsw@1045
 | 
    83   ui.sidebarSection( "moreLink", function()
 | 
| 
bsw@1045
 | 
    84     ui.link{
 | 
| 
bsw@1045
 | 
    85       text = _"Show policies not in use",
 | 
| 
bsw@371
 | 
    86       module = "admin",
 | 
| 
bsw@371
 | 
    87       view = "policy_list",
 | 
| 
bsw@1045
 | 
    88       params = { show_not_in_use = true }
 | 
| 
bsw@371
 | 
    89     }
 | 
| 
bsw@1045
 | 
    90   end )
 | 
| 
bsw@1045
 | 
    91 end )
 | 
| 
bsw@1045
 | 
    92 
 | 
| 
bsw@1045
 | 
    93 
 | 
| 
bsw@1045
 | 
    94 ui.section( function()
 | 
| 
bsw@1045
 | 
    95   ui.sectionHead( function()
 | 
| 
bsw@1045
 | 
    96     ui.heading { level = 1, content = _"Organizational units and subject areas" }
 | 
| 
bsw@1045
 | 
    97   end )
 | 
| 
bsw@1045
 | 
    98   ui.sectionRow( function()
 | 
| 
bsw@1007
 | 
    99 
 | 
| 
bsw@1045
 | 
   100     for i_unit, unit in ipairs(units) do
 | 
| 
bsw@1045
 | 
   101       ui.container { 
 | 
| 
bsw@1045
 | 
   102         attr = { style = "margin-left: " .. ((unit.depth - 1)* 2) .. "em;" },
 | 
| 
bsw@1045
 | 
   103         content = function ()
 | 
| 
bsw@1045
 | 
   104           ui.heading { level = 1, content = function ()
 | 
| 
bsw@1045
 | 
   105             ui.link{ text = unit.name, module = "admin", view = "unit_edit", id = unit.id }
 | 
| 
bsw@1045
 | 
   106           end }
 | 
| 
bsw@1045
 | 
   107           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw@1045
 | 
   108             for i, area in ipairs(unit:get_reference_selector("areas"):add_order_by("name"):exec()) do
 | 
| 
bsw@1045
 | 
   109               ui.tag { tag = "li", content = function ()
 | 
| 
bsw@1045
 | 
   110                 ui.link{ text = area.name, module = "admin", view = "area_show", id = area.id }
 | 
| 
bsw@1045
 | 
   111               end }
 | 
| 
bsw@1045
 | 
   112             end
 | 
| 
bsw@1045
 | 
   113             ui.tag { tag = "li", content = function ()
 | 
| 
bsw@1045
 | 
   114               ui.link { module = "admin", view = "area_show", params = { unit_id = unit.id }, content = _"+ add new subject area" }
 | 
| 
bsw@1045
 | 
   115             end }
 | 
| 
bsw@1045
 | 
   116             slot.put("<br />")
 | 
| 
bsw@1045
 | 
   117           end }
 | 
| 
bsw@1045
 | 
   118         end
 | 
| 
bsw@1045
 | 
   119       }
 | 
| 
bsw@1045
 | 
   120     end
 | 
| 
bsw@1045
 | 
   121     
 | 
| 
bsw@1045
 | 
   122     slot.put("<br />")
 | 
| 
bsw@1045
 | 
   123     ui.link { module = "admin", view = "unit_edit", content = _"+ add new organizational unit" }
 | 
| 
bsw@1045
 | 
   124       
 | 
| 
bsw@1045
 | 
   125   end)
 | 
| 
bsw@1045
 | 
   126 end)
 |