CourseDetailsView does not link to next course if the student is not assigned to that course
This commit is contained in:
parent
a89782b9c6
commit
184be0bf65
2 changed files with 3 additions and 1 deletions
app
|
@ -65,7 +65,7 @@ block content
|
||||||
span= view.course.get('name')
|
span= view.course.get('name')
|
||||||
span .
|
span .
|
||||||
.col-md-6
|
.col-md-6
|
||||||
if view.nextCourseInstance
|
if view.nextCourseInstance && _.contains(view.nextCourseInstance.get('members'), me.id)
|
||||||
a.btn.btn-lg.btn-success(href="/courses/#{view.nextCourse.id}/#{view.nextCourseInstance.id}")
|
a.btn.btn-lg.btn-success(href="/courses/#{view.nextCourse.id}/#{view.nextCourseInstance.id}")
|
||||||
h1= view.nextCourse.get('name')
|
h1= view.nextCourse.get('name')
|
||||||
p= view.nextCourse.get('description')
|
p= view.nextCourse.get('description')
|
||||||
|
|
|
@ -62,6 +62,8 @@ module.exports = class CourseDetailsView extends RootView
|
||||||
# need to figure out the next course instance
|
# need to figure out the next course instance
|
||||||
@courseComplete = true
|
@courseComplete = true
|
||||||
@courseInstances.comparator = 'courseID'
|
@courseInstances.comparator = 'courseID'
|
||||||
|
# TODO: make this logic use locked course content to figure out the next course, then fetch the
|
||||||
|
# course instance for that
|
||||||
@supermodel.trackRequest(@courseInstances.fetchForClassroom(classroomID).then(=>
|
@supermodel.trackRequest(@courseInstances.fetchForClassroom(classroomID).then(=>
|
||||||
@nextCourseInstance = _.find @courseInstances.models, (ci) => ci.get('courseID') > @courseID
|
@nextCourseInstance = _.find @courseInstances.models, (ci) => ci.get('courseID') > @courseID
|
||||||
if @nextCourseInstance
|
if @nextCourseInstance
|
||||||
|
|
Reference in a new issue