liquid_feedback_frontend

annotate app/main/admin/index.lua @ 1447:930fed8d0004

Fixed missing closing end
author bsw
date Thu Oct 18 17:12:47 2018 +0200 (2018-10-18)
parents b86558a65a20
children 969d6aa521d6
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@1447 95 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Newsletter" }
bsw@1447 96 end }
bsw@1447 97 ui.container{ attr = { class = "mdl-card__content" }, content = function()
bsw@1447 98 ui.link{
bsw@1447 99 text = _"Create a newsletter",
bsw@1447 100 module = "admin",
bsw@1447 101 view = "newsletter_edit"
bsw@1447 102 }
bsw@1447 103 ui.link{
bsw@1447 104 text = _"Manage newsletters",
bsw@1447 105 module = "admin",
bsw@1447 106 view = "newsletter_list"
bsw@1447 107 }
bsw@1447 108 end }
bsw@1447 109 end }
bsw@1446 110
bsw@1447 111 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw@1447 112 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
bsw@1447 113 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Cancel issue" }
bsw@1447 114 end }
bsw@1447 115 ui.container{ attr = { class = "mdl-card__content" }, content = function()
bsw@1447 116 ui.form{
bsw@1447 117 module = "admin",
bsw@1447 118 view = "cancel_issue",
bsw@1447 119 content = function()
bsw@1447 120 ui.tag { tag = "ul", attr = { class = "ul" }, content = function()
bsw@1447 121 ui.tag { tag = "li", content = function()
bsw@1447 122 ui.field.text{ label = _"Issue #", name = "id" }
bsw@1447 123 ui.submit{ text = _"cancel issue" }
bsw@1447 124 end }
bsw@1447 125 end }
bsw@1447 126 end
bsw@1447 127 }
bsw@1447 128 end }
bsw@1447 129 end }
bsw@1446 130
bsw@1447 131 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw@1447 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 = _"Policies" }
bsw@1447 134 end }
bsw@1447 135 ui.container{ attr = { class = "mdl-card__content" }, content = function()
bsw@1447 136 ui.tag { tag = "ul", attr = { class = "ul" }, content = function()
bsw@1447 137 for i, policy in ipairs(policies) do
bsw@1447 138 ui.tag { tag = "li", content = function()
bsw@1447 139 ui.link{
bsw@1447 140 content = policy.name,
bsw@1447 141 module = "admin",
bsw@1447 142 view = "policy_show",
bsw@1447 143 id = policy.id
bsw@1447 144 }
bsw@1447 145 end }
bsw@1447 146 end
bsw@1447 147 end }
bsw@1447 148
bsw@1447 149 ui.link{
bsw@1447 150 text = _"Create new policy",
bsw@1447 151 module = "admin",
bsw@1447 152 view = "policy_show"
bsw@1447 153 }
bsw@1447 154
bsw@1447 155 ui.link{
bsw@1447 156 text = _"Show policies not in use",
bsw@1447 157 module = "admin",
bsw@1447 158 view = "policy_list",
bsw@1447 159 params = { show_not_in_use = true }
bsw@1447 160 }
bsw@1447 161 end }
bsw@1446 162 end }
bsw@1446 163 end }
bsw@1446 164 end }
bsw@1446 165
bsw@1446 166

Impressum / About Us