liquid_feedback_frontend
view app/main/member/settings_notification.lua @ 474:4e5bb26f0335
Notifications settings page is much easier now
| author | bsw | 
|---|---|
| date | Wed Mar 14 18:54:55 2012 +0100 (2012-03-14) | 
| parents | 9e6a23f11f32 | 
| children | 0fce0bdf7ce1 | 
 line source
     1 slot.put_into("title", _"Notification settings")
     3 slot.select("actions", function()
     4   ui.link{
     5     content = function()
     6         ui.image{ static = "icons/16/cancel.png" }
     7         slot.put(_"Cancel")
     8     end,
     9     module = "member",
    10     view = "settings"
    11   }
    12 end)
    15 util.help("member.settings.notification", _"Notification settings")
    17 ui.form{
    18   attr = { class = "vertical" },
    19   module = "member",
    20   action = "update_notify_level",
    21   routing = {
    22     ok = {
    23       mode = "redirect",
    24       module = "index",
    25       view = "index"
    26     }
    27   },
    28   content = function()
    29     ui.tag{ tag = "p", content = _"I like to receive notifications about events in my areas and issues:" }
    31     ui.container{ content = function()
    32       ui.tag{
    33         tag = "input", 
    34         attr = {
    35           id = "notify_level_none",
    36           type = "radio", name = "notify_level", value = "none",
    37           checked = app.session.member.notify_level == 'none' and "checked" or nil
    38         }
    39       }
    40       ui.tag{
    41         tag = "label", attr = { ['for'] = "notify_level_none" },
    42         content = _"No notifications at all"
    43       }
    44     end }
    46     slot.put("<br />")
    48     ui.container{ content = function()
    49       ui.tag{
    50         tag = "input", 
    51         attr = {
    52           id = "notify_level_all",
    53           type = "radio", name = "notify_level", value = "all",
    54           checked = app.session.member.notify_level == 'all' and "checked" or nil
    55         }
    56       }
    57       ui.tag{
    58         tag = "label", attr = { ['for'] = "notify_level_all" },
    59         content = _"All of them"
    60       }
    61     end }
    63     slot.put("<br />")
    65     ui.container{ content = function()
    66       ui.tag{
    67         tag = "input", 
    68         attr = {
    69           id = "notify_level_discussion",
    70           type = "radio", name = "notify_level", value = "discussion",
    71           checked = app.session.member.notify_level == 'discussion' and "checked" or nil
    72         }
    73       }
    74       ui.tag{
    75         tag = "label", attr = { ['for'] = "notify_level_discussion" },
    76         content = _"Only for issues reaching the discussion phase"
    77       }
    78     end }
    80     slot.put("<br />")
    82     ui.container{ content = function()
    83       ui.tag{
    84         tag = "input", 
    85         attr = {
    86           id = "notify_level_verification",
    87           type = "radio", name = "notify_level", value = "verification",
    88           checked = app.session.member.notify_level == 'verification' and "checked" or nil
    89         }
    90       }
    91       ui.tag{
    92         tag = "label", attr = { ['for'] = "notify_level_verification" },
    93         content = _"Only for issues reaching the frozen phase"
    94       }
    95     end }
    97     slot.put("<br />")
    99     ui.container{ content = function()
   100       ui.tag{
   101         tag = "input", 
   102         attr = {
   103           id = "notify_level_voting",
   104           type = "radio", name = "notify_level", value = "voting",
   105           checked = app.session.member.notify_level == 'voting' and "checked" or nil
   106         }
   107       }
   108       ui.tag{
   109         tag = "label", attr = { ['for'] = "notify_level_voting" },
   110         content = _"Only for issues reaching the voting phase"
   111       }
   112     end }
   114     slot.put("<br />")
   116     ui.submit{ value = _"Change notification settings" }
   117   end
   118 }
   120 -- select event.id, event.occurrence, membership.member_id NOTNULL as membership, interest.member_id NOTNULL as interest, supporter.member_id NOTNULL as supporter, event.event, event.state, issue.id, initiative.name FROM event JOIN issue ON issue.id = event.issue_id LEFT JOIN membership ON membership.area_id = issue.area_id AND membership.member_id = 41 LEFT JOIN interest ON interest.issue_id = issue.id AND interest.member_id = 41 LEFT JOIN initiative ON initiative.id = event.initiative_id LEFT JOIN supporter ON supporter.initiative_id = initiative.id AND supporter.member_id = 41 WHERE (((event.event = 'issue_state_changed' OR event.event = 'initiative_created_in_new_issue') AND membership.member_id NOTNULL OR interest.member_id NOTNULL) OR (event.event = 'initiative_created_in_existing_issue' AND interest.member_id NOTNULL) OR ((event.event = 'initiative_revoked' OR event.event = 'new_draft_created' OR event.event = 'suggestion_created') AND supporter.member_id NOTNULL)) AND event.id > 7000 ORDER by event.id ASC LIMIT 1;
