liquid_feedback_frontend

changeset 1455:24dc7bd75d0a

New layout for admin member edit view
author bsw
date Thu Oct 18 17:23:45 2018 +0200 (2018-10-18)
parents 1d5469ca60dc
children 9e5cfd6411aa
files app/main/admin/member_edit.lua
line diff
     1.1 --- a/app/main/admin/member_edit.lua	Thu Oct 18 17:22:18 2018 +0200
     1.2 +++ b/app/main/admin/member_edit.lua	Thu Oct 18 17:23:45 2018 +0200
     1.3 @@ -17,83 +17,93 @@
     1.4  
     1.5  local units = units_selector:exec()
     1.6    
     1.7 -ui.form{
     1.8 -  attr = { class = "vertical section" },
     1.9 -  module = "admin",
    1.10 -  action = "member_update",
    1.11 -  id = member and member.id,
    1.12 -  record = member,
    1.13 -  readonly = not app.session.member.admin,
    1.14 -  routing = {
    1.15 -    default = {
    1.16 -      mode = "redirect",
    1.17 -      modules = "admin",
    1.18 -      view = "index"
    1.19 -    }
    1.20 -  },
    1.21 -  content = function()
    1.22 +ui.grid{ content = function()
    1.23  
    1.24 -    ui.sectionHead( function()
    1.25 -      ui.heading { level = 1, content = member and (member.name or member.id) or _"New member" }
    1.26 -      if member and member.identification then
    1.27 -        ui.heading { level = 3, content = member.identification }
    1.28 -      end
    1.29 -    end )
    1.30 -  
    1.31 -    ui.sectionRow( function()
    1.32 -      ui.field.text{     label = _"Identification", name = "identification" }
    1.33 -      ui.field.text{     label = _"Notification email (confirmed)", name = "notify_email" }
    1.34 -      ui.field.text{     label = _"Notification email (unconfirmed)", name = "notify_email_unconfirmed" }
    1.35 -      if member and member.activated then
    1.36 -        ui.field.text{     label = _"Screen name",        name = "name" }
    1.37 -      end
    1.38 -      
    1.39 -      if member and member.activated and not deactivated then
    1.40 -        ui.field.text{     label = _"Login name",        name = "login" }
    1.41 -      end
    1.42 +  ui.cell_main{ content = function()
    1.43 +    ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
    1.44 +      ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
    1.45 +        ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Member" }
    1.46 +      end }
    1.47 +      ui.container{ attr = { class = "mdl-card__content" }, content = function()
    1.48 +        ui.form{
    1.49 +          attr = { class = "vertical section" },
    1.50 +          module = "admin",
    1.51 +          action = "member_update",
    1.52 +          id = member and member.id,
    1.53 +          record = member,
    1.54 +          readonly = not app.session.member.admin,
    1.55 +          routing = {
    1.56 +            default = {
    1.57 +              mode = "redirect",
    1.58 +              modules = "admin",
    1.59 +              view = "index"
    1.60 +            }
    1.61 +          },
    1.62 +          content = function()
    1.63 +
    1.64 +            ui.sectionHead( function()
    1.65 +              ui.heading { level = 1, content = member and (member.name or member.id) or _"New member" }
    1.66 +              if member and member.identification then
    1.67 +                ui.heading { level = 3, content = member.identification }
    1.68 +              end
    1.69 +            end )
    1.70 +          
    1.71 +            ui.sectionRow( function()
    1.72 +              ui.field.text{     label = _"Identification", name = "identification" }
    1.73 +              ui.field.text{     label = _"Notification email (confirmed)", name = "notify_email" }
    1.74 +              ui.field.text{     label = _"Notification email (unconfirmed)", name = "notify_email_unconfirmed" }
    1.75 +              if member and member.activated then
    1.76 +                ui.field.text{     label = _"Screen name",        name = "name" }
    1.77 +              end
    1.78 +              
    1.79 +              if member and member.activated and not deactivated then
    1.80 +                ui.field.text{     label = _"Login name",        name = "login" }
    1.81 +              end
    1.82  
    1.83 -      for i, unit in ipairs(units) do
    1.84 -        ui.field.boolean{
    1.85 -          name = "unit_" .. unit.id,
    1.86 -          label = unit.name,
    1.87 -          value = unit.voting_right
    1.88 -        }
    1.89 -      end
    1.90 -      slot.put("<br /><br />")
    1.91 +              for i, unit in ipairs(units) do
    1.92 +                ui.field.boolean{
    1.93 +                name = "unit_" .. unit.id,
    1.94 +                label = unit.name,
    1.95 +                value = unit.voting_right
    1.96 +              }
    1.97 +            end
    1.98 +            slot.put("<br /><br />")
    1.99  
   1.100 -      if member then
   1.101 -        ui.field.text{  label = _"Activated",       name = "activated", readonly = true }
   1.102 -      end
   1.103 -         
   1.104 -      if not member or not member.activated then
   1.105 -        ui.field.boolean{  label = _"Send invite?",       name = "invite_member" }
   1.106 -      end
   1.107 -      
   1.108 -      if member then
   1.109 -        ui.field.boolean{ 
   1.110 -          label = _"Member inactive?", name = "deactivate",
   1.111 -          readonly = true, 
   1.112 -          value = member and member.active == false
   1.113 -        }
   1.114 -      end
   1.115 -      
   1.116 -      if member then
   1.117 -        ui.field.boolean{
   1.118 -          label = _"Lock member?", name = "locked",
   1.119 -        }
   1.120 -      end
   1.121 -      
   1.122 -      slot.put("<br />")
   1.123 -      ui.field.boolean{  label = _"Admin?", name = "admin" }
   1.124 -      slot.put("<br />")
   1.125 -      ui.submit{         text  = _"update member" }
   1.126 -      slot.put(" ")
   1.127 -      if member then
   1.128 -        ui.link { module = "admin", view = "member_deactivate", content = _"Deactivate member", id = member.id }
   1.129 -        slot.put(" ")
   1.130 -      end
   1.131 -      ui.link { module = "admin", view = "index", content = _"cancel" }
   1.132 -    end )
   1.133 -  end
   1.134 -}
   1.135 -
   1.136 +            if member then
   1.137 +              ui.field.text{  label = _"Activated",       name = "activated", readonly = true }
   1.138 +            end
   1.139 +              
   1.140 +            if not member or not member.activated then
   1.141 +              ui.field.boolean{  label = _"Send invite?",       name = "invite_member" }
   1.142 +            end
   1.143 +            
   1.144 +            if member then
   1.145 +              ui.field.boolean{ 
   1.146 +                label = _"Member inactive?", name = "deactivate",
   1.147 +                readonly = true, 
   1.148 +                value = member and member.active == false
   1.149 +              }
   1.150 +            end
   1.151 +            
   1.152 +            if member then
   1.153 +              ui.field.boolean{
   1.154 +                label = _"Lock member?", name = "locked",
   1.155 +              }
   1.156 +            end
   1.157 +            
   1.158 +            slot.put("<br />")
   1.159 +            ui.field.boolean{  label = _"Admin?", name = "admin" }
   1.160 +            slot.put("<br />")
   1.161 +            ui.submit{         text  = _"update member" }
   1.162 +            slot.put(" ")
   1.163 +            if member then
   1.164 +              ui.link { module = "admin", view = "member_deactivate", content = _"Deactivate member", id = member.id }
   1.165 +              slot.put(" ")
   1.166 +            end
   1.167 +            ui.link { module = "admin", view = "index", content = _"cancel" }
   1.168 +          end )
   1.169 +        end
   1.170 +      }
   1.171 +    end }
   1.172 +  end }
   1.173 +end }

Impressum / About Us