Add enroll students button to /courses/teachers
This commit is contained in:
parent
e070c70b9d
commit
bde8e6721c
4 changed files with 16 additions and 1 deletions
app
styles/courses
templates/courses
views/courses
|
@ -1,6 +1,9 @@
|
||||||
#teacher-courses-view
|
#teacher-courses-view
|
||||||
margin-bottom: 50px
|
margin-bottom: 50px
|
||||||
|
|
||||||
|
#activate-licenses-btn
|
||||||
|
margin-left: 10px
|
||||||
|
|
||||||
.active-courses
|
.active-courses
|
||||||
font-size: 12px
|
font-size: 12px
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
|
|
|
@ -4,7 +4,8 @@ block modal-header-content
|
||||||
.clearfix
|
.clearfix
|
||||||
.text-center
|
.text-center
|
||||||
h2(data-i18n="courses.enroll_paid")
|
h2(data-i18n="courses.enroll_paid")
|
||||||
p= view.classroom.get('name')
|
if view.classroom
|
||||||
|
p= view.classroom.get('name')
|
||||||
|
|
||||||
block modal-body-content
|
block modal-body-content
|
||||||
- var usedLic = view.prepaids.totalRedeemers();
|
- var usedLic = view.prepaids.totalRedeemers();
|
||||||
|
|
|
@ -68,6 +68,7 @@ block content
|
||||||
strong.spr(data-i18n="courses.unused_enrollments")
|
strong.spr(data-i18n="courses.unused_enrollments")
|
||||||
strong.spr= view.prepaids.totalAvailable()
|
strong.spr= view.prepaids.totalAvailable()
|
||||||
a.btn.btn-success.btn(href="/courses/purchase", data-i18n="courses.purchase_enrollments")
|
a.btn.btn-success.btn(href="/courses/purchase", data-i18n="courses.purchase_enrollments")
|
||||||
|
button#activate-licenses-btn.btn.btn-info(data-i18n="courses.enroll_paid")
|
||||||
|
|
||||||
p(data-i18n="courses.students_access")
|
p(data-i18n="courses.students_access")
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
ActivateLicensesModal = require 'views/courses/ActivateLicensesModal'
|
||||||
app = require 'core/application'
|
app = require 'core/application'
|
||||||
AuthModal = require 'views/core/AuthModal'
|
AuthModal = require 'views/core/AuthModal'
|
||||||
CocoCollection = require 'collections/CocoCollection'
|
CocoCollection = require 'collections/CocoCollection'
|
||||||
|
@ -17,6 +18,7 @@ module.exports = class TeacherCoursesView extends RootView
|
||||||
template: template
|
template: template
|
||||||
|
|
||||||
events:
|
events:
|
||||||
|
'click #activate-licenses-btn': 'onClickActivateLicensesButton'
|
||||||
'click .btn-add-students': 'onClickAddStudents'
|
'click .btn-add-students': 'onClickAddStudents'
|
||||||
'click .create-new-class': 'onClickCreateNewClassButton'
|
'click .create-new-class': 'onClickCreateNewClassButton'
|
||||||
'click .edit-classroom-small': 'onClickEditClassroomSmall'
|
'click .edit-classroom-small': 'onClickEditClassroomSmall'
|
||||||
|
@ -49,6 +51,14 @@ module.exports = class TeacherCoursesView extends RootView
|
||||||
url: "/db/classroom/#{classroom.id}/members"
|
url: "/db/classroom/#{classroom.id}/members"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onClickActivateLicensesButton: ->
|
||||||
|
modal = new ActivateLicensesModal({
|
||||||
|
users: @members
|
||||||
|
})
|
||||||
|
@openModalView(modal)
|
||||||
|
modal.once 'redeem-users', -> document.location.reload()
|
||||||
|
application.tracker?.trackEvent 'Courses teachers started enroll students', category: 'Courses'
|
||||||
|
|
||||||
onClickAddStudents: (e) ->
|
onClickAddStudents: (e) ->
|
||||||
classroomID = $(e.target).data('classroom-id')
|
classroomID = $(e.target).data('classroom-id')
|
||||||
classroom = @classrooms.get(classroomID)
|
classroom = @classrooms.get(classroomID)
|
||||||
|
|
Reference in a new issue