liquid_feedback_frontend

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

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents 418b590fa9ed
children 7b46738a9261
line diff
     1.1 --- a/app/main/member/settings_notification.lua	Thu Jul 10 01:02:43 2014 +0200
     1.2 +++ b/app/main/member/settings_notification.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -1,6 +1,12 @@
     1.4 -ui.title(_"Notification settings")
     1.5 +local return_to = param.get("return_to")
     1.6 +
     1.7 +ui.titleMember("notification settings")
     1.8  
     1.9 -util.help("member.settings.notification", _"Notification settings")
    1.10 +execute.view {
    1.11 +  module = "member", view = "_sidebar_whatcanido", params = {
    1.12 +    member = app.session.member
    1.13 +  }
    1.14 +}
    1.15  
    1.16  ui.form{
    1.17    attr = { class = "vertical" },
    1.18 @@ -9,99 +15,138 @@
    1.19    routing = {
    1.20      ok = {
    1.21        mode = "redirect",
    1.22 -      module = "index",
    1.23 -      view = "index"
    1.24 +      module = return_to == "home" and "index" or "member",
    1.25 +      view = return_to == "home" and "index" or "show",
    1.26 +      id = return_to ~= "home" and app.session.member_id or nil
    1.27      }
    1.28    },
    1.29    content = function()
    1.30 -    ui.tag{ tag = "p", content = _"I like to receive notifications by email about events in my areas and issues:" }
    1.31 -  
    1.32 -    ui.container{ content = function()
    1.33 -      ui.tag{
    1.34 -        tag = "input", 
    1.35 -        attr = {
    1.36 -          id = "notify_level_none",
    1.37 -          type = "radio", name = "notify_level", value = "none",
    1.38 -          checked = app.session.member.notify_level == 'none' and "checked" or nil
    1.39 -        }
    1.40 -      }
    1.41 -      ui.tag{
    1.42 -        tag = "label", attr = { ['for'] = "notify_level_none" },
    1.43 -        content = _"No notifications at all"
    1.44 -      }
    1.45 -    end }
    1.46 -     
    1.47 -    slot.put("<br />")
    1.48 -  
    1.49 -    ui.container{ content = function()
    1.50 -      ui.tag{
    1.51 -        tag = "input", 
    1.52 -        attr = {
    1.53 -          id = "notify_level_all",
    1.54 -          type = "radio", name = "notify_level", value = "all",
    1.55 -          checked = app.session.member.notify_level == 'all' and "checked" or nil
    1.56 -        }
    1.57 -      }
    1.58 -      ui.tag{
    1.59 -        tag = "label", attr = { ['for'] = "notify_level_all" },
    1.60 -        content = _"All of them"
    1.61 -      }
    1.62 -    end }
    1.63 +
    1.64 +    ui.section( function()
    1.65 +
    1.66 +      ui.sectionHead( function()
    1.67 +        ui.heading { level = 1, content = _"For which issue phases do you like to receive notification emails?" }
    1.68 +      end )
    1.69 +
    1.70      
    1.71 -    slot.put("<br />")
    1.72 +      ui.sectionRow( function()
    1.73 +      
    1.74 +        ui.container{ content = function()
    1.75 +          ui.tag{
    1.76 +            tag = "input", 
    1.77 +            attr = {
    1.78 +              id = "notify_level_all",
    1.79 +              type = "radio", name = "notify_level", value = "all",
    1.80 +              checked = app.session.member.notify_level == 'all' and "checked" or nil
    1.81 +            }
    1.82 +          }
    1.83 +          ui.tag{
    1.84 +            tag = "label", attr = { ['for'] = "notify_level_all" },
    1.85 +            content = _"I like to receive notifications"
    1.86 +          }
    1.87 +        end }
    1.88 +        
    1.89 +        slot.put("<br />")
    1.90 +
    1.91 +        ui.container{ content = function()
    1.92 +          ui.tag{
    1.93 +            tag = "input", 
    1.94 +            attr = {
    1.95 +              id = "notify_level_discussion",
    1.96 +              type = "radio", name = "notify_level", value = "discussion",
    1.97 +              checked = app.session.member.notify_level == 'discussion' and "checked" or nil
    1.98 +            }
    1.99 +          }
   1.100 +          ui.tag{
   1.101 +            tag = "label", attr = { ['for'] = "notify_level_discussion" },
   1.102 +            content = _"Only for issues reaching the discussion phase"
   1.103 +          }
   1.104 +        end }
   1.105 +
   1.106 +        slot.put("<br />")
   1.107  
   1.108 -    ui.container{ content = function()
   1.109 -      ui.tag{
   1.110 -        tag = "input", 
   1.111 -        attr = {
   1.112 -          id = "notify_level_discussion",
   1.113 -          type = "radio", name = "notify_level", value = "discussion",
   1.114 -          checked = app.session.member.notify_level == 'discussion' and "checked" or nil
   1.115 +        ui.container{ content = function()
   1.116 +          ui.tag{
   1.117 +            tag = "input", 
   1.118 +            attr = {
   1.119 +              id = "notify_level_verification",
   1.120 +              type = "radio", name = "notify_level", value = "verification",
   1.121 +              checked = app.session.member.notify_level == 'verification' and "checked" or nil
   1.122 +            }
   1.123 +          }
   1.124 +          ui.tag{
   1.125 +            tag = "label", attr = { ['for'] = "notify_level_verification" },
   1.126 +            content = _"Only for issues reaching the verification phase"
   1.127 +          }
   1.128 +        end }
   1.129 +        
   1.130 +        slot.put("<br />")
   1.131 +
   1.132 +        ui.container{ content = function()
   1.133 +          ui.tag{
   1.134 +            tag = "input", 
   1.135 +            attr = {
   1.136 +              id = "notify_level_voting",
   1.137 +              type = "radio", name = "notify_level", value = "voting",
   1.138 +              checked = app.session.member.notify_level == 'voting' and "checked" or nil
   1.139 +            }
   1.140 +          }
   1.141 +          ui.tag{
   1.142 +            tag = "label", attr = { ['for'] = "notify_level_voting" },
   1.143 +            content = _"Only for issues reaching the voting phase"
   1.144 +          }
   1.145 +        end }
   1.146 +
   1.147 +        slot.put("<br />")
   1.148 +
   1.149 +        ui.container{ content = function()
   1.150 +          ui.tag{
   1.151 +            tag = "input", 
   1.152 +            attr = {
   1.153 +              id = "notify_level_none",
   1.154 +              type = "radio", name = "notify_level", value = "none",
   1.155 +              checked = app.session.member.notify_level == 'none' and "checked" or nil
   1.156 +            }
   1.157 +          }
   1.158 +          ui.tag{
   1.159 +            tag = "label", attr = { ['for'] = "notify_level_none" },
   1.160 +            content = _"I do not like to receive notifications by email"
   1.161 +          }
   1.162 +        end }
   1.163 +        
   1.164 +        slot.put("<br />")
   1.165 +      
   1.166 +        ui.container { content = _"Notifications are only send to you about events in the subject areas you subscribed, the issues you are interested in and the initiatives you are supporting." }
   1.167 +
   1.168 +
   1.169 +        slot.put("<br />")
   1.170 +        
   1.171 +        ui.tag{
   1.172 +          tag = "input",
   1.173 +          attr = {
   1.174 +            type = "submit",
   1.175 +            class = "btn btn-default",
   1.176 +            value = _"Save"
   1.177 +          },
   1.178 +          content = ""
   1.179          }
   1.180 -      }
   1.181 -      ui.tag{
   1.182 -        tag = "label", attr = { ['for'] = "notify_level_discussion" },
   1.183 -        content = _"Only for issues reaching the discussion phase"
   1.184 -      }
   1.185 -    end }
   1.186 -
   1.187 -    slot.put("<br />")
   1.188 -
   1.189 -    ui.container{ content = function()
   1.190 -      ui.tag{
   1.191 -        tag = "input", 
   1.192 -        attr = {
   1.193 -          id = "notify_level_verification",
   1.194 -          type = "radio", name = "notify_level", value = "verification",
   1.195 -          checked = app.session.member.notify_level == 'verification' and "checked" or nil
   1.196 -        }
   1.197 -      }
   1.198 -      ui.tag{
   1.199 -        tag = "label", attr = { ['for'] = "notify_level_verification" },
   1.200 -        content = _"Only for issues reaching the frozen phase"
   1.201 -      }
   1.202 -    end }
   1.203 +        slot.put("<br /><br /><br />")
   1.204 +        
   1.205 +        slot.put(" ")
   1.206 +        if return_to == "home" then
   1.207 +          ui.link {
   1.208 +            module = "index", view = "index",
   1.209 +            content = _"cancel"
   1.210 +          }
   1.211 +        else
   1.212 +          ui.link {
   1.213 +            module = "member", view = "show", id = app.session.member_id, 
   1.214 +            content = _"cancel"
   1.215 +          }
   1.216 +        end
   1.217 +      end ) 
   1.218 +    end )
   1.219      
   1.220 -    slot.put("<br />")
   1.221 -
   1.222 -    ui.container{ content = function()
   1.223 -      ui.tag{
   1.224 -        tag = "input", 
   1.225 -        attr = {
   1.226 -          id = "notify_level_voting",
   1.227 -          type = "radio", name = "notify_level", value = "voting",
   1.228 -          checked = app.session.member.notify_level == 'voting' and "checked" or nil
   1.229 -        }
   1.230 -      }
   1.231 -      ui.tag{
   1.232 -        tag = "label", attr = { ['for'] = "notify_level_voting" },
   1.233 -        content = _"Only for issues reaching the voting phase"
   1.234 -      }
   1.235 -    end }
   1.236 -
   1.237 -    slot.put("<br />")
   1.238 -
   1.239 -    ui.submit{ value = _"Change notification settings" }
   1.240    end
   1.241  }
   1.242   

Impressum / About Us