mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Put in pairwise simulation button
This commit is contained in:
parent
fdf1e21e72
commit
c418e282ae
3 changed files with 19 additions and 2 deletions
app
|
@ -75,7 +75,7 @@ module.exports = class Simulator
|
|||
type: "PUT"
|
||||
success: @handleTaskResultsTransferSuccess
|
||||
error: @handleTaskResultsTransferError
|
||||
complete: @cleanupAndSimulateAnotherTask()
|
||||
complete: @cleanupAndSimulateAnotherTask
|
||||
|
||||
handleTaskResultsTransferSuccess: (result) ->
|
||||
console.log "Task registration result: #{JSON.stringify result}"
|
||||
|
|
|
@ -5,7 +5,9 @@ block content
|
|||
h3= level.get('name')
|
||||
div#level-description
|
||||
!{description}
|
||||
|
||||
if me.isAdmin()
|
||||
button.btn.btn-warning.btn-lg.highlight#simulate-button(style="margin-bottom:10px") Simulate all games
|
||||
|
||||
div#leaderboard-column
|
||||
ul.nav.nav-pills
|
||||
for team in teams
|
||||
|
|
|
@ -28,6 +28,21 @@ module.exports = class LadderView extends RootView
|
|||
id: 'ladder-view'
|
||||
template: require 'templates/play/ladder'
|
||||
startsLoading: true
|
||||
|
||||
events:
|
||||
'click #simulate-button': 'onSimulateButtonClick'
|
||||
|
||||
onSimulateButtonClick: (e) ->
|
||||
submitIDs = _.pluck @leaderboards[@teams[0]].topPlayers.models, "id"
|
||||
for ID in submitIDs
|
||||
$.ajax
|
||||
url: '/queue/scoring'
|
||||
method: 'POST'
|
||||
data:
|
||||
session: ID
|
||||
alert "Simulating all games!"
|
||||
alert "(do not push more than once pls)"
|
||||
|
||||
|
||||
constructor: (options, levelID) ->
|
||||
super(options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue