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@474: ui.tag{ tag = "p", content = _"I like to receive notifications about events in my areas and issues:" }
bsw@286:
bsw@286: ui.container{ content = function()
bsw@286: ui.tag{
bsw@286: tag = "input",
bsw@348: attr = {
bsw@474: id = "notify_level_none",
bsw@474: type = "radio", name = "notify_level", value = "none",
bsw@474: checked = app.session.member.notify_level == 'none' and "checked" or nil
bsw@348: }
bsw@286: }
bsw@474: ui.tag{
bsw@474: tag = "label", attr = { ['for'] = "notify_level_none" },
bsw@474: content = _"No notifications at all"
bsw@474: }
bsw@286: end }
bsw@474:
bsw@474: slot.put("
")
bsw@474:
bsw@286: ui.container{ content = function()
bsw@286: ui.tag{
bsw@286: tag = "input",
bsw@348: attr = {
bsw@474: id = "notify_level_all",
bsw@474: type = "radio", name = "notify_level", value = "all",
bsw@474: checked = app.session.member.notify_level == 'all' and "checked" or nil
bsw@348: }
bsw@286: }
bsw@474: ui.tag{
bsw@474: tag = "label", attr = { ['for'] = "notify_level_all" },
bsw@474: content = _"All of them"
bsw@474: }
bsw@286: end }
bsw@474:
bsw@474: slot.put("
")
bsw@286:
bsw@286: ui.container{ content = function()
bsw@286: ui.tag{
bsw@286: tag = "input",
bsw@348: attr = {
bsw@474: id = "notify_level_discussion",
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@474: ui.tag{
bsw@474: tag = "label", attr = { ['for'] = "notify_level_discussion" },
bsw@474: content = _"Only for issues reaching the discussion phase"
bsw@474: }
bsw@286: end }
bsw@286:
bsw@474: slot.put("
")
bsw@474:
bsw@286: ui.container{ content = function()
bsw@286: ui.tag{
bsw@286: tag = "input",
bsw@348: attr = {
bsw@474: id = "notify_level_verification",
bsw@474: type = "radio", name = "notify_level", value = "verification",
bsw@474: checked = app.session.member.notify_level == 'verification' and "checked" or nil
bsw@348: }
bsw@286: }
bsw@474: ui.tag{
bsw@474: tag = "label", attr = { ['for'] = "notify_level_verification" },
bsw@474: content = _"Only for issues reaching the frozen phase"
bsw@474: }
bsw@286: end }
bsw@474:
bsw@474: slot.put("
")
bsw@286:
bsw@286: ui.container{ content = function()
bsw@286: ui.tag{
bsw@286: tag = "input",
bsw@348: attr = {
bsw@474: id = "notify_level_voting",
bsw@474: type = "radio", name = "notify_level", value = "voting",
bsw@474: checked = app.session.member.notify_level == 'voting' and "checked" or nil
bsw@348: }
bsw@286: }
bsw@474: ui.tag{
bsw@474: tag = "label", attr = { ['for'] = "notify_level_voting" },
bsw@474: content = _"Only for issues reaching the voting phase"
bsw@474: }
bsw@286: end }
bsw@286:
bsw@474: slot.put("
")
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;