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