liquid_feedback_frontend
diff app/main/admin/index.lua @ 1045:701a5cf6b067
Imported LiquidFeedback Frontend 3.0 branch
author | bsw |
---|---|
date | Thu Jul 10 01:19:48 2014 +0200 (2014-07-10) |
parents | c547d1cce741 |
children | 8c65f5a029b0 |
line diff
1.1 --- a/app/main/admin/index.lua Thu Jul 10 01:02:43 2014 +0200 1.2 +++ b/app/main/admin/index.lua Thu Jul 10 01:19:48 2014 +0200 1.3 @@ -1,34 +1,126 @@ 1.4 -slot.put_into("title", _"Admin menu") 1.5 +local units = Unit:get_flattened_tree{ active = true } 1.6 +local policies = Policy:build_selector{}:add_order_by("index"):exec() 1.7 + 1.8 +slot.put_into("title", _"Manage system settings") 1.9 1.10 +ui.sidebar( "tab-members", function() 1.11 + ui.sidebarHead( function() 1.12 + ui.heading { level = 2, content = _"Members" } 1.13 + end ) 1.14 + 1.15 + ui.sidebarSection( function() 1.16 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.17 + ui.tag { tag = "li", content = function() 1.18 + ui.form{ 1.19 + module = "admin", view = "member_list", 1.20 + content = function() 1.21 + 1.22 + ui.field.text{ label = _"search", name = "search" } 1.23 + 1.24 + ui.submit{ value = _"search" } 1.25 + 1.26 + end 1.27 + } 1.28 + end } 1.29 + end } 1.30 + end ) 1.31 + ui.sidebarSection( "moreLink", function() 1.32 + ui.link{ 1.33 + text = _"Register new member", 1.34 + module = "admin", 1.35 + view = "member_edit" 1.36 + } 1.37 + end ) 1.38 +end ) 1.39 1.40 -ui.tag{ tag = "ul", content = function() 1.41 - ui.tag{ tag= "li", content = function() 1.42 +ui.sidebar( "tab-whatcanido", function() 1.43 + ui.sidebarHead( function() 1.44 + ui.heading { level = 2, content = _"Cancel issue" } 1.45 + end ) 1.46 + 1.47 + ui.sidebarSection( function() 1.48 + ui.form{ 1.49 + module = "admin", 1.50 + view = "cancel_issue", 1.51 + content = function() 1.52 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.53 + ui.tag { tag = "li", content = function() 1.54 + ui.field.text{ label = _"Issue #", name = "id" } 1.55 + ui.submit{ text = _"cancel issue" } 1.56 + end } 1.57 + end } 1.58 + end 1.59 + } 1.60 + end ) 1.61 +end ) 1.62 + 1.63 +ui.sidebar("tab-whatcanido", function() 1.64 + ui.sidebarHead( function() 1.65 + ui.heading { level = 2, content = _"Policies" } 1.66 + end ) 1.67 + 1.68 + ui.sidebarSection( function() 1.69 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.70 + for i, policy in ipairs(policies) do 1.71 + ui.tag { tag = "li", content = function() 1.72 + ui.link{ 1.73 + content = policy.name, 1.74 + module = "admin", 1.75 + view = "policy_show", 1.76 + id = policy.id 1.77 + } 1.78 + end } 1.79 + end 1.80 + end } 1.81 + end ) 1.82 + ui.sidebarSection( "moreLink", function() 1.83 ui.link{ 1.84 - text = _"Policies", 1.85 + text = _"Create new policy", 1.86 + module = "admin", 1.87 + view = "policy_show" 1.88 + } 1.89 + end ) 1.90 + ui.sidebarSection( "moreLink", function() 1.91 + ui.link{ 1.92 + text = _"Show policies not in use", 1.93 module = "admin", 1.94 view = "policy_list", 1.95 - } 1.96 - end } 1.97 - ui.tag{ tag= "li", content = function() 1.98 - ui.link{ 1.99 - text = _"Units", 1.100 - module = "admin", 1.101 - view = "unit_list", 1.102 + params = { show_not_in_use = true } 1.103 } 1.104 - end } 1.105 - ui.tag{ tag= "li", content = function() 1.106 - ui.link{ 1.107 - text = _"Members", 1.108 - module = "admin", 1.109 - view = "member_list", 1.110 - } 1.111 - end } 1.112 - ui.tag{ tag= "li", content = function() 1.113 - ui.link{ 1.114 - text = _"Cancel issue", 1.115 - module = "admin", 1.116 - view = "cancel_issue", 1.117 - } 1.118 - end } 1.119 -end } 1.120 + end ) 1.121 +end ) 1.122 + 1.123 + 1.124 +ui.section( function() 1.125 + ui.sectionHead( function() 1.126 + ui.heading { level = 1, content = _"Organizational units and subject areas" } 1.127 + end ) 1.128 + ui.sectionRow( function() 1.129 1.130 + for i_unit, unit in ipairs(units) do 1.131 + ui.container { 1.132 + attr = { style = "margin-left: " .. ((unit.depth - 1)* 2) .. "em;" }, 1.133 + content = function () 1.134 + ui.heading { level = 1, content = function () 1.135 + ui.link{ text = unit.name, module = "admin", view = "unit_edit", id = unit.id } 1.136 + end } 1.137 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.138 + for i, area in ipairs(unit:get_reference_selector("areas"):add_order_by("name"):exec()) do 1.139 + ui.tag { tag = "li", content = function () 1.140 + ui.link{ text = area.name, module = "admin", view = "area_show", id = area.id } 1.141 + end } 1.142 + end 1.143 + ui.tag { tag = "li", content = function () 1.144 + ui.link { module = "admin", view = "area_show", params = { unit_id = unit.id }, content = _"+ add new subject area" } 1.145 + end } 1.146 + slot.put("<br />") 1.147 + end } 1.148 + end 1.149 + } 1.150 + end 1.151 + 1.152 + slot.put("<br />") 1.153 + ui.link { module = "admin", view = "unit_edit", content = _"+ add new organizational unit" } 1.154 + 1.155 + end) 1.156 +end)