| rev | 
   line source | 
| 
bsw@286
 | 
     1 slot.put_into("title", _"Notification settings")
 | 
| 
bsw@286
 | 
     2 
 | 
| 
bsw@286
 | 
     3 slot.select("actions", function()
 | 
| 
bsw@286
 | 
     4   ui.link{
 | 
| 
bsw@286
 | 
     5     content = function()
 | 
| 
bsw@286
 | 
     6         ui.image{ static = "icons/16/cancel.png" }
 | 
| 
bsw@286
 | 
     7         slot.put(_"Cancel")
 | 
| 
bsw@286
 | 
     8     end,
 | 
| 
bsw@286
 | 
     9     module = "member",
 | 
| 
bsw@286
 | 
    10     view = "settings"
 | 
| 
bsw@286
 | 
    11   }
 | 
| 
bsw@286
 | 
    12 end)
 | 
| 
bsw@286
 | 
    13 
 | 
| 
bsw@286
 | 
    14 
 | 
| 
bsw@286
 | 
    15 util.help("member.settings.notification", _"Notification settings")
 | 
| 
bsw@286
 | 
    16 
 | 
| 
bsw@286
 | 
    17 ui.form{
 | 
| 
bsw@286
 | 
    18   attr = { class = "vertical" },
 | 
| 
bsw@286
 | 
    19   module = "member",
 | 
| 
bsw@348
 | 
    20   action = "update_notify_level",
 | 
| 
bsw@286
 | 
    21   routing = {
 | 
| 
bsw@286
 | 
    22     ok = {
 | 
| 
bsw@286
 | 
    23       mode = "redirect",
 | 
| 
bsw@286
 | 
    24       module = "index",
 | 
| 
bsw@286
 | 
    25       view = "index"
 | 
| 
bsw@286
 | 
    26     }
 | 
| 
bsw@286
 | 
    27   },
 | 
| 
bsw@286
 | 
    28   content = function()
 | 
| 
bsw@286
 | 
    29     ui.tag{ tag = "p", _"Send me notifications about issues in following phases:" }
 | 
| 
bsw@286
 | 
    30   
 | 
| 
bsw@286
 | 
    31     ui.container{ content = function()
 | 
| 
bsw@286
 | 
    32       ui.tag{
 | 
| 
bsw@286
 | 
    33         tag = "input", 
 | 
| 
bsw@348
 | 
    34         attr = {
 | 
| 
bsw@348
 | 
    35           type = "radio", name = "notify_level", value = "voting",
 | 
| 
bsw@348
 | 
    36           checked = app.session.member.notify_level == 'voting' and "checked" or nil
 | 
| 
bsw@348
 | 
    37         }
 | 
| 
bsw@286
 | 
    38       }
 | 
| 
bsw@286
 | 
    39       ui.tag{ content = _"Voting phase" }
 | 
| 
bsw@286
 | 
    40       ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@286
 | 
    41         ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" }
 | 
| 
bsw@286
 | 
    42       end }
 | 
| 
bsw@286
 | 
    43     end }
 | 
| 
bsw@286
 | 
    44 
 | 
| 
bsw@286
 | 
    45     ui.container{ content = function()
 | 
| 
bsw@286
 | 
    46       ui.tag{
 | 
| 
bsw@286
 | 
    47         tag = "input", 
 | 
| 
bsw@348
 | 
    48         attr = {
 | 
| 
bsw@348
 | 
    49           type = "radio", name = "notify_level", value = "verification",
 | 
| 
bsw@348
 | 
    50           checked = app.session.member.notify_level == 'verification' and "checked" or nil
 | 
| 
bsw@348
 | 
    51         }
 | 
| 
bsw@286
 | 
    52       }
 | 
| 
bsw@286
 | 
    53       ui.tag{ content = _"Frozen and voting phase" }
 | 
| 
bsw@286
 | 
    54       ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@286
 | 
    55         ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" }
 | 
| 
bsw@286
 | 
    56         ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" }
 | 
| 
bsw@286
 | 
    57         ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" }
 | 
| 
bsw@286
 | 
    58       end }
 | 
| 
bsw@286
 | 
    59     end }
 | 
| 
bsw@286
 | 
    60 
 | 
| 
bsw@286
 | 
    61     ui.container{ content = function()
 | 
| 
bsw@286
 | 
    62       ui.tag{
 | 
| 
bsw@286
 | 
    63         tag = "input", 
 | 
| 
bsw@348
 | 
    64         attr = {
 | 
| 
bsw@348
 | 
    65           type = "radio", name = "notify_level", value = "discussion",
 | 
| 
bsw@348
 | 
    66           checked = app.session.member.notify_level == 'discussion' and "checked" or nil
 | 
| 
bsw@348
 | 
    67         }
 | 
| 
bsw@286
 | 
    68       }
 | 
| 
bsw@286
 | 
    69       ui.tag{ content = _"Discussion, frozen and voting phase" }
 | 
| 
bsw@286
 | 
    70       ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@286
 | 
    71         ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'discussion'" }
 | 
| 
bsw@286
 | 
    72         ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" }
 | 
| 
bsw@286
 | 
    73         ui.tag{ tag = "li", content = _"The draft of an initiative I'm supporting is updated" }
 | 
| 
bsw@286
 | 
    74         ui.tag{ tag = "li", content = _"An initiative I was supporting is revoked" }
 | 
| 
bsw@286
 | 
    75         ui.tag{ tag = "li", content = _"A new suggestion is created in an initiative I'm supporting" }
 | 
| 
bsw@286
 | 
    76         ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" }
 | 
| 
bsw@286
 | 
    77         ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" }
 | 
| 
bsw@286
 | 
    78       end }
 | 
| 
bsw@286
 | 
    79     end }
 | 
| 
bsw@286
 | 
    80 
 | 
| 
bsw@286
 | 
    81     ui.container{ content = function()
 | 
| 
bsw@286
 | 
    82       ui.tag{
 | 
| 
bsw@286
 | 
    83         tag = "input", 
 | 
| 
bsw@348
 | 
    84         attr = {
 | 
| 
bsw@348
 | 
    85           type = "radio", name = "notify_level", value = "all",
 | 
| 
bsw@348
 | 
    86           checked = app.session.member.notify_level == 'all' and "checked" or nil
 | 
| 
bsw@348
 | 
    87         }
 | 
| 
bsw@286
 | 
    88       }
 | 
| 
bsw@286
 | 
    89       ui.tag{ content = _"Any phase" }
 | 
| 
bsw@286
 | 
    90       ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@286
 | 
    91         ui.tag{ tag = "li", content = _"A new issue is created in one of my areas" }
 | 
| 
bsw@286
 | 
    92         ui.tag{ tag = "li", content = _"An issue in one of my areas or i'm interested in enters phase 'discussion'" }
 | 
| 
bsw@286
 | 
    93         ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" }
 | 
| 
bsw@286
 | 
    94         ui.tag{ tag = "li", content = _"The draft of an initiative I'm supporting is updated" }
 | 
| 
bsw@286
 | 
    95         ui.tag{ tag = "li", content = _"An initiative I was supporting is revoked" }
 | 
| 
bsw@286
 | 
    96         ui.tag{ tag = "li", content = _"A new suggestion is created in an initiative I'm supporting" }
 | 
| 
bsw@286
 | 
    97         ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" }
 | 
| 
bsw@286
 | 
    98         ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" }
 | 
| 
bsw@286
 | 
    99       end }
 | 
| 
bsw@286
 | 
   100     end }
 | 
| 
bsw@286
 | 
   101 
 | 
| 
bsw@286
 | 
   102     ui.container{ content = function()
 | 
| 
bsw@286
 | 
   103       ui.tag{
 | 
| 
bsw@286
 | 
   104         tag = "input", 
 | 
| 
bsw@348
 | 
   105         attr = {
 | 
| 
bsw@348
 | 
   106           type = "radio", name = "notify_level", value = "none",
 | 
| 
bsw@348
 | 
   107           checked = app.session.member.notify_level == 'none' and "checked" or nil
 | 
| 
bsw@348
 | 
   108         }
 | 
| 
bsw@286
 | 
   109       }
 | 
| 
bsw@286
 | 
   110       ui.tag{ content = _"No notifications at all" }
 | 
| 
bsw@286
 | 
   111     end }
 | 
| 
bsw@286
 | 
   112 
 | 
| 
bsw@286
 | 
   113 
 | 
| 
bsw@286
 | 
   114     
 | 
| 
bsw@348
 | 
   115     ui.submit{ value = _"Change notification settings" }
 | 
| 
bsw@286
 | 
   116   end
 | 
| 
bsw@286
 | 
   117 }
 | 
| 
bsw@287
 | 
   118  
 | 
| 
bsw@286
 | 
   119 -- 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; |