liquid_feedback_frontend

annotate app/main/admin/index.lua @ 1448:969d6aa521d6

Changed order in admin sidebar, added whitespace between links
author bsw
date Thu Oct 18 17:13:59 2018 +0200 (2018-10-18)
parents 930fed8d0004
children f27790f617c9
rev   line source
bsw@1184 1 local inactive = param.get("inactive", atom.boolean)
bsw@1184 2
bsw@1184 3 local units = Unit:get_flattened_tree{ include_inactive = inactive }
bsw@1184 4
bsw@1045 5 local policies = Policy:build_selector{}:add_order_by("index"):exec()
bsw@1045 6
bsw@1446 7 ui.grid{ content = function()
bsw@1248 8
bsw@1446 9 ui.cell_main{ content = function()
bsw@1045 10
bsw@1045 11 ui.heading { level = 1, content = _"Organizational units and subject areas" }
bsw@1007 12
bsw@1045 13 for i_unit, unit in ipairs(units) do
bsw@1045 14 ui.container {
bsw@1045 15 attr = { style = "margin-left: " .. ((unit.depth - 1)* 2) .. "em;" },
bsw@1045 16 content = function ()
bsw@1045 17 ui.heading { level = 1, content = function ()
bsw@1184 18 local class
bsw@1184 19 if unit.active == false then
bsw@1184 20 class = "inactive"
bsw@1184 21 end
bsw@1184 22 ui.link{ attr = { class = class }, text = unit.name, module = "admin", view = "unit_edit", id = unit.id }
bsw@1045 23 end }
bsw@1045 24 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw@1184 25 local areas
bsw@1184 26 if not inactive then
bsw@1184 27 areas = unit:get_reference_selector("areas"):add_order_by("name"):add_where("active"):exec()
bsw@1184 28 else
bsw@1184 29 areas = unit:get_reference_selector("areas"):add_order_by("name"):exec()
bsw@1184 30 end
bsw@1184 31 for i, area in ipairs(areas) do
bsw@1045 32 ui.tag { tag = "li", content = function ()
bsw@1184 33 local class
bsw@1184 34 if area.active == false then
bsw@1184 35 class = "inactive"
bsw@1184 36 end
bsw@1184 37 ui.link{ attr = { class = class }, text = area.name, module = "admin", view = "area_show", id = area.id }
bsw@1045 38 end }
bsw@1045 39 end
bsw@1045 40 ui.tag { tag = "li", content = function ()
bsw@1045 41 ui.link { module = "admin", view = "area_show", params = { unit_id = unit.id }, content = _"+ add new subject area" }
bsw@1045 42 end }
bsw@1045 43 slot.put("<br />")
bsw@1045 44 end }
bsw@1045 45 end
bsw@1045 46 }
bsw@1045 47 end
bsw@1045 48
bsw@1045 49 slot.put("<br />")
bsw@1185 50 ui.link { module = "admin", view = "unit_edit", content = _"Create new unit" }
bsw@1184 51 slot.put("<br />")
bsw@1184 52 slot.put("<br />")
bsw@1184 53
bsw@1184 54 if (not inactive) then
bsw@1184 55 ui.link { module = "admin", view = "index", params = { inactive = true }, content = _"Show inactive" }
bsw@1184 56 else
bsw@1184 57 ui.link { module = "admin", view = "index", content = _"Hide inactive" }
bsw@1184 58 end
bsw@1045 59
bsw@1446 60 end }
bsw@1446 61
bsw@1446 62 ui.cell_sidebar{ content = function()
bsw@1446 63
bsw@1447 64 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw@1447 65 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
bsw@1447 66 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Members" }
bsw@1446 67 end }
bsw@1447 68 ui.container{ attr = { class = "mdl-card__content" }, content = function()
bsw@1447 69 ui.tag { tag = "ul", attr = { class = "ul" }, content = function()
bsw@1446 70 ui.tag { tag = "li", content = function()
bsw@1447 71 ui.form{
bsw@1447 72 module = "admin", view = "member_list",
bsw@1447 73 content = function()
bsw@1447 74
bsw@1447 75 ui.field.text{ label = _"search", name = "search" }
bsw@1447 76
bsw@1447 77 ui.submit{ value = _"search" }
bsw@1447 78
bsw@1447 79 end
bsw@1446 80 }
bsw@1446 81 end }
bsw@1447 82 end }
bsw@1447 83 ui.sidebarSection( "moreLink", function()
bsw@1447 84 ui.link{
bsw@1447 85 text = _"Register new member",
bsw@1447 86 module = "admin",
bsw@1447 87 view = "member_edit"
bsw@1447 88 }
bsw@1447 89 end )
bsw@1446 90 end }
bsw@1447 91 end }
bsw@1447 92
bsw@1447 93 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw@1447 94 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
bsw@1448 95 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Policies" }
bsw@1448 96 end }
bsw@1448 97 ui.container{ attr = { class = "mdl-card__content" }, content = function()
bsw@1448 98 ui.tag { tag = "ul", attr = { class = "ul" }, content = function()
bsw@1448 99 for i, policy in ipairs(policies) do
bsw@1448 100 ui.tag { tag = "li", content = function()
bsw@1448 101 ui.link{
bsw@1448 102 content = policy.name,
bsw@1448 103 module = "admin",
bsw@1448 104 view = "policy_show",
bsw@1448 105 id = policy.id
bsw@1448 106 }
bsw@1448 107 end }
bsw@1448 108 end
bsw@1448 109 end }
bsw@1448 110
bsw@1448 111 ui.link{
bsw@1448 112 text = _"Create new policy",
bsw@1448 113 module = "admin",
bsw@1448 114 view = "policy_show"
bsw@1448 115 }
bsw@1448 116 slot.put(" &nbsp; ")
bsw@1448 117 ui.link{
bsw@1448 118 text = _"Show policies not in use",
bsw@1448 119 module = "admin",
bsw@1448 120 view = "policy_list",
bsw@1448 121 params = { show_not_in_use = true }
bsw@1448 122 }
bsw@1448 123 end }
bsw@1448 124 end }
bsw@1448 125
bsw@1448 126 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw@1448 127 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
bsw@1447 128 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Newsletter" }
bsw@1447 129 end }
bsw@1447 130 ui.container{ attr = { class = "mdl-card__content" }, content = function()
bsw@1447 131 ui.link{
bsw@1447 132 text = _"Create a newsletter",
bsw@1447 133 module = "admin",
bsw@1447 134 view = "newsletter_edit"
bsw@1447 135 }
bsw@1448 136 slot.put(" &nbsp; ")
bsw@1447 137 ui.link{
bsw@1447 138 text = _"Manage newsletters",
bsw@1447 139 module = "admin",
bsw@1447 140 view = "newsletter_list"
bsw@1447 141 }
bsw@1447 142 end }
bsw@1447 143 end }
bsw@1446 144
bsw@1447 145 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw@1447 146 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
bsw@1447 147 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Cancel issue" }
bsw@1447 148 end }
bsw@1447 149 ui.container{ attr = { class = "mdl-card__content" }, content = function()
bsw@1447 150 ui.form{
bsw@1447 151 module = "admin",
bsw@1447 152 view = "cancel_issue",
bsw@1447 153 content = function()
bsw@1447 154 ui.tag { tag = "ul", attr = { class = "ul" }, content = function()
bsw@1447 155 ui.tag { tag = "li", content = function()
bsw@1447 156 ui.field.text{ label = _"Issue #", name = "id" }
bsw@1447 157 ui.submit{ text = _"cancel issue" }
bsw@1447 158 end }
bsw@1447 159 end }
bsw@1447 160 end
bsw@1447 161 }
bsw@1447 162 end }
bsw@1447 163 end }
bsw@1446 164
bsw@1446 165 end }
bsw@1446 166 end }
bsw@1446 167
bsw@1446 168

Impressum / About Us