liquid_feedback_frontend
changeset 1446:b86558a65a20
New layout for admin index view
author | bsw |
---|---|
date | Thu Oct 18 17:11:15 2018 +0200 (2018-10-18) |
parents | 627ab8104582 |
children | 930fed8d0004 |
files | app/main/admin/index.lua |
line diff
1.1 --- a/app/main/admin/index.lua Thu Oct 18 13:21:27 2018 +0200 1.2 +++ b/app/main/admin/index.lua Thu Oct 18 17:11:15 2018 +0200 1.3 @@ -4,122 +4,11 @@ 1.4 1.5 local policies = Policy:build_selector{}:add_order_by("index"):exec() 1.6 1.7 -ui.titleAdmin() 1.8 - 1.9 -ui.sidebar( "tab-members", function() 1.10 - ui.sidebarHead( function() 1.11 - ui.heading { level = 2, content = _"Members" } 1.12 - end ) 1.13 - 1.14 - ui.sidebarSection( function() 1.15 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.16 - ui.tag { tag = "li", content = function() 1.17 - ui.form{ 1.18 - module = "admin", view = "member_list", 1.19 - content = function() 1.20 - 1.21 - ui.field.text{ label = _"search", name = "search" } 1.22 - 1.23 - ui.submit{ value = _"search" } 1.24 - 1.25 - end 1.26 - } 1.27 - end } 1.28 - end } 1.29 - end ) 1.30 - ui.sidebarSection( "moreLink", function() 1.31 - ui.link{ 1.32 - text = _"Register new member", 1.33 - module = "admin", 1.34 - view = "member_edit" 1.35 - } 1.36 - end ) 1.37 -end ) 1.38 - 1.39 -ui.sidebar( "tab-whatcanido", function() 1.40 - ui.sidebarHead( function() 1.41 - ui.heading { level = 2, content = _"Newsletter" } 1.42 - end ) 1.43 - 1.44 - ui.sidebarSection( "moreLink", function() 1.45 - ui.link{ 1.46 - text = _"Create a newsletter", 1.47 - module = "admin", 1.48 - view = "newsletter_edit" 1.49 - } 1.50 - end ) 1.51 - ui.sidebarSection( "moreLink", function() 1.52 - ui.link{ 1.53 - text = _"Manage newsletters", 1.54 - module = "admin", 1.55 - view = "newsletter_list" 1.56 - } 1.57 - end ) 1.58 -end ) 1.59 +ui.grid{ content = function() 1.60 1.61 -ui.sidebar( "tab-whatcanido", function() 1.62 - ui.sidebarHead( function() 1.63 - ui.heading { level = 2, content = _"Cancel issue" } 1.64 - end ) 1.65 - 1.66 - ui.sidebarSection( function() 1.67 - ui.form{ 1.68 - module = "admin", 1.69 - view = "cancel_issue", 1.70 - content = function() 1.71 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.72 - ui.tag { tag = "li", content = function() 1.73 - ui.field.text{ label = _"Issue #", name = "id" } 1.74 - ui.submit{ text = _"cancel issue" } 1.75 - end } 1.76 - end } 1.77 - end 1.78 - } 1.79 - end ) 1.80 -end ) 1.81 + ui.cell_main{ content = function() 1.82 1.83 -ui.sidebar("tab-whatcanido", function() 1.84 - ui.sidebarHead( function() 1.85 - ui.heading { level = 2, content = _"Policies" } 1.86 - end ) 1.87 - 1.88 - ui.sidebarSection( function() 1.89 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.90 - for i, policy in ipairs(policies) do 1.91 - ui.tag { tag = "li", content = function() 1.92 - ui.link{ 1.93 - content = policy.name, 1.94 - module = "admin", 1.95 - view = "policy_show", 1.96 - id = policy.id 1.97 - } 1.98 - end } 1.99 - end 1.100 - end } 1.101 - end ) 1.102 - ui.sidebarSection( "moreLink", function() 1.103 - ui.link{ 1.104 - text = _"Create new policy", 1.105 - module = "admin", 1.106 - view = "policy_show" 1.107 - } 1.108 - end ) 1.109 - ui.sidebarSection( "moreLink", function() 1.110 - ui.link{ 1.111 - text = _"Show policies not in use", 1.112 - module = "admin", 1.113 - view = "policy_list", 1.114 - params = { show_not_in_use = true } 1.115 - } 1.116 - end ) 1.117 -end ) 1.118 - 1.119 - 1.120 -ui.section( function() 1.121 - ui.sectionHead( function() 1.122 ui.heading { level = 1, content = _"Organizational units and subject areas" } 1.123 - end ) 1.124 - ui.sectionRow( function() 1.125 1.126 for i_unit, unit in ipairs(units) do 1.127 ui.container { 1.128 @@ -168,5 +57,109 @@ 1.129 ui.link { module = "admin", view = "index", content = _"Hide inactive" } 1.130 end 1.131 1.132 - end) 1.133 -end) 1.134 + end } 1.135 + 1.136 + ui.cell_sidebar{ content = function() 1.137 + 1.138 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.139 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.140 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Members" } 1.141 + end } 1.142 + ui.container{ attr = { class = "mdl-card__content" }, content = function() 1.143 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.144 + ui.tag { tag = "li", content = function() 1.145 + ui.form{ 1.146 + module = "admin", view = "member_list", 1.147 + content = function() 1.148 + 1.149 + ui.field.text{ label = _"search", name = "search" } 1.150 + 1.151 + ui.submit{ value = _"search" } 1.152 + 1.153 + end 1.154 + } 1.155 + end } 1.156 + end } 1.157 + ui.sidebarSection( "moreLink", function() 1.158 + ui.link{ 1.159 + text = _"Register new member", 1.160 + module = "admin", 1.161 + view = "member_edit" 1.162 + } 1.163 + end ) 1.164 + end } 1.165 + end } 1.166 + 1.167 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.168 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.169 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Newsletter" } 1.170 + end } 1.171 + ui.container{ attr = { class = "mdl-card__content" }, content = function() 1.172 + ui.link{ 1.173 + text = _"Create a newsletter", 1.174 + module = "admin", 1.175 + view = "newsletter_edit" 1.176 + } 1.177 + ui.link{ 1.178 + text = _"Manage newsletters", 1.179 + module = "admin", 1.180 + view = "newsletter_list" 1.181 + } 1.182 + end } 1.183 + end } 1.184 + 1.185 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.186 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.187 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Cancel issue" } 1.188 + end } 1.189 + ui.container{ attr = { class = "mdl-card__content" }, content = function() 1.190 + ui.form{ 1.191 + module = "admin", 1.192 + view = "cancel_issue", 1.193 + content = function() 1.194 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.195 + ui.tag { tag = "li", content = function() 1.196 + ui.field.text{ label = _"Issue #", name = "id" } 1.197 + ui.submit{ text = _"cancel issue" } 1.198 + end } 1.199 + end } 1.200 + end 1.201 + } 1.202 + end } 1.203 + end } 1.204 + 1.205 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.206 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.207 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Policies" } 1.208 + end } 1.209 + ui.container{ attr = { class = "mdl-card__content" }, content = function() 1.210 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function() 1.211 + for i, policy in ipairs(policies) do 1.212 + ui.tag { tag = "li", content = function() 1.213 + ui.link{ 1.214 + content = policy.name, 1.215 + module = "admin", 1.216 + view = "policy_show", 1.217 + id = policy.id 1.218 + } 1.219 + end } 1.220 + end 1.221 + end } 1.222 + 1.223 + ui.link{ 1.224 + text = _"Create new policy", 1.225 + module = "admin", 1.226 + view = "policy_show" 1.227 + } 1.228 + 1.229 + ui.link{ 1.230 + text = _"Show policies not in use", 1.231 + module = "admin", 1.232 + view = "policy_list", 1.233 + params = { show_not_in_use = true } 1.234 + } 1.235 + end } 1.236 + end } 1.237 +end } 1.238 + 1.239 +