2014-01-03 13:32:13 -05:00
|
|
|
View = require 'views/kinds/ModalView'
|
|
|
|
template = require 'templates/modal/diplomat_suggestion'
|
|
|
|
{me} = require('lib/auth')
|
|
|
|
forms = require('lib/forms')
|
|
|
|
|
|
|
|
module.exports = class DiplomatSuggestionView extends View
|
|
|
|
id: "diplomat-suggestion-modal"
|
|
|
|
template: template
|
|
|
|
|
|
|
|
events:
|
|
|
|
"click #subscribe-button": "subscribeAsDiplomat"
|
|
|
|
|
|
|
|
subscribeAsDiplomat: ->
|
|
|
|
currentSubscriptions = me.get("emailSubscriptions")
|
|
|
|
me.set("emailSubscriptions", currentSubscriptions.concat ["translator"]) if "translator" not in currentSubscriptions
|
|
|
|
me.save()
|
2014-01-04 18:49:13 -05:00
|
|
|
$("#email_translator").prop("checked", 1)
|
2014-01-03 13:32:13 -05:00
|
|
|
@hide()
|
|
|
|
return
|