liquid_feedback_frontend

diff app/main/admin/member_list.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents b5684668ac4b
children 0739091c56fa
line diff
     1.1 --- a/app/main/admin/member_list.lua	Thu Jul 10 01:02:43 2014 +0200
     1.2 +++ b/app/main/admin/member_list.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -1,96 +1,100 @@
     1.4  local search = param.get("search")
     1.5  
     1.6 -ui.title(_"Member list")
     1.7 +ui.titleAdmin(_"Member list")
     1.8 +
     1.9 +ui.section( function()
    1.10 +
    1.11 +  ui.sectionHead( function()
    1.12 +    ui.heading { level = 1, content = _"Member list" }
    1.13 +  end )
    1.14  
    1.15 -ui.actions(function()
    1.16 -  ui.link{
    1.17 -    attr = { class = { "admin_only" } },
    1.18 -    text = _"Register new member",
    1.19 -    module = "admin",
    1.20 -    view = "member_edit"
    1.21 -  }
    1.22 -end)
    1.23 -
    1.24 -
    1.25 -ui.form{
    1.26 -  module = "admin", view = "member_list",
    1.27 -  content = function()
    1.28 +  ui.sectionRow( function ()
    1.29 +    ui.form{
    1.30 +      module = "admin", view = "member_list",
    1.31 +      content = function()
    1.32 +      
    1.33 +        ui.field.text{ label = _"search", name = "search", value = search }
    1.34 +        
    1.35 +        ui.submit{ value = _"search" }
    1.36 +      
    1.37 +      end
    1.38 +    }
    1.39 +  end )
    1.40    
    1.41 -    ui.field.text{ label = _"Search for members", name = "search" }
    1.42 -    
    1.43 -    ui.submit{ value = _"Start search" }
    1.44 -  
    1.45 -  end
    1.46 -}
    1.47  
    1.48 -if not search then
    1.49 -  return
    1.50 -end
    1.51 -
    1.52 -local members_selector = Member:build_selector{
    1.53 -  admin_search = search,
    1.54 -  order = "identification"
    1.55 -}
    1.56 +  ui.sectionRow( function ()
    1.57 +    local members_selector = Member:build_selector{
    1.58 +      admin_search = search,
    1.59 +      order = "identification"
    1.60 +    }
    1.61  
    1.62  
    1.63 -ui.paginate{
    1.64 -  selector = members_selector,
    1.65 -  per_page = 30,
    1.66 -  content = function() 
    1.67 -    ui.list{
    1.68 -      records = members_selector:exec(),
    1.69 -      columns = {
    1.70 -        {
    1.71 -          field_attr = { style = "text-align: right;" },
    1.72 -          label = _"Id",
    1.73 -          name = "id"
    1.74 -        },
    1.75 -        {
    1.76 -          label = _"Identification",
    1.77 -          name = "identification"
    1.78 -        },
    1.79 -        {
    1.80 -          label = _"Screen name",
    1.81 -          name = "name"
    1.82 -        },
    1.83 -        {
    1.84 -          label = _"Admin?",
    1.85 -          content = function(record)
    1.86 -            if record.admin then
    1.87 -              ui.field.text{ value = "admin" }
    1.88 -            end
    1.89 -          end
    1.90 -        },
    1.91 -        {
    1.92 -          content = function(record)
    1.93 -            if not record.activated then
    1.94 -              ui.field.text{ value = "not activated" }
    1.95 -            elseif not record.active then
    1.96 -              ui.field.text{ value = "inactive" }
    1.97 -            else
    1.98 -              ui.field.text{ value = "active" }
    1.99 -            end
   1.100 -          end
   1.101 -        },
   1.102 -        {
   1.103 -          content = function(record)
   1.104 -            if record.locked then
   1.105 -              ui.field.text{ value = "locked" }
   1.106 -            end
   1.107 -          end
   1.108 -        },
   1.109 -        {
   1.110 -          content = function(record)
   1.111 -            ui.link{
   1.112 -              attr = { class = "action admin_only" },
   1.113 -              text = _"Edit",
   1.114 -              module = "admin",
   1.115 -              view = "member_edit",
   1.116 -              id = record.id
   1.117 -            }
   1.118 -          end
   1.119 +    ui.paginate{
   1.120 +      selector = members_selector,
   1.121 +      per_page = 30,
   1.122 +      content = function() 
   1.123 +        ui.list{
   1.124 +          records = members_selector:exec(),
   1.125 +          columns = {
   1.126 +            {
   1.127 +              label = _"Id",
   1.128 +              content = function(record)
   1.129 +                ui.link{
   1.130 +                  text = record.id,
   1.131 +                  module = "admin",
   1.132 +                  view = "member_edit",
   1.133 +                  id = record.id
   1.134 +                }
   1.135 +              end
   1.136 +            },
   1.137 +            {
   1.138 +              label = _"Identification",
   1.139 +              content = function(record)
   1.140 +                ui.link{
   1.141 +                  text = record.identification or "",
   1.142 +                  module = "admin",
   1.143 +                  view = "member_edit",
   1.144 +                  id = record.id
   1.145 +                }
   1.146 +              end
   1.147 +            },
   1.148 +            {
   1.149 +              label = _"Screen name",
   1.150 +              content = function(record)
   1.151 +                ui.link{
   1.152 +                  text = record.name or "",
   1.153 +                  module = "admin",
   1.154 +                  view = "member_edit",
   1.155 +                  id = record.id
   1.156 +                }
   1.157 +              end
   1.158 +            },
   1.159 +            {
   1.160 +              content = function(record)
   1.161 +                if record.admin then
   1.162 +                  ui.field.text{ value = "admin" }
   1.163 +                end
   1.164 +              end
   1.165 +            },
   1.166 +            {
   1.167 +              content = function(record)
   1.168 +                if not record.activated then
   1.169 +                  ui.field.text{ value = "not activated" }
   1.170 +                elseif not record.active then
   1.171 +                  ui.field.text{ value = "inactive" }
   1.172 +                end
   1.173 +              end
   1.174 +            },
   1.175 +            {
   1.176 +              content = function(record)
   1.177 +                if record.locked then
   1.178 +                  ui.field.text{ value = "locked" }
   1.179 +                end
   1.180 +              end
   1.181 +            },
   1.182 +          }
   1.183          }
   1.184 -      }
   1.185 +      end
   1.186      }
   1.187 -  end
   1.188 -}
   1.189 \ No newline at end of file
   1.190 +  end )
   1.191 +end )
   1.192 \ No newline at end of file

Impressum / About Us