2014-11-28 20:49:41 -05:00
|
|
|
ModalView = require 'views/core/ModalView'
|
2014-11-29 14:39:37 -05:00
|
|
|
template = require 'templates/core/diplomat-suggestion'
|
2014-11-28 20:49:41 -05:00
|
|
|
{me} = require 'core/auth'
|
|
|
|
forms = require 'core/forms'
|
2014-01-03 13:32:13 -05:00
|
|
|
|
2014-07-23 10:02:45 -04:00
|
|
|
module.exports = class DiplomatSuggestionModal extends ModalView
|
2014-06-30 22:16:26 -04:00
|
|
|
id: 'diplomat-suggestion-modal'
|
2014-01-03 13:32:13 -05:00
|
|
|
template: template
|
|
|
|
|
|
|
|
events:
|
2014-06-30 22:16:26 -04:00
|
|
|
'click #subscribe-button': 'subscribeAsDiplomat'
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
subscribeAsDiplomat: ->
|
2014-04-21 19:15:23 -04:00
|
|
|
me.setEmailSubscription 'diplomatNews', true
|
2014-06-11 16:16:17 -04:00
|
|
|
me.patch()
|
2014-06-30 22:16:26 -04:00
|
|
|
$('#email_translator').prop('checked', 1)
|
2014-01-03 13:32:13 -05:00
|
|
|
@hide()
|
2015-04-13 18:14:36 -04:00
|
|
|
noty {
|
|
|
|
text: $.i18n.t 'account_settings.saved'
|
|
|
|
layout: 'topCenter'
|
|
|
|
timeout: 5000
|
|
|
|
type: 'information'
|
|
|
|
}
|
|
|
|
Backbone.Mediator.publish 'router:navigate',
|
|
|
|
route: "/contribute/diplomat"
|