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"
|
type: "PUT"
|
||||||
success: @handleTaskResultsTransferSuccess
|
success: @handleTaskResultsTransferSuccess
|
||||||
error: @handleTaskResultsTransferError
|
error: @handleTaskResultsTransferError
|
||||||
complete: @cleanupAndSimulateAnotherTask()
|
complete: @cleanupAndSimulateAnotherTask
|
||||||
|
|
||||||
handleTaskResultsTransferSuccess: (result) ->
|
handleTaskResultsTransferSuccess: (result) ->
|
||||||
console.log "Task registration result: #{JSON.stringify result}"
|
console.log "Task registration result: #{JSON.stringify result}"
|
||||||
|
|
|
@ -5,7 +5,9 @@ block content
|
||||||
h3= level.get('name')
|
h3= level.get('name')
|
||||||
div#level-description
|
div#level-description
|
||||||
!{description}
|
!{description}
|
||||||
|
if me.isAdmin()
|
||||||
|
button.btn.btn-warning.btn-lg.highlight#simulate-button(style="margin-bottom:10px") Simulate all games
|
||||||
|
|
||||||
div#leaderboard-column
|
div#leaderboard-column
|
||||||
ul.nav.nav-pills
|
ul.nav.nav-pills
|
||||||
for team in teams
|
for team in teams
|
||||||
|
|
|
@ -28,6 +28,21 @@ module.exports = class LadderView extends RootView
|
||||||
id: 'ladder-view'
|
id: 'ladder-view'
|
||||||
template: require 'templates/play/ladder'
|
template: require 'templates/play/ladder'
|
||||||
startsLoading: true
|
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) ->
|
constructor: (options, levelID) ->
|
||||||
super(options)
|
super(options)
|
||||||
|
|
Reference in a new issue