mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
/courses/teachers add students modal
This commit is contained in:
parent
af136764de
commit
ea1996809c
2 changed files with 12 additions and 1 deletions
app
|
@ -67,7 +67,7 @@ mixin classroom(classroom)
|
|||
a.edit-classroom-small(data-i18n="courses.edit_settings", data-classroom-id="#{classroom.id}")
|
||||
.no-students No students yet!
|
||||
.text-center
|
||||
a.btn.btn-info.uppercase(href='/courses/#{classroom.id}') add students
|
||||
button.btn.btn-info.uppercase.btn-add-students(data-classroom-id="#{classroom.id}") add students
|
||||
br
|
||||
if classMemberCount > 0
|
||||
.col-md-4.text-center
|
||||
|
|
|
@ -4,6 +4,7 @@ CocoCollection = require 'collections/CocoCollection'
|
|||
CocoModel = require 'models/CocoModel'
|
||||
Course = require 'models/Course'
|
||||
Classroom = require 'models/Classroom'
|
||||
InviteToClassroomModal = require 'views/courses/InviteToClassroomModal'
|
||||
User = require 'models/User'
|
||||
CourseInstance = require 'models/CourseInstance'
|
||||
RootView = require 'views/core/RootView'
|
||||
|
@ -15,6 +16,7 @@ module.exports = class TeacherCoursesView extends RootView
|
|||
template: template
|
||||
|
||||
events:
|
||||
'click .btn-add-students': 'onClickAddStudents'
|
||||
'click .create-new-class': 'onClickCreateNewClassButton'
|
||||
'click .edit-classroom-small': 'onClickEditClassroomSmall'
|
||||
|
||||
|
@ -41,6 +43,15 @@ module.exports = class TeacherCoursesView extends RootView
|
|||
url: "/db/classroom/#{classroom.id}/members"
|
||||
})
|
||||
|
||||
onClickAddStudents: (e) ->
|
||||
classroomID = $(e.target).data('classroom-id')
|
||||
classroom = @classrooms.get(classroomID)
|
||||
unless classroom
|
||||
console.error 'No classroom ID found.'
|
||||
return
|
||||
modal = new InviteToClassroomModal({classroom: classroom})
|
||||
@openModalView(modal)
|
||||
|
||||
onClickCreateNewClassButton: ->
|
||||
return @openModalView new AuthModal() if me.get('anonymous')
|
||||
modal = new ClassroomSettingsModal({})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue