Files
the-example-app-nodejs/views/mixins/_lesson.pug
2017-11-15 09:44:12 +01:00

28 lines
1007 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
include _editorialFeatures
include _lessonModuleCodeSnippet
include _lessonModuleCopy
include _lessonModuleImage
mixin lesson(lesson, course, nextLesson)
.lesson
h1.lesson__title #{lesson.fields.title}
+editorialFeatures(lesson)
.lesson__modules
each module in lesson.fields.modules
if module.sys.contentType
case module.sys.contentType.sys.id
when 'lessonCodeSnippets'
+lessonModuleCodeSnippet(module)
when 'lessonCopy'
+lessonModuleCopy(module)
when 'lessonImage'
+lessonModuleImage(module)
else
h2 #{translate('lessonModuleErrorTitle', currentLocale.code)}
p
span #{translate('lessonModuleErrorBody', currentLocale.code)}
strong #{module.sys.id}
if nextLesson
a.lesson__cta.cta(href=`/courses/${course.fields.slug}/lessons/${nextLesson.fields.slug}${queryString}`) #{translate('nextLessonLabel', currentLocale.code)}