Added /identify page.

This commit is contained in:
Nick Winter 2015-04-30 13:35:21 -07:00
parent c3bcd73e2a
commit def6709c52
3 changed files with 37 additions and 0 deletions

View file

@ -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')

View file

@ -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.

View file

@ -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