mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
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 .
|
||||
.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}")
|
||||
h1= view.nextCourse.get('name')
|
||||
p= view.nextCourse.get('description')
|
||||
|
|
|
@ -62,6 +62,8 @@ module.exports = class CourseDetailsView extends RootView
|
|||
# need to figure out the next course instance
|
||||
@courseComplete = true
|
||||
@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(=>
|
||||
@nextCourseInstance = _.find @courseInstances.models, (ci) => ci.get('courseID') > @courseID
|
||||
if @nextCourseInstance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue