liquid_feedback_frontend

diff app/main/contact/list.lua @ 1309:32cc544d5a5b

Cumulative patch for upcoming frontend version 4
author bsw/jbe
date Sun Jul 15 14:07:29 2018 +0200 (2018-07-15)
parents 904f6807f7fa
children
line diff
     1.1 --- a/app/main/contact/list.lua	Thu Jun 23 03:30:57 2016 +0200
     1.2 +++ b/app/main/contact/list.lua	Sun Jul 15 14:07:29 2018 +0200
     1.3 @@ -5,97 +5,112 @@
     1.4  
     1.5  ui.title(_"Contacts")
     1.6  
     1.7 +ui.grid{ content = function()
     1.8 +  ui.cell_main{ content = function()
     1.9  
    1.10 -ui.paginate{
    1.11 -  selector = contacts_selector,
    1.12 -  content = function()
    1.13 -    local contacts = contacts_selector:exec()
    1.14 -    if #contacts == 0 then
    1.15 -      ui.field.text{ value = _"You didn't save any member as contact yet." }
    1.16 -    else
    1.17 -      ui.list{
    1.18 -        records = contacts,
    1.19 -        columns = {
    1.20 -          {
    1.21 -            label = _"Name",
    1.22 -            content = function(record)
    1.23 -              ui.link{
    1.24 -                text = record.other_member.name,
    1.25 -                module = "member",
    1.26 -                view = "show",
    1.27 -                id = record.other_member_id
    1.28 -              }
    1.29 -            end
    1.30 -          },
    1.31 -          {
    1.32 -            label = _"Published",
    1.33 -            content = function(record)
    1.34 -              ui.field.boolean{ value = record.public }
    1.35 -            end
    1.36 -          },
    1.37 -          {
    1.38 -            content = function(record)
    1.39 -              if record.public then
    1.40 -                ui.link{
    1.41 -                  attr = { class = "action" },
    1.42 -                  text = _"Hide",
    1.43 -                  module = "contact",
    1.44 -                  action = "add_member",
    1.45 -                  id = record.other_member_id,
    1.46 -                  params = { public = false },
    1.47 -                  routing = {
    1.48 -                    default = {
    1.49 -                      mode = "redirect",
    1.50 -                      module = request.get_module(),
    1.51 -                      view = request.get_view(),
    1.52 -                      id = request.get_id_string(),
    1.53 -                      params = request.get_param_strings()
    1.54 -                    }
    1.55 -                  }
    1.56 -                }
    1.57 -              else
    1.58 -                ui.link{
    1.59 -                  attr = { class = "action" },
    1.60 -                  text = _"Publish",
    1.61 -                  module = "contact",
    1.62 -                  action = "add_member",
    1.63 -                  id = record.other_member_id,
    1.64 -                  params = { public = true },
    1.65 -                  routing = {
    1.66 -                    default = {
    1.67 -                      mode = "redirect",
    1.68 -                      module = request.get_module(),
    1.69 -                      view = request.get_view(),
    1.70 -                      id = request.get_id_string(),
    1.71 -                      params = request.get_param_strings()
    1.72 -                    }
    1.73 -                  }
    1.74 -                }
    1.75 -              end
    1.76 -            end
    1.77 -          },
    1.78 -          {
    1.79 -            content = function(record)
    1.80 -              ui.link{
    1.81 -                attr = { class = "action" },
    1.82 -                text = _"Remove",
    1.83 -                module = "contact",
    1.84 -                action = "remove_member",
    1.85 -                id = record.other_member_id,
    1.86 -                routing = {
    1.87 -                  default = {
    1.88 -                    mode = "redirect",
    1.89 -                    module = request.get_module(),
    1.90 -                    view = request.get_view(),
    1.91 -                    id = request.get_id_string(),
    1.92 -                    params = request.get_param_strings()
    1.93 -                  }
    1.94 +    ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
    1.95 +      ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
    1.96 +        ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Contacts" }
    1.97 +      end }
    1.98 +      ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
    1.99 +
   1.100 +
   1.101 +        ui.paginate{
   1.102 +          selector = contacts_selector,
   1.103 +          content = function()
   1.104 +            local contacts = contacts_selector:exec()
   1.105 +            if #contacts == 0 then
   1.106 +              ui.field.text{ value = _"You didn't save any member as contact yet." }
   1.107 +            else
   1.108 +              ui.list{
   1.109 +                attr = { class = "mdl-data-table mdl-js-data-table mdl-shadow--2dp" },
   1.110 +                records = contacts,
   1.111 +                columns = {
   1.112 +                  {
   1.113 +                    label = _"Name",
   1.114 +                    content = function(record)
   1.115 +                      ui.link{
   1.116 +                        text = record.other_member.name,
   1.117 +                        module = "member",
   1.118 +                        view = "show",
   1.119 +                        id = record.other_member_id
   1.120 +                      }
   1.121 +                    end
   1.122 +                  },
   1.123 +                  {
   1.124 +                    label = _"Published",
   1.125 +                    content = function(record)
   1.126 +                      ui.field.boolean{ value = record.public }
   1.127 +                    end
   1.128 +                  },
   1.129 +                  {
   1.130 +                    content = function(record)
   1.131 +                      if record.public then
   1.132 +                        ui.link{
   1.133 +                          attr = { class = "action" },
   1.134 +                          text = _"Hide",
   1.135 +                          module = "contact",
   1.136 +                          action = "add_member",
   1.137 +                          id = record.other_member_id,
   1.138 +                          params = { public = false },
   1.139 +                          routing = {
   1.140 +                            default = {
   1.141 +                              mode = "redirect",
   1.142 +                              module = request.get_module(),
   1.143 +                              view = request.get_view(),
   1.144 +                              id = request.get_id_string(),
   1.145 +                              params = request.get_param_strings()
   1.146 +                            }
   1.147 +                          }
   1.148 +                        }
   1.149 +                      else
   1.150 +                        ui.link{
   1.151 +                          attr = { class = "action" },
   1.152 +                          text = _"Publish",
   1.153 +                          module = "contact",
   1.154 +                          action = "add_member",
   1.155 +                          id = record.other_member_id,
   1.156 +                          params = { public = true },
   1.157 +                          routing = {
   1.158 +                            default = {
   1.159 +                              mode = "redirect",
   1.160 +                              module = request.get_module(),
   1.161 +                              view = request.get_view(),
   1.162 +                              id = request.get_id_string(),
   1.163 +                              params = request.get_param_strings()
   1.164 +                            }
   1.165 +                          }
   1.166 +                        }
   1.167 +                      end
   1.168 +                    end
   1.169 +                  },
   1.170 +                  {
   1.171 +                    content = function(record)
   1.172 +                      ui.link{
   1.173 +                        attr = { class = "action" },
   1.174 +                        text = _"Remove",
   1.175 +                        module = "contact",
   1.176 +                        action = "remove_member",
   1.177 +                        id = record.other_member_id,
   1.178 +                        routing = {
   1.179 +                          default = {
   1.180 +                            mode = "redirect",
   1.181 +                            module = request.get_module(),
   1.182 +                            view = request.get_view(),
   1.183 +                            id = request.get_id_string(),
   1.184 +                            params = request.get_param_strings()
   1.185 +                          }
   1.186 +                        }
   1.187 +                      }
   1.188 +                    end
   1.189 +                  },
   1.190                  }
   1.191                }
   1.192              end
   1.193 -          },
   1.194 +          end
   1.195          }
   1.196 -      }
   1.197 -    end
   1.198 -  end
   1.199 -}
   1.200 +
   1.201 +      end }
   1.202 +    end }
   1.203 +  end }
   1.204 +end }

Impressum / About Us