| 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@286
 | 
    20   action = "update_notification",
 | 
| 
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@286
 | 
    34         attr = { type = "radio", name = "notification_level", value = "voting" }
 | 
| 
bsw@286
 | 
    35       }
 | 
| 
bsw@286
 | 
    36       ui.tag{ content = _"Voting phase" }
 | 
| 
bsw@286
 | 
    37       ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@286
 | 
    38         ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" }
 | 
| 
bsw@286
 | 
    39       end }
 | 
| 
bsw@286
 | 
    40     end }
 | 
| 
bsw@286
 | 
    41 
 | 
| 
bsw@286
 | 
    42     ui.container{ content = function()
 | 
| 
bsw@286
 | 
    43       ui.tag{
 | 
| 
bsw@286
 | 
    44         tag = "input", 
 | 
| 
bsw@286
 | 
    45         attr = { type = "radio", name = "notification_level", value = "frozen" }
 | 
| 
bsw@286
 | 
    46       }
 | 
| 
bsw@286
 | 
    47       ui.tag{ content = _"Frozen and voting phase" }
 | 
| 
bsw@286
 | 
    48       ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@286
 | 
    49         ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" }
 | 
| 
bsw@286
 | 
    50         ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" }
 | 
| 
bsw@286
 | 
    51         ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" }
 | 
| 
bsw@286
 | 
    52       end }
 | 
| 
bsw@286
 | 
    53     end }
 | 
| 
bsw@286
 | 
    54 
 | 
| 
bsw@286
 | 
    55     ui.container{ content = function()
 | 
| 
bsw@286
 | 
    56       ui.tag{
 | 
| 
bsw@286
 | 
    57         tag = "input", 
 | 
| 
bsw@286
 | 
    58         attr = { type = "radio", name = "notification_level", value = "discussion" }
 | 
| 
bsw@286
 | 
    59       }
 | 
| 
bsw@286
 | 
    60       ui.tag{ content = _"Discussion, frozen and voting phase" }
 | 
| 
bsw@286
 | 
    61       ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@286
 | 
    62         ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'discussion'" }
 | 
| 
bsw@286
 | 
    63         ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" }
 | 
| 
bsw@286
 | 
    64         ui.tag{ tag = "li", content = _"The draft of an initiative I'm supporting is updated" }
 | 
| 
bsw@286
 | 
    65         ui.tag{ tag = "li", content = _"An initiative I was supporting is revoked" }
 | 
| 
bsw@286
 | 
    66         ui.tag{ tag = "li", content = _"A new suggestion is created in an initiative I'm supporting" }
 | 
| 
bsw@286
 | 
    67         ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" }
 | 
| 
bsw@286
 | 
    68         ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" }
 | 
| 
bsw@286
 | 
    69       end }
 | 
| 
bsw@286
 | 
    70     end }
 | 
| 
bsw@286
 | 
    71 
 | 
| 
bsw@286
 | 
    72     ui.container{ content = function()
 | 
| 
bsw@286
 | 
    73       ui.tag{
 | 
| 
bsw@286
 | 
    74         tag = "input", 
 | 
| 
bsw@286
 | 
    75         attr = { type = "radio", name = "notification_level", value = "any" }
 | 
| 
bsw@286
 | 
    76       }
 | 
| 
bsw@286
 | 
    77       ui.tag{ content = _"Any phase" }
 | 
| 
bsw@286
 | 
    78       ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@286
 | 
    79         ui.tag{ tag = "li", content = _"A new issue is created in one of my areas" }
 | 
| 
bsw@286
 | 
    80         ui.tag{ tag = "li", content = _"An issue in one of my areas or i'm interested in enters phase 'discussion'" }
 | 
| 
bsw@286
 | 
    81         ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" }
 | 
| 
bsw@286
 | 
    82         ui.tag{ tag = "li", content = _"The draft of an initiative I'm supporting is updated" }
 | 
| 
bsw@286
 | 
    83         ui.tag{ tag = "li", content = _"An initiative I was supporting is revoked" }
 | 
| 
bsw@286
 | 
    84         ui.tag{ tag = "li", content = _"A new suggestion is created in an initiative I'm supporting" }
 | 
| 
bsw@286
 | 
    85         ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" }
 | 
| 
bsw@286
 | 
    86         ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" }
 | 
| 
bsw@286
 | 
    87       end }
 | 
| 
bsw@286
 | 
    88     end }
 | 
| 
bsw@286
 | 
    89 
 | 
| 
bsw@286
 | 
    90     ui.container{ content = function()
 | 
| 
bsw@286
 | 
    91       ui.tag{
 | 
| 
bsw@286
 | 
    92         tag = "input", 
 | 
| 
bsw@286
 | 
    93         attr = { type = "radio", name = "notification_level", value = "none" }
 | 
| 
bsw@286
 | 
    94       }
 | 
| 
bsw@286
 | 
    95       ui.tag{ content = _"No notifications at all" }
 | 
| 
bsw@286
 | 
    96     end }
 | 
| 
bsw@286
 | 
    97 
 | 
| 
bsw@286
 | 
    98 
 | 
| 
bsw@286
 | 
    99     
 | 
| 
bsw@286
 | 
   100     ui.submit{ value = _"Change display settings" }
 | 
| 
bsw@286
 | 
   101   end
 | 
| 
bsw@286
 | 
   102 }
 | 
| 
bsw@287
 | 
   103  
 | 
| 
bsw@286
 | 
   104 -- 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; |