liquid_feedback_frontend

diff app/main/admin/unit_edit.lua @ 1468:9a01089a6703

New layout for admin unit and area view
author bsw
date Thu Oct 18 17:40:09 2018 +0200 (2018-10-18)
parents 32cc544d5a5b
children 914611dc446b
line diff
     1.1 --- a/app/main/admin/unit_edit.lua	Thu Oct 18 17:38:36 2018 +0200
     1.2 +++ b/app/main/admin/unit_edit.lua	Thu Oct 18 17:40:09 2018 +0200
     1.3 @@ -14,40 +14,52 @@
     1.4    units[#units+1] = { id = unit.id, name = unit.name }
     1.5  end
     1.6  
     1.7 -ui.form{
     1.8 -  attr = { class = "vertical section" },
     1.9 -  module = "admin",
    1.10 -  action = "unit_update",
    1.11 -  id = unit and unit.id,
    1.12 -  record = unit,
    1.13 -  routing = {
    1.14 -    default = {
    1.15 -      mode = "redirect",
    1.16 -      modules = "admin",
    1.17 -      view = "index"
    1.18 -    }
    1.19 -  },
    1.20 -  content = function()
    1.21 -    ui.sectionHead( function()
    1.22 -      ui.heading { level = 1, content = unit and unit.name or _"New organizational unit" }
    1.23 -    end )
    1.24 -    ui.sectionRow( function()
    1.25 -      ui.field.select{
    1.26 -        label = _"Parent unit",
    1.27 -        name = "parent_id",
    1.28 -        foreign_records = units,
    1.29 -        foreign_id      = "id",
    1.30 -        foreign_name    = "name"
    1.31 -      }
    1.32 -      ui.field.text{     label = _"Name",         name = "name" }
    1.33 -      ui.field.text{     label = _"Description",  name = "description", multiline = true }
    1.34 -      ui.field.text{     label = _"External reference",  name = "external_reference" }
    1.35 -      ui.field.boolean{  label = _"Active?",      name = "active", value = hint and true or nil }
    1.36 +ui.grid{ content = function()
    1.37  
    1.38 -      slot.put("<br />")
    1.39 -      ui.submit{         text  = _"update unit" }
    1.40 -      slot.put(" ")
    1.41 -      ui.link{ module = "admin", view = "index", content = _"cancel" }
    1.42 -    end )
    1.43 -  end
    1.44 -}
    1.45 +  ui.cell_main{ content = function()
    1.46 +    ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
    1.47 +      ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
    1.48 +        ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Member list" }
    1.49 +      end }
    1.50 +      ui.container{ attr = { class = "mdl-card__content" }, content = function()
    1.51 +        ui.form{
    1.52 +          attr = { class = "vertical section" },
    1.53 +          module = "admin",
    1.54 +          action = "unit_update",
    1.55 +          id = unit and unit.id,
    1.56 +          record = unit,
    1.57 +          routing = {
    1.58 +            default = {
    1.59 +              mode = "redirect",
    1.60 +              modules = "admin",
    1.61 +              view = "index"
    1.62 +            }
    1.63 +          },
    1.64 +          content = function()
    1.65 +            ui.sectionHead( function()
    1.66 +              ui.heading { level = 1, content = unit and unit.name or _"New organizational unit" }
    1.67 +            end )
    1.68 +            ui.sectionRow( function()
    1.69 +              ui.field.select{
    1.70 +                label = _"Parent unit",
    1.71 +                name = "parent_id",
    1.72 +                foreign_records = units,
    1.73 +                foreign_id      = "id",
    1.74 +                foreign_name    = "name"
    1.75 +              }
    1.76 +              ui.field.text{     label = _"Name",         name = "name" }
    1.77 +              ui.field.text{     label = _"Description",  name = "description", multiline = true }
    1.78 +              ui.field.text{     label = _"External reference",  name = "external_reference" }
    1.79 +              ui.field.boolean{  label = _"Active?",      name = "active", value = hint and true or nil }
    1.80 +
    1.81 +              slot.put("<br />")
    1.82 +              ui.submit{         text  = _"update unit" }
    1.83 +              slot.put(" ")
    1.84 +              ui.link{ module = "admin", view = "index", content = _"cancel" }
    1.85 +            end )
    1.86 +          end
    1.87 +        }
    1.88 +      end }
    1.89 +    end }
    1.90 +  end }
    1.91 +end }

Impressum / About Us