liquid_feedback_frontend
diff app/main/member/_sidebar_whatcanido.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 | 554b739f86d6 |
| children |
line diff
1.1 --- a/app/main/member/_sidebar_whatcanido.lua Thu Jun 23 03:30:57 2016 +0200 1.2 +++ b/app/main/member/_sidebar_whatcanido.lua Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -1,327 +1,210 @@ 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 +ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.18 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.19 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" } 1.20 + end } 1.21 + ui.container{ attr = { class = "what-can-i-do-here" }, content = function() 1.22 1.23 - if member.locked then 1.24 - ui.container{ attr = { class = "sidebarSection" }, content = function() 1.25 - slot.put(" · ") 1.26 - ui.tag{ 1.27 - attr = { class = "interest deactivated_member_info" }, 1.28 - content = _"This member is locked" 1.29 - } 1.30 - end } 1.31 - end 1.32 - 1.33 - 1.34 - ui.sidebarHeadWhatCanIDo() 1.35 1.36 - if member.id == app.session.member_id and not app.session.needs_delegation_check then 1.37 - ui.sidebarSection( function() 1.38 - ui.heading { level = 3, content = _"I want to customize my profile" } 1.39 - ui.tag{ tag = "ul", attr = { class = "ul" }, content = function() 1.40 - ui.tag{ tag = "li", content = function() 1.41 - ui.link{ 1.42 - content = _"edit profile data", 1.43 - module = "member", 1.44 - view = "edit" 1.45 - } 1.46 - end } 1.47 - ui.tag{ tag = "li", content = function() 1.48 - ui.link{ 1.49 - content = _"change avatar/photo", 1.50 - module = "member", 1.51 - view = "edit_images" 1.52 - } 1.53 - end } 1.54 - end } 1.55 - end ) 1.56 - --[[ 1.57 - ui.sidebarSection( function() 1.58 - ui.heading { level = 3, content = _"I want to manage my saved contacts" } 1.59 - ui.tag{ tag = "ul", attr = { class = "ul" }, content = function() 1.60 - ui.tag{ tag = "li", content = function() 1.61 + if not member.active then 1.62 + ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function () 1.63 + slot.put(" · ") 1.64 + ui.tag{ 1.65 + attr = { class = "interest deactivated_member_info" }, 1.66 + content = _"This member is inactive" 1.67 + } 1.68 + end } 1.69 + end 1.70 + 1.71 + if member.locked then 1.72 + ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function () 1.73 + slot.put(" · ") 1.74 + ui.tag{ 1.75 + attr = { class = "interest deactivated_member_info" }, 1.76 + content = _"This member is locked" 1.77 + } 1.78 + end } 1.79 + end 1.80 1.81 - ui.link{ 1.82 - content = _"show saved contacts", 1.83 - module = 'contact', 1.84 - view = 'list' 1.85 - } 1.86 - 1.87 - end } 1.88 - end } 1.89 - end ) 1.90 - --]] 1.91 - 1.92 - ui.sidebarSection( function() 1.93 - 1.94 - ui.heading { level = 3, content = _"I want to change account settings" } 1.95 - 1.96 - local pages = {} 1.97 + if app.session.member_id == member.id then 1.98 + execute.view{ module = "member", view = "_settings_list" } 1.99 + end 1.100 + 1.101 + if app.session.member_id and not (member.id == app.session.member.id) then 1.102 + 1.103 + ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function () 1.104 1.105 - pages[#pages+1] = { view = "settings_notification", text = _"notification settings" } 1.106 - if not util.is_profile_field_locked(app.session.member, "notify_email") then 1.107 - pages[#pages+1] = { view = "settings_email", text = _"change your notification email address" } 1.108 - end 1.109 - if not util.is_profile_field_locked(app.session.member, "name") then 1.110 - pages[#pages+1] = { view = "settings_name", text = _"change your screen name" } 1.111 - end 1.112 - if not util.is_profile_field_locked(app.session.member, "login") then 1.113 - pages[#pages+1] = { view = "settings_login", text = _"change your login" } 1.114 - end 1.115 - if not util.is_profile_field_locked(app.session.member, "password") then 1.116 - pages[#pages+1] = { view = "settings_password", text = _"change your password" } 1.117 - end 1.118 - 1.119 - if config.download_dir then 1.120 - pages[#pages+1] = { module = "index", view = "download", text = _"database download" } 1.121 - end 1.122 - 1.123 - ui.tag{ tag = "ul", attr = { class = "ul" }, content = function() 1.124 - for i, page in ipairs(pages) do 1.125 - ui.tag{ tag = "li", content = function() 1.126 - ui.link{ 1.127 - module = page.module or "member", 1.128 - view = page.view, 1.129 - text = page.text 1.130 - } 1.131 - end } 1.132 - end 1.133 - end } 1.134 - end ) 1.135 - 1.136 - ui.sidebarSection( function() 1.137 - ui.heading { level = 3, content = _"I want to logout" } 1.138 - ui.tag{ tag = "ul", attr = { class = "ul" }, content = function() 1.139 - ui.tag{ tag = "li", content = function() 1.140 - ui.link{ 1.141 - text = _"logout", 1.142 - module = 'index', 1.143 - action = 'logout', 1.144 - routing = { 1.145 - default = { 1.146 - mode = "redirect", 1.147 - module = "index", 1.148 - view = "index" 1.149 + local contact = Contact:by_pk(app.session.member.id, member.id) 1.150 + if not contact then 1.151 + ui.tag{ content = _"I want to save this member as contact (i.e. to use as delegatee)" } 1.152 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.153 + ui.tag { tag = "li", content = function () 1.154 + ui.link{ 1.155 + text = _"add to my list of public contacts", 1.156 + module = "contact", 1.157 + action = "add_member", 1.158 + id = member.id, 1.159 + params = { public = true }, 1.160 + routing = { 1.161 + default = { 1.162 + mode = "redirect", 1.163 + module = request.get_module(), 1.164 + view = request.get_view(), 1.165 + id = request.get_id_string(), 1.166 + params = request.get_param_strings() 1.167 + } 1.168 + } 1.169 } 1.170 - } 1.171 - } 1.172 - end } 1.173 - end } 1.174 - end ) 1.175 - 1.176 - ui.sidebarSection( function() 1.177 - ui.heading { level = 3, content = _"I want to change the interface language" } 1.178 - ui.tag{ tag = "ul", attr = { class = "ul" }, content = function() 1.179 - for i, lang in ipairs(config.enabled_languages) do 1.180 - 1.181 - local langcode 1.182 - 1.183 - locale.do_with({ lang = lang }, function() 1.184 - langcode = _("[Name of Language]") 1.185 - end) 1.186 - 1.187 - ui.tag{ tag = "li", content = function() 1.188 - ui.link{ 1.189 - content = _('Select language "#{langcode}"', { langcode = langcode }), 1.190 - module = "index", 1.191 - action = "set_lang", 1.192 - params = { lang = lang }, 1.193 - routing = { 1.194 - default = { 1.195 - mode = "redirect", 1.196 - module = request.get_module(), 1.197 - view = request.get_view(), 1.198 - id = request.get_id_string(), 1.199 - params = request.get_param_strings() 1.200 + end } 1.201 + ui.tag { tag = "li", content = function () 1.202 + ui.link{ 1.203 + text = _"add to my list of private contacts", 1.204 + module = "contact", 1.205 + action = "add_member", 1.206 + id = member.id, 1.207 + routing = { 1.208 + default = { 1.209 + mode = "redirect", 1.210 + module = request.get_module(), 1.211 + view = request.get_view(), 1.212 + id = request.get_id_string(), 1.213 + params = request.get_param_strings() 1.214 + } 1.215 } 1.216 } 1.217 - } 1.218 + end } 1.219 + end } 1.220 + elseif contact.public then 1.221 + ui.tag{ content = _"You saved this member as contact (i.e. to use as delegatee) and others can see it" } 1.222 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.223 + ui.tag { tag = "li", content = function () 1.224 + ui.link{ 1.225 + text = _"make this contact private", 1.226 + module = "contact", 1.227 + action = "add_member", 1.228 + id = contact.other_member_id, 1.229 + params = { public = false }, 1.230 + routing = { 1.231 + default = { 1.232 + mode = "redirect", 1.233 + module = request.get_module(), 1.234 + view = request.get_view(), 1.235 + id = request.get_id_string(), 1.236 + params = request.get_param_strings() 1.237 + } 1.238 + } 1.239 + } 1.240 + end } 1.241 + ui.tag { tag = "li", content = function () 1.242 + ui.link{ 1.243 + text = _"remove from my contact list", 1.244 + module = "contact", 1.245 + action = "remove_member", 1.246 + id = contact.other_member_id, 1.247 + routing = { 1.248 + default = { 1.249 + mode = "redirect", 1.250 + module = request.get_module(), 1.251 + view = request.get_view(), 1.252 + id = request.get_id_string(), 1.253 + params = request.get_param_strings() 1.254 + } 1.255 + } 1.256 + } 1.257 + end } 1.258 + end } 1.259 + else 1.260 + ui.tag{ content = _"You saved this member as contact (i.e. to use as delegatee)" } 1.261 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.262 + ui.tag { tag = "li", content = function () 1.263 + ui.link{ 1.264 + text = _"make this contact public", 1.265 + module = "contact", 1.266 + action = "add_member", 1.267 + id = contact.other_member_id, 1.268 + params = { public = true }, 1.269 + routing = { 1.270 + default = { 1.271 + mode = "redirect", 1.272 + module = request.get_module(), 1.273 + view = request.get_view(), 1.274 + id = request.get_id_string(), 1.275 + params = request.get_param_strings() 1.276 + } 1.277 + } 1.278 + } 1.279 + end } 1.280 + ui.tag { tag = "li", content = function () 1.281 + ui.link{ 1.282 + text = _"remove from my contact list", 1.283 + module = "contact", 1.284 + action = "remove_member", 1.285 + id = contact.other_member_id, 1.286 + routing = { 1.287 + default = { 1.288 + mode = "redirect", 1.289 + module = request.get_module(), 1.290 + view = request.get_view(), 1.291 + id = request.get_id_string(), 1.292 + params = request.get_param_strings() 1.293 + } 1.294 + } 1.295 + } 1.296 + end } 1.297 end } 1.298 end 1.299 end } 1.300 - end ) 1.301 - elseif app.session.member_id and not (member.id == app.session.member.id) then 1.302 - 1.303 - ui.sidebarSection( function () 1.304 - 1.305 - local contact = Contact:by_pk(app.session.member.id, member.id) 1.306 - if not contact then 1.307 - ui.heading { level = 3, content = _"I want to save this member as contact (i.e. to use as delegatee)" } 1.308 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.309 - ui.tag { tag = "li", content = function () 1.310 - ui.link{ 1.311 - text = _"add to my list of public contacts", 1.312 - module = "contact", 1.313 - action = "add_member", 1.314 - id = member.id, 1.315 - params = { public = true }, 1.316 - routing = { 1.317 - default = { 1.318 - mode = "redirect", 1.319 - module = request.get_module(), 1.320 - view = request.get_view(), 1.321 - id = request.get_id_string(), 1.322 - params = request.get_param_strings() 1.323 - } 1.324 - } 1.325 - } 1.326 - end } 1.327 - ui.tag { tag = "li", content = function () 1.328 - ui.link{ 1.329 - text = _"add to my list of private contacts", 1.330 - module = "contact", 1.331 - action = "add_member", 1.332 - id = member.id, 1.333 - routing = { 1.334 - default = { 1.335 - mode = "redirect", 1.336 - module = request.get_module(), 1.337 - view = request.get_view(), 1.338 - id = request.get_id_string(), 1.339 - params = request.get_param_strings() 1.340 - } 1.341 - } 1.342 - } 1.343 - end } 1.344 - end } 1.345 - elseif contact.public then 1.346 - ui.heading { level = 3, content = _"You saved this member as contact (i.e. to use as delegatee) and others can see it" } 1.347 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.348 - ui.tag { tag = "li", content = function () 1.349 - ui.link{ 1.350 - text = _"make this contact private", 1.351 - module = "contact", 1.352 - action = "add_member", 1.353 - id = contact.other_member_id, 1.354 - params = { public = false }, 1.355 - routing = { 1.356 - default = { 1.357 - mode = "redirect", 1.358 - module = request.get_module(), 1.359 - view = request.get_view(), 1.360 - id = request.get_id_string(), 1.361 - params = request.get_param_strings() 1.362 - } 1.363 - } 1.364 - } 1.365 - end } 1.366 - ui.tag { tag = "li", content = function () 1.367 - ui.link{ 1.368 - text = _"remove from my contact list", 1.369 - module = "contact", 1.370 - action = "remove_member", 1.371 - id = contact.other_member_id, 1.372 - routing = { 1.373 - default = { 1.374 - mode = "redirect", 1.375 - module = request.get_module(), 1.376 - view = request.get_view(), 1.377 - id = request.get_id_string(), 1.378 - params = request.get_param_strings() 1.379 + 1.380 + ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function () 1.381 + local ignored_member = IgnoredMember:by_pk(app.session.member.id, member.id) 1.382 + if not ignored_member then 1.383 + ui.tag{ content = _"I do not like to hear from this member" } 1.384 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.385 + ui.tag { tag = "li", content = function () 1.386 + ui.link{ 1.387 + attr = { class = "interest" }, 1.388 + text = _"block this member", 1.389 + module = "member", 1.390 + action = "update_ignore_member", 1.391 + id = member.id, 1.392 + routing = { 1.393 + default = { 1.394 + mode = "redirect", 1.395 + module = request.get_module(), 1.396 + view = request.get_view(), 1.397 + id = request.get_id_string(), 1.398 + params = request.get_param_strings() 1.399 + } 1.400 } 1.401 } 1.402 - } 1.403 + end } 1.404 end } 1.405 - end } 1.406 - else 1.407 - ui.heading { level = 3, content = _"You saved this member as contact (i.e. to use as delegatee)" } 1.408 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.409 - ui.tag { tag = "li", content = function () 1.410 - ui.link{ 1.411 - text = _"make this contact public", 1.412 - module = "contact", 1.413 - action = "add_member", 1.414 - id = contact.other_member_id, 1.415 - params = { public = true }, 1.416 - routing = { 1.417 - default = { 1.418 - mode = "redirect", 1.419 - module = request.get_module(), 1.420 - view = request.get_view(), 1.421 - id = request.get_id_string(), 1.422 - params = request.get_param_strings() 1.423 - } 1.424 - } 1.425 - } 1.426 - end } 1.427 - ui.tag { tag = "li", content = function () 1.428 - ui.link{ 1.429 - text = _"remove from my contact list", 1.430 - module = "contact", 1.431 - action = "remove_member", 1.432 - id = contact.other_member_id, 1.433 - routing = { 1.434 - default = { 1.435 - mode = "redirect", 1.436 - module = request.get_module(), 1.437 - view = request.get_view(), 1.438 - id = request.get_id_string(), 1.439 - params = request.get_param_strings() 1.440 + else 1.441 + ui.tag{ content = _"You blocked this member (i.e. you will not be notified about this members actions)" } 1.442 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.443 + ui.tag { tag = "li", content = function () 1.444 + ui.link{ 1.445 + text = _"unblock member", 1.446 + module = "member", 1.447 + action = "update_ignore_member", 1.448 + id = member.id, 1.449 + params = { delete = true }, 1.450 + routing = { 1.451 + default = { 1.452 + mode = "redirect", 1.453 + module = request.get_module(), 1.454 + view = request.get_view(), 1.455 + id = request.get_id_string(), 1.456 + params = request.get_param_strings() 1.457 + } 1.458 } 1.459 } 1.460 - } 1.461 + end } 1.462 end } 1.463 - end } 1.464 - end 1.465 - end ) 1.466 - 1.467 - ui.sidebarSection( function() 1.468 - local ignored_member = IgnoredMember:by_pk(app.session.member.id, member.id) 1.469 - if not ignored_member then 1.470 - ui.heading { level = 3, content = _"I do not like to hear from this member" } 1.471 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.472 - ui.tag { tag = "li", content = function () 1.473 - ui.link{ 1.474 - attr = { class = "interest" }, 1.475 - text = _"block this member", 1.476 - module = "member", 1.477 - action = "update_ignore_member", 1.478 - id = member.id, 1.479 - routing = { 1.480 - default = { 1.481 - mode = "redirect", 1.482 - module = request.get_module(), 1.483 - view = request.get_view(), 1.484 - id = request.get_id_string(), 1.485 - params = request.get_param_strings() 1.486 - } 1.487 - } 1.488 - } 1.489 - end } 1.490 - end } 1.491 - else 1.492 - ui.heading { level = 3, content = _"You blocked this member (i.e. you will not be notified about this members actions)" } 1.493 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.494 - ui.tag { tag = "li", content = function () 1.495 - ui.link{ 1.496 - text = _"unblock member", 1.497 - module = "member", 1.498 - action = "update_ignore_member", 1.499 - id = member.id, 1.500 - params = { delete = true }, 1.501 - routing = { 1.502 - default = { 1.503 - mode = "redirect", 1.504 - module = request.get_module(), 1.505 - view = request.get_view(), 1.506 - id = request.get_id_string(), 1.507 - params = request.get_param_strings() 1.508 - } 1.509 - } 1.510 - } 1.511 - end } 1.512 - end } 1.513 - end 1.514 - end ) 1.515 - end 1.516 -end ) 1.517 \ No newline at end of file 1.518 + end 1.519 + end } 1.520 + 1.521 + end 1.522 + end } 1.523 +end }