mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Add enabling users to ClassroomView
This commit is contained in:
parent
cbdef392c5
commit
af136764de
2 changed files with 10 additions and 2 deletions
|
@ -49,7 +49,7 @@ block content
|
|||
.progress
|
||||
.progress-bar(style='width:'+stats.levels.pctDone)
|
||||
else if paidFor
|
||||
button.btn.btn-info.btn-sm Enable
|
||||
button.enable-btn.btn.btn-info.btn-sm(data-user-id=user.id, data-course-instance-id=courseInstance.id) Enable
|
||||
|
||||
if !paidFor
|
||||
.text-center
|
||||
|
|
|
@ -22,6 +22,7 @@ module.exports = class ClassroomView extends RootView
|
|||
'click #activate-licenses-btn': 'onClickActivateLicensesButton'
|
||||
'click .activate-single-license-btn': 'onClickActivateSingleLicenseButton'
|
||||
'click #add-students-btn': 'onClickAddStudentsButton'
|
||||
'click .enable-btn': 'onClickEnableButton'
|
||||
|
||||
initialize: (options, classroomID) ->
|
||||
@classroom = new Classroom({_id: classroomID})
|
||||
|
@ -99,4 +100,11 @@ module.exports = class ClassroomView extends RootView
|
|||
|
||||
onClickAddStudentsButton: (e) ->
|
||||
modal = new InviteToClassroomModal({classroom: @classroom})
|
||||
@openModalView(modal)
|
||||
@openModalView(modal)
|
||||
|
||||
onClickEnableButton: (e) ->
|
||||
courseInstance = @courseInstances.get($(e.target).data('course-instance-id'))
|
||||
userID = $(e.target).data('user-id')
|
||||
courseInstance.addMember(userID)
|
||||
$(e.target).attr('disabled', true)
|
||||
@listenToOnce courseInstance, 'sync', @render
|
Loading…
Reference in a new issue