Replaced rank button with button going to ladder page

This commit is contained in:
Michael Schmatz 2014-02-20 10:14:25 -08:00
parent 7c5192820f
commit cb0c22f0c9
2 changed files with 5 additions and 9 deletions

View file

@ -29,7 +29,8 @@
if me.get('anonymous') if me.get('anonymous')
p Sign in or create an account and get your solution on the leaderboard! p Sign in or create an account and get your solution on the leaderboard!
else else
#submit-session-button.btn.btn-primary Update Ladder Score a#go-to-leaderboard-button.btn.btn-primary(href="/play/ladder/#{levelSlug}/team/#{team}") Go to the leaderboard!
p You can submit your game to be ranked from the leaderboard page.
.modal-footer .modal-footer
a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="modal.close").btn.btn-primary Close a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="modal.close").btn.btn-primary Close

View file

@ -9,7 +9,7 @@ module.exports = class MultiplayerModal extends View
events: events:
'click textarea': 'onClickLink' 'click textarea': 'onClickLink'
'change #multiplayer': 'updateLinkSection' 'change #multiplayer': 'updateLinkSection'
'click #submit-session-button': 'submitSession'
constructor: (options) -> constructor: (options) ->
super(options) super(options)
@ -24,6 +24,8 @@ module.exports = class MultiplayerModal extends View
'?session=' + '?session=' +
@session.id) @session.id)
c.multiplayer = @session.get('multiplayer') c.multiplayer = @session.get('multiplayer')
c.team = @session.get 'team'
c.levelSlug = @level?.get('slug')
c.playableTeams = @playableTeams c.playableTeams = @playableTeams
c.ladderGame = @level?.get('name') is 'Project DotA' and not me.get('isAnonymous') c.ladderGame = @level?.get('name') is 'Project DotA' and not me.get('isAnonymous')
c c
@ -41,13 +43,6 @@ module.exports = class MultiplayerModal extends View
la.toggle Boolean(multiplayer) la.toggle Boolean(multiplayer)
true true
submitSession: ->
$.ajax('/queue/scoring', {
method: 'POST'
data:
session: @session.id
})
onHidden: -> onHidden: ->
multiplayer = Boolean(@$el.find('#multiplayer').prop('checked')) multiplayer = Boolean(@$el.find('#multiplayer').prop('checked'))
@session.set('multiplayer', multiplayer) @session.set('multiplayer', multiplayer)