diff --git a/app/core/Router.coffee b/app/core/Router.coffee index 21a002e79..0d2f4b0ec 100644 --- a/app/core/Router.coffee +++ b/app/core/Router.coffee @@ -92,6 +92,8 @@ module.exports = class CocoRouter extends Backbone.Router 'i18n/campaign/:handle': go('i18n/I18NEditCampaignView') 'i18n/poll/:handle': go('i18n/I18NEditPollView') + 'identify': go('user/IdentifyView') + 'legal': go('LegalView') 'multiplayer': go('MultiplayerView') diff --git a/app/templates/user/identify-view.jade b/app/templates/user/identify-view.jade new file mode 100644 index 000000000..a5a8db09d --- /dev/null +++ b/app/templates/user/identify-view.jade @@ -0,0 +1,21 @@ +extends /templates/base + +block content + + if callbackURL && callbackSource && callbackID + h3 Share your username? + p + | #{callbackSource} would like to know that you are #{me.get('name') || 'you'} on CodeCombat. + if me.get('anonymous') + br + button.btn.btn-lg.btn-default.header-font.login-button(data-i18n="login.log_in") + else if me.get('name') + a.spl.spr(href="#{callbackURL}") Click here + | to share your username. + else + | But you don't have a username yet. Set one + a.spl(href="/account/settings") here + | . + else + h3 Invalid identify URL. + p callbackID, callbackURL, and callbackSource are needed. diff --git a/app/views/user/IdentifyView.coffee b/app/views/user/IdentifyView.coffee new file mode 100644 index 000000000..65d4ab1ae --- /dev/null +++ b/app/views/user/IdentifyView.coffee @@ -0,0 +1,14 @@ +RootView = require 'views/core/RootView' +{me} = require 'core/auth' +template = require 'templates/user/identify-view' + +module.exports = class IdentifyView extends RootView + id: 'identify-view' + template: template + + getRenderData: -> + context = super() + context.callbackID = @getQueryVariable 'id' + context.callbackURL = @getQueryVariable('callback') + "?id=#{context.callbackID}&username=#{me.get('name')}" + context.callbackSource = @getQueryVariable 'source' + context