mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 09:23:41 -04:00
Added /identify page.
This commit is contained in:
parent
c3bcd73e2a
commit
def6709c52
3 changed files with 37 additions and 0 deletions
app
|
@ -92,6 +92,8 @@ module.exports = class CocoRouter extends Backbone.Router
|
||||||
'i18n/campaign/:handle': go('i18n/I18NEditCampaignView')
|
'i18n/campaign/:handle': go('i18n/I18NEditCampaignView')
|
||||||
'i18n/poll/:handle': go('i18n/I18NEditPollView')
|
'i18n/poll/:handle': go('i18n/I18NEditPollView')
|
||||||
|
|
||||||
|
'identify': go('user/IdentifyView')
|
||||||
|
|
||||||
'legal': go('LegalView')
|
'legal': go('LegalView')
|
||||||
|
|
||||||
'multiplayer': go('MultiplayerView')
|
'multiplayer': go('MultiplayerView')
|
||||||
|
|
21
app/templates/user/identify-view.jade
Normal file
21
app/templates/user/identify-view.jade
Normal 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.
|
14
app/views/user/IdentifyView.coffee
Normal file
14
app/views/user/IdentifyView.coffee
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue