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,6 +5,8 @@ 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
|
||||
|
|
|
@ -29,6 +29,21 @@ module.exports = class LadderView extends RootView
|
|||
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)
|
||||
@level = new Level(_id:levelID)
|
||||
|
|
Reference in a new issue