course detail styling and basic lesson module styling

This commit is contained in:
Benedikt Rötsch
2017-10-02 17:33:40 +02:00
committed by Benedikt Rötsch
parent 478633c398
commit 71c0c0e95a
13 changed files with 335 additions and 92 deletions

View File

@@ -48,7 +48,14 @@ router.get('/:cslug/lessons/:lslug', async function (req, res, next) {
const lessons = course.fields.lessons
const lessonIndex = lessons.findIndex((lesson) => lesson.fields.slug === req.params.lslug)
const lesson = lessons[lessonIndex]
res.render('course', {title: `${course.fields.title} | ${lesson.fields.title}`, course, lesson, lessons, lessonIndex})
const nextLesson = lessons[lessonIndex + 1] || null
res.render('course', {
title: `${course.fields.title} | ${lesson.fields.title}`,
course,
lesson,
lessons,
nextLesson
})
})
module.exports = router