bsw@286: slot.put_into("title", _"Notification settings") bsw@286: bsw@286: slot.select("actions", function() bsw@286: ui.link{ bsw@286: content = function() bsw@286: ui.image{ static = "icons/16/cancel.png" } bsw@286: slot.put(_"Cancel") bsw@286: end, bsw@286: module = "member", bsw@286: view = "settings" bsw@286: } bsw@286: end) bsw@286: bsw@286: bsw@286: util.help("member.settings.notification", _"Notification settings") bsw@286: bsw@286: ui.form{ bsw@286: attr = { class = "vertical" }, bsw@286: module = "member", bsw@348: action = "update_notify_level", bsw@286: routing = { bsw@286: ok = { bsw@286: mode = "redirect", bsw@286: module = "index", bsw@286: view = "index" bsw@286: } bsw@286: }, bsw@286: content = function() bsw@286: ui.tag{ tag = "p", _"Send me notifications about issues in following phases:" } bsw@286: bsw@286: ui.container{ content = function() bsw@286: ui.tag{ bsw@286: tag = "input", bsw@348: attr = { bsw@348: type = "radio", name = "notify_level", value = "voting", bsw@348: checked = app.session.member.notify_level == 'voting' and "checked" or nil bsw@348: } bsw@286: } bsw@286: ui.tag{ content = _"Voting phase" } bsw@286: ui.tag{ tag = "ul", content = function() bsw@286: ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" } bsw@286: end } bsw@286: end } bsw@286: bsw@286: ui.container{ content = function() bsw@286: ui.tag{ bsw@286: tag = "input", bsw@348: attr = { bsw@348: type = "radio", name = "notify_level", value = "verification", bsw@348: checked = app.session.member.notify_level == 'verification' and "checked" or nil bsw@348: } bsw@286: } bsw@286: ui.tag{ content = _"Frozen and voting phase" } bsw@286: ui.tag{ tag = "ul", content = function() bsw@286: ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" } bsw@286: ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" } bsw@286: ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" } bsw@286: end } bsw@286: end } bsw@286: bsw@286: ui.container{ content = function() bsw@286: ui.tag{ bsw@286: tag = "input", bsw@348: attr = { bsw@348: type = "radio", name = "notify_level", value = "discussion", bsw@348: checked = app.session.member.notify_level == 'discussion' and "checked" or nil bsw@348: } bsw@286: } bsw@286: ui.tag{ content = _"Discussion, frozen and voting phase" } bsw@286: ui.tag{ tag = "ul", content = function() bsw@286: ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'discussion'" } bsw@286: ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" } bsw@286: ui.tag{ tag = "li", content = _"The draft of an initiative I'm supporting is updated" } bsw@286: ui.tag{ tag = "li", content = _"An initiative I was supporting is revoked" } bsw@286: ui.tag{ tag = "li", content = _"A new suggestion is created in an initiative I'm supporting" } bsw@286: ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" } bsw@286: ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" } bsw@286: end } bsw@286: end } bsw@286: bsw@286: ui.container{ content = function() bsw@286: ui.tag{ bsw@286: tag = "input", bsw@348: attr = { bsw@348: type = "radio", name = "notify_level", value = "all", bsw@348: checked = app.session.member.notify_level == 'all' and "checked" or nil bsw@348: } bsw@286: } bsw@286: ui.tag{ content = _"Any phase" } bsw@286: ui.tag{ tag = "ul", content = function() bsw@286: ui.tag{ tag = "li", content = _"A new issue is created in one of my areas" } bsw@286: ui.tag{ tag = "li", content = _"An issue in one of my areas or i'm interested in enters phase 'discussion'" } bsw@286: ui.tag{ tag = "li", content = _"A new initiative is created in an issue I'm interested in" } bsw@286: ui.tag{ tag = "li", content = _"The draft of an initiative I'm supporting is updated" } bsw@286: ui.tag{ tag = "li", content = _"An initiative I was supporting is revoked" } bsw@286: ui.tag{ tag = "li", content = _"A new suggestion is created in an initiative I'm supporting" } bsw@286: ui.tag{ tag = "li", content = _"An issue in one of my areas or I'm interested in enters phase 'frozen'" } bsw@286: ui.tag{ tag = "li", content = _"Voting of an issue in one of my areas or I'm interested in starts" } bsw@286: end } bsw@286: end } bsw@286: bsw@286: ui.container{ content = function() bsw@286: ui.tag{ bsw@286: tag = "input", bsw@348: attr = { bsw@348: type = "radio", name = "notify_level", value = "none", bsw@348: checked = app.session.member.notify_level == 'none' and "checked" or nil bsw@348: } bsw@286: } bsw@286: ui.tag{ content = _"No notifications at all" } bsw@286: end } bsw@286: bsw@286: bsw@286: bsw@348: ui.submit{ value = _"Change notification settings" } bsw@286: end bsw@286: } bsw@287: bsw@286: -- 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;