liquid_feedback_frontend

diff app/main/area/_sidebar_whatcanido.lua @ 1250:84f6e17c7ceb

Completed support for new notification system
author bsw
date Sun Apr 17 15:03:44 2016 +0200 (2016-04-17)
parents 701a5cf6b067
children 32cc544d5a5b
line diff
     1.1 --- a/app/main/area/_sidebar_whatcanido.lua	Tue Apr 05 20:41:05 2016 +0200
     1.2 +++ b/app/main/area/_sidebar_whatcanido.lua	Sun Apr 17 15:03:44 2016 +0200
     1.3 @@ -23,6 +23,106 @@
     1.4    end
     1.5    
     1.6    if member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
     1.7 +    
     1.8 +    if not app.session.member.disable_notifications then
     1.9 +      
    1.10 +      local ignored_area = IgnoredArea:by_pk(app.session.member_id, area.id)
    1.11 +
    1.12 +      if not ignored_area then
    1.13 +        ui.sidebarSection ( function ()
    1.14 +        
    1.15 +          ui.heading {
    1.16 +            level = 3, 
    1.17 +            content = _"You are receiving updates by email for this subject area"
    1.18 +          }
    1.19 +          ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    1.20 +            ui.tag { tag = "li", content = function ()
    1.21 +              ui.tag { content = function ()
    1.22 +                ui.link {
    1.23 +                  module = "area", action = "update_ignore",
    1.24 +                  params = { area_id = area.id },
    1.25 +                  routing = { default = {
    1.26 +                    mode = "redirect", module = "area", view = "show", id = area.id
    1.27 +                  } },
    1.28 +                  text = _"unsubscribe from update emails about this area"
    1.29 +                }
    1.30 +              end }
    1.31 +            end }
    1.32 +          end }
    1.33 +        end )
    1.34 +      end
    1.35 +      
    1.36 +      if ignored_area then
    1.37 +        ui.sidebarSection ( function ()
    1.38 +        
    1.39 +          ui.heading {
    1.40 +            level = 3, 
    1.41 +            content = _"I want to stay informed"
    1.42 +          }
    1.43 +          ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    1.44 +            ui.tag { tag = "li", content = function ()
    1.45 +              ui.tag { content = function ()
    1.46 +                ui.link {
    1.47 +                  module = "area", action = "update_ignore",
    1.48 +                  params = { area_id = area.id, delete = true },
    1.49 +                  routing = { default = {
    1.50 +                    mode = "redirect", module = "area", view = "show", id = area.id
    1.51 +                  } },
    1.52 +                  text = _"subscribe for update emails about this area"
    1.53 +                }
    1.54 +              end }
    1.55 +            end }
    1.56 +          end }
    1.57 +        end )
    1.58 +      end
    1.59 +    
    1.60 +    else
    1.61 +      ui.sidebarSection ( function ()
    1.62 +      
    1.63 +        ui.heading {
    1.64 +          level = 3, 
    1.65 +          content = _"I want to stay informed about this subject area"
    1.66 +        }
    1.67 +        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    1.68 +          ui.tag { tag = "li", content = function ()
    1.69 +            ui.tag { content = function ()
    1.70 +              ui.tag{ content = _"Edit your global " }
    1.71 +              ui.link {
    1.72 +                module = "member", view = "settings_notification",
    1.73 +                params = { return_to = "area", return_to_area_id = area.id },
    1.74 +                text = _"notification settings"
    1.75 +              }
    1.76 +              ui.tag{ content = _" to receive updates by email" }
    1.77 +            end }
    1.78 +          end }
    1.79 +        end }
    1.80 +      end )
    1.81 +    end
    1.82 +    
    1.83 +    if area.delegation_info.own_participation then
    1.84 +      ui.sidebarSection ( function ()
    1.85 +        ui.image{ attr = { class = "right" }, static = "icons/48/star.png" }
    1.86 +        ui.heading {
    1.87 +          level = 3, 
    1.88 +          content = _"You are subscribed for this subject area" 
    1.89 +        }
    1.90 +        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    1.91 +          ui.tag { tag = "li", content = function ()
    1.92 +            ui.tag { content = function ()
    1.93 +              ui.link {
    1.94 +                module = "membership", action = "update",
    1.95 +                routing = { default = {
    1.96 +                  mode = "redirect", module = "area", view = "show", id = area.id
    1.97 +                } },
    1.98 +                params = { area_id = area.id, delete = true },
    1.99 +                text = _"unsubscribe"
   1.100 +              }
   1.101 +            end }
   1.102 +          end }
   1.103 +        end }
   1.104 +      end )
   1.105 +    end
   1.106 +
   1.107      if not area.delegation_info.own_participation then
   1.108        ui.sidebarSection ( function ()
   1.109        
   1.110 @@ -47,29 +147,6 @@
   1.111        end )
   1.112      end
   1.113        
   1.114 -    if area.delegation_info.own_participation then
   1.115 -      ui.sidebarSection ( function ()
   1.116 -        ui.image{ attr = { class = "right" }, static = "icons/48/star.png" }
   1.117 -        ui.heading {
   1.118 -          level = 3, 
   1.119 -          content = _"You are subscribed for this subject area" 
   1.120 -        }
   1.121 -        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   1.122 -          ui.tag { tag = "li", content = function ()
   1.123 -            ui.tag { content = function ()
   1.124 -              ui.link {
   1.125 -                module = "membership", action = "update",
   1.126 -                routing = { default = {
   1.127 -                  mode = "redirect", module = "area", view = "show", id = area.id
   1.128 -                } },
   1.129 -                params = { area_id = area.id, delete = true },
   1.130 -                text = _"unsubscribe"
   1.131 -              }
   1.132 -            end }
   1.133 -          end }
   1.134 -        end }
   1.135 -      end )
   1.136 -    end
   1.137      
   1.138      
   1.139      ui.sidebarSection ( function ()

Impressum / About Us