liquid_feedback_frontend

diff app/main/member/_sidebar_whatcanido.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents
children 58f48a8a202a
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/member/_sidebar_whatcanido.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -0,0 +1,326 @@
     1.4 +local member = param.get("member", "table")
     1.5 +
     1.6 +ui.sidebar( "tab-whatcanido", function()
     1.7 +
     1.8 +  if not member.active then
     1.9 +    ui.container{ attr = { class = "sidebarSection" }, content = function()
    1.10 +      slot.put(" · ")
    1.11 +      ui.tag{
    1.12 +        attr = { class = "interest deactivated_member_info" },
    1.13 +        content = _"This member is inactive"
    1.14 +      }
    1.15 +    end }   
    1.16 +  end
    1.17 +  
    1.18 +  if member.locked then
    1.19 +    ui.container{ attr = { class = "sidebarSection" }, content = function()
    1.20 +      slot.put(" · ")
    1.21 +      ui.tag{
    1.22 +        attr = { class = "interest deactivated_member_info" },
    1.23 +        content = _"This member is locked"
    1.24 +      }
    1.25 +    end }   
    1.26 +  end
    1.27 +
    1.28 +  
    1.29 +  ui.sidebarHeadWhatCanIDo()
    1.30 +
    1.31 +  if member.id == app.session.member_id and not app.session.needs_delegation_check then
    1.32 +    ui.sidebarSection( function()
    1.33 +      ui.heading { level = 3, content = _"I want to customize my profile" }
    1.34 +      ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
    1.35 +        ui.tag{ tag = "li", content = function()
    1.36 +          ui.link{
    1.37 +            content = _"edit profile data",
    1.38 +            module  = "member",
    1.39 +            view    = "edit"
    1.40 +          }
    1.41 +        end }
    1.42 +        ui.tag{ tag = "li", content = function()
    1.43 +          ui.link{
    1.44 +            content = _"change avatar/photo",
    1.45 +            module  = "member",
    1.46 +            view    = "edit_images"
    1.47 +          }
    1.48 +        end }
    1.49 +      end }
    1.50 +    end )
    1.51 +    --[[
    1.52 +    ui.sidebarSection( function()
    1.53 +      ui.heading { level = 3, content = _"I want to manage my saved contacts" }
    1.54 +      ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
    1.55 +        ui.tag{ tag = "li", content = function()
    1.56 +
    1.57 +          ui.link{
    1.58 +            content = _"show saved contacts",
    1.59 +            module = 'contact',
    1.60 +            view   = 'list'
    1.61 +          }
    1.62 +
    1.63 +        end }
    1.64 +      end }
    1.65 +    end )
    1.66 +    --]]
    1.67 +    
    1.68 +    ui.sidebarSection( function()
    1.69 +
    1.70 +      ui.heading { level = 3, content = _"I want to change account settings" }
    1.71 +
    1.72 +      local pages = {}
    1.73 +
    1.74 +      pages[#pages+1] = { view = "settings_notification", text = _"notification settings" }
    1.75 +      if not config.locked_profile_fields.notify_email then
    1.76 +        pages[#pages+1] = { view = "settings_email",          text = _"change your notification email address" }
    1.77 +      end
    1.78 +      if not config.locked_profile_fields.name then
    1.79 +        pages[#pages+1] = { view = "settings_name",           text = _"change your screen name" }
    1.80 +      end
    1.81 +      if not config.locked_profile_fields.login then
    1.82 +        pages[#pages+1] = { view = "settings_login",          text = _"change your login" }
    1.83 +      end
    1.84 +      pages[#pages+1] = { view = "settings_password",       text = _"change your password" }
    1.85 +      pages[#pages+1] = { view = "developer_settings",      text = _"developer settings" }
    1.86 +
    1.87 +      if config.download_dir then
    1.88 +        pages[#pages+1] = { module = "index", view = "download",      text = _"database download" }
    1.89 +      end
    1.90 +
    1.91 +      ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
    1.92 +        for i, page in ipairs(pages) do
    1.93 +          ui.tag{ tag = "li", content = function()
    1.94 +            ui.link{
    1.95 +              module = page.module or "member",
    1.96 +              view = page.view,
    1.97 +              text = page.text
    1.98 +            }
    1.99 +          end }
   1.100 +        end
   1.101 +      end }
   1.102 +    end )
   1.103 +    
   1.104 +    ui.sidebarSection( function()
   1.105 +      ui.heading { level = 3, content = _"I want to logout" }
   1.106 +      ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
   1.107 +        ui.tag{ tag = "li", content = function()
   1.108 +          ui.link{
   1.109 +            text   = _"logout",
   1.110 +            module = 'index',
   1.111 +            action = 'logout',
   1.112 +            routing = {
   1.113 +              default = {
   1.114 +                mode = "redirect",
   1.115 +                module = "index",
   1.116 +                view = "index"
   1.117 +              }
   1.118 +            }
   1.119 +          }
   1.120 +        end }
   1.121 +      end }
   1.122 +    end )
   1.123 +    
   1.124 +    ui.sidebarSection( function()
   1.125 +      ui.heading { level = 3, content = _"I want to change the interface language" }
   1.126 +      ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
   1.127 +        for i, lang in ipairs(config.enabled_languages) do
   1.128 +          
   1.129 +          local langcode
   1.130 +          
   1.131 +          locale.do_with({ lang = lang }, function()
   1.132 +            langcode = _("[Name of Language]")
   1.133 +          end)
   1.134 +          
   1.135 +          ui.tag{ tag = "li", content = function()
   1.136 +            ui.link{
   1.137 +              content = _('Select language "#{langcode}"', { langcode = langcode }),
   1.138 +              module = "index",
   1.139 +              action = "set_lang",
   1.140 +              params = { lang = lang },
   1.141 +              routing = {
   1.142 +                default = {
   1.143 +                  mode = "redirect",
   1.144 +                  module = request.get_module(),
   1.145 +                  view = request.get_view(),
   1.146 +                  id = param.get_id_cgi(),
   1.147 +                  params = param.get_all_cgi()
   1.148 +                }
   1.149 +              }
   1.150 +            }
   1.151 +          end }
   1.152 +        end
   1.153 +      end }
   1.154 +    end )
   1.155 +  elseif app.session.member_id and not (member.id == app.session.member.id) then
   1.156 +    
   1.157 +    ui.sidebarSection( function ()
   1.158 +
   1.159 +      local contact = Contact:by_pk(app.session.member.id, member.id)
   1.160 +      if not contact then
   1.161 +        ui.heading { level = 3, content = _"I want to save this member as contact (i.e. to use as delegatee)" }
   1.162 +        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   1.163 +          ui.tag { tag = "li", content = function ()
   1.164 +            ui.link{
   1.165 +              text    = _"add to my list of public contacts",
   1.166 +              module  = "contact",
   1.167 +              action  = "add_member",
   1.168 +              id      = member.id,
   1.169 +              params = { public = true },
   1.170 +              routing = {
   1.171 +                default = {
   1.172 +                  mode = "redirect",
   1.173 +                  module = request.get_module(),
   1.174 +                  view = request.get_view(),
   1.175 +                  id = param.get_id_cgi(),
   1.176 +                  params = param.get_all_cgi()
   1.177 +                }
   1.178 +              }
   1.179 +            }
   1.180 +          end }
   1.181 +          ui.tag { tag = "li", content = function ()
   1.182 +            ui.link{
   1.183 +              text    = _"add to my list of private contacts",
   1.184 +              module  = "contact",
   1.185 +              action  = "add_member",
   1.186 +              id      = member.id,
   1.187 +              routing = {
   1.188 +                default = {
   1.189 +                  mode = "redirect",
   1.190 +                  module = request.get_module(),
   1.191 +                  view = request.get_view(),
   1.192 +                  id = param.get_id_cgi(),
   1.193 +                  params = param.get_all_cgi()
   1.194 +                }
   1.195 +              }
   1.196 +            }
   1.197 +          end }
   1.198 +        end }
   1.199 +      elseif contact.public then
   1.200 +        ui.heading { level = 3, content = _"You saved this member as contact (i.e. to use as delegatee) and others can see it" }
   1.201 +        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   1.202 +          ui.tag { tag = "li", content = function ()
   1.203 +            ui.link{
   1.204 +              text   = _"make this contact private",
   1.205 +              module = "contact",
   1.206 +              action = "add_member",
   1.207 +              id     = contact.other_member_id,
   1.208 +              params = { public = false },
   1.209 +              routing = {
   1.210 +                default = {
   1.211 +                  mode = "redirect",
   1.212 +                  module = request.get_module(),
   1.213 +                  view = request.get_view(),
   1.214 +                  id = param.get_id_cgi(),
   1.215 +                  params = param.get_all_cgi()
   1.216 +                }
   1.217 +              }
   1.218 +            }
   1.219 +          end }
   1.220 +          ui.tag { tag = "li", content = function ()
   1.221 +            ui.link{
   1.222 +              text   = _"remove from my contact list",
   1.223 +              module = "contact",
   1.224 +              action = "remove_member",
   1.225 +              id     = contact.other_member_id,
   1.226 +              routing = {
   1.227 +                default = {
   1.228 +                  mode = "redirect",
   1.229 +                  module = request.get_module(),
   1.230 +                  view = request.get_view(),
   1.231 +                  id = param.get_id_cgi(),
   1.232 +                  params = param.get_all_cgi()
   1.233 +                }
   1.234 +              }
   1.235 +            }
   1.236 +          end }
   1.237 +        end }
   1.238 +      else
   1.239 +        ui.heading { level = 3, content = _"You saved this member as contact (i.e. to use as delegatee)" }
   1.240 +        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   1.241 +          ui.tag { tag = "li", content = function ()
   1.242 +            ui.link{
   1.243 +              text   = _"make this contact public",
   1.244 +              module = "contact",
   1.245 +              action = "add_member",
   1.246 +              id     = contact.other_member_id,
   1.247 +              params = { public = true },
   1.248 +              routing = {
   1.249 +                default = {
   1.250 +                  mode = "redirect",
   1.251 +                  module = request.get_module(),
   1.252 +                  view = request.get_view(),
   1.253 +                  id = param.get_id_cgi(),
   1.254 +                  params = param.get_all_cgi()
   1.255 +                }
   1.256 +              }
   1.257 +            }
   1.258 +          end }
   1.259 +          ui.tag { tag = "li", content = function ()
   1.260 +            ui.link{
   1.261 +              text   = _"remove from my contact list",
   1.262 +              module = "contact",
   1.263 +              action = "remove_member",
   1.264 +              id     = contact.other_member_id,
   1.265 +              routing = {
   1.266 +                default = {
   1.267 +                  mode = "redirect",
   1.268 +                  module = request.get_module(),
   1.269 +                  view = request.get_view(),
   1.270 +                  id = param.get_id_cgi(),
   1.271 +                  params = param.get_all_cgi()
   1.272 +                }
   1.273 +              }
   1.274 +            }
   1.275 +          end }
   1.276 +        end }
   1.277 +      end
   1.278 +    end )
   1.279 +    
   1.280 +    ui.sidebarSection( function()
   1.281 +      local ignored_member = IgnoredMember:by_pk(app.session.member.id, member.id)
   1.282 +      if not ignored_member then
   1.283 +        ui.heading { level = 3, content = _"I do not like to hear from this member" }
   1.284 +        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   1.285 +          ui.tag { tag = "li", content = function ()
   1.286 +            ui.link{
   1.287 +              attr = { class = "interest" },
   1.288 +              text    = _"block this member",
   1.289 +              module  = "member",
   1.290 +              action  = "update_ignore_member",
   1.291 +              id      = member.id,
   1.292 +              routing = {
   1.293 +                default = {
   1.294 +                  mode = "redirect",
   1.295 +                  module = request.get_module(),
   1.296 +                  view = request.get_view(),
   1.297 +                  id = param.get_id_cgi(),
   1.298 +                  params = param.get_all_cgi()
   1.299 +                }
   1.300 +              }
   1.301 +            }
   1.302 +          end }
   1.303 +        end }
   1.304 +      else
   1.305 +        ui.heading { level = 3, content = _"You blocked this member (i.e. you will not be notified about this members actions)" }
   1.306 +        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   1.307 +          ui.tag { tag = "li", content = function ()
   1.308 +            ui.link{
   1.309 +              text   = _"unblock member",
   1.310 +              module = "member",
   1.311 +              action = "update_ignore_member",
   1.312 +              id     = member.id,
   1.313 +              params = { delete = true },
   1.314 +              routing = {
   1.315 +                default = {
   1.316 +                  mode = "redirect",
   1.317 +                  module = request.get_module(),
   1.318 +                  view = request.get_view(),
   1.319 +                  id = param.get_id_cgi(),
   1.320 +                  params = param.get_all_cgi()
   1.321 +                }
   1.322 +              }
   1.323 +            }
   1.324 +          end }
   1.325 +        end }
   1.326 +      end
   1.327 +    end )
   1.328 +  end
   1.329 +end )
   1.330 \ No newline at end of file

Impressum / About Us