mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-11 16:21:08 -05:00
20 lines
618 B
CoffeeScript
20 lines
618 B
CoffeeScript
|
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()
|
||
|
$("#email_translator").attr("checked", 1)
|
||
|
@hide()
|
||
|
return
|