liquid_feedback_frontend

annotate app/main/admin/index.lua @ 1450:2fbf95bee380

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

Impressum / About Us