# HG changeset patch # User bsw # Date 1539876791 -7200 # Node ID 6929d3ced0075cfce54aacd9313b68660854a0c4 # Parent 22a1a6711154e3336694be61dbe2ce82c39350be New layout for admin policy list view diff -r 22a1a6711154 -r 6929d3ced007 app/main/admin/policy_list.lua --- a/app/main/admin/policy_list.lua Thu Oct 18 17:31:19 2018 +0200 +++ b/app/main/admin/policy_list.lua Thu Oct 18 17:33:11 2018 +0200 @@ -5,56 +5,55 @@ ui.titleAdmin(_"Policy list") -ui.section( function() - ui.sectionHead( function() - ui.heading { level = 1, content = _"Policy list" } - end ) - - ui.sectionRow( function() +ui.grid{ content = function() - if show_not_in_use then - ui.link{ - text = _"Show policies in use", - module = "admin", - view = "policy_list" - } + ui.cell_main{ content = function() + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Policy list" } + end } + ui.container{ attr = { class = "mdl-card__content" }, content = function() + + if show_not_in_use then + ui.link{ + text = _"Show policies in use", + module = "admin", + view = "policy_list" + } - else - ui.link{ - text = _"Create new policy", - module = "admin", - view = "policy_show" - } - slot.put(" · ") - ui.link{ - text = _"Show policies not in use", - module = "admin", - view = "policy_list", - params = { show_not_in_use = true } - } + else + ui.link{ + text = _"Create new policy", + module = "admin", + view = "policy_show" + } + slot.put(" · ") + ui.link{ + text = _"Show policies not in use", + module = "admin", + view = "policy_list", + params = { show_not_in_use = true } + } - end - - end ) - - ui.sectionRow( function() + end - ui.list{ - records = policies, - columns = { + ui.list{ + records = policies, + columns = { - { content = function(record) - ui.link{ - text = record.name, - module = "admin", - view = "policy_show", - id = record.id + { content = function(record) + ui.link{ + text = record.name, + module = "admin", + view = "policy_show", + id = record.id + } + end } - end + + } } - - } - } - - end ) -end ) \ No newline at end of file + end } + end } + end } +end }