feat: Add empty content module (#111)
* Add empty content module * Make Bene Happy again
This commit is contained in:
@@ -105,6 +105,7 @@
|
|||||||
"usingServerCredentialsLabel": "Die Beispielanwendung verwendet derzeit serverseitig gespeicherte Anmeldeinformationen zum Herstellen einer Verbindung mit einem Contentful-Space.",
|
"usingServerCredentialsLabel": "Die Beispielanwendung verwendet derzeit serverseitig gespeicherte Anmeldeinformationen zum Herstellen einer Verbindung mit einem Contentful-Space.",
|
||||||
"usingSessionCredentialsLabel": "Die Beispielanwendung verwendet derzeit Anmeldeinformationen von der Anwendungssitzung, um eine Verbindung zu einem Contentful-Space herzustellen.",
|
"usingSessionCredentialsLabel": "Die Beispielanwendung verwendet derzeit Anmeldeinformationen von der Anwendungssitzung, um eine Verbindung zu einem Contentful-Space herzustellen.",
|
||||||
"applicationCredentialsLabel": "Anmeldeinformationen für die Anwendungssitzung",
|
"applicationCredentialsLabel": "Anmeldeinformationen für die Anwendungssitzung",
|
||||||
|
"noContentLabel": "Keinen Inhalt gefunden.",
|
||||||
"errorHighlightedCourse": "⚠️ Dieser Kurs wurde nicht veröffentlicht oder existiert nicht.",
|
"errorHighlightedCourse": "⚠️ Dieser Kurs wurde nicht veröffentlicht oder existiert nicht.",
|
||||||
"somethingWentWrongLabel": "Hmm, etwas ging schief.",
|
"somethingWentWrongLabel": "Hmm, etwas ging schief.",
|
||||||
"errorMessage404Route": "Diese Seite existiert nicht.",
|
"errorMessage404Route": "Diese Seite existiert nicht.",
|
||||||
|
|||||||
@@ -105,6 +105,7 @@
|
|||||||
"usingServerCredentialsLabel": "The example app is currently using server side stored credentials to connect to a Contentful space.",
|
"usingServerCredentialsLabel": "The example app is currently using server side stored credentials to connect to a Contentful space.",
|
||||||
"usingSessionCredentialsLabel": "The example app is currently using application session stored credentials to connect to a Contentful space.",
|
"usingSessionCredentialsLabel": "The example app is currently using application session stored credentials to connect to a Contentful space.",
|
||||||
"applicationCredentialsLabel": "Application session credentials",
|
"applicationCredentialsLabel": "Application session credentials",
|
||||||
|
"noContentLabel": "No content found.",
|
||||||
"errorHighlightedCourse": "⚠️ The course is not published or does not exist.",
|
"errorHighlightedCourse": "⚠️ The course is not published or does not exist.",
|
||||||
"somethingWentWrongLabel": "Oops, something went wrong",
|
"somethingWentWrongLabel": "Oops, something went wrong",
|
||||||
"errorMessage404Route": "The page you are trying to open does not exist.",
|
"errorMessage404Route": "The page you are trying to open does not exist.",
|
||||||
|
|||||||
8304
package-lock.json
generated
Normal file
8304
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@ extends layout
|
|||||||
|
|
||||||
include mixins/_breadcrumb
|
include mixins/_breadcrumb
|
||||||
include mixins/_courseCard
|
include mixins/_courseCard
|
||||||
|
include mixins/_emptyModule
|
||||||
|
|
||||||
block content
|
block content
|
||||||
.layout-no-sidebar
|
.layout-no-sidebar
|
||||||
@@ -35,6 +36,9 @@ block content
|
|||||||
.editorial-features__hint-message #{translate('editorialFeaturesHint', currentLocale.code)}
|
.editorial-features__hint-message #{translate('editorialFeaturesHint', currentLocale.code)}
|
||||||
|
|
||||||
.grid-list
|
.grid-list
|
||||||
|
if courses.length
|
||||||
each course in courses
|
each course in courses
|
||||||
.grid-list__item
|
.grid-list__item
|
||||||
+courseCard(course)
|
+courseCard(course)
|
||||||
|
else
|
||||||
|
+emptyModule()
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ include mixins/_editorialFeatures
|
|||||||
include mixins/_moduleCopy
|
include mixins/_moduleCopy
|
||||||
include mixins/_moduleHeroImage
|
include mixins/_moduleHeroImage
|
||||||
include mixins/_moduleHighlightedCourse
|
include mixins/_moduleHighlightedCourse
|
||||||
|
include mixins/_emptyModule
|
||||||
|
|
||||||
block content
|
block content
|
||||||
if currentPath !== '/'
|
if currentPath !== '/'
|
||||||
@@ -13,6 +14,7 @@ block content
|
|||||||
.layout-centered
|
.layout-centered
|
||||||
+editorialFeatures(landingPage)
|
+editorialFeatures(landingPage)
|
||||||
.modules-container
|
.modules-container
|
||||||
|
if landingPage.fields.contentModules.length
|
||||||
each module in landingPage.fields.contentModules
|
each module in landingPage.fields.contentModules
|
||||||
case module.sys.contentType.sys.id
|
case module.sys.contentType.sys.id
|
||||||
when 'layoutCopy'
|
when 'layoutCopy'
|
||||||
@@ -23,3 +25,5 @@ block content
|
|||||||
|
|
||||||
when 'layoutHighlightedCourse'
|
when 'layoutHighlightedCourse'
|
||||||
+moduleHighlightedCourse(module, module.fields.course)
|
+moduleHighlightedCourse(module, module.fields.course)
|
||||||
|
else
|
||||||
|
+emptyModule()
|
||||||
|
|||||||
7
views/mixins/_emptyModule.pug
Normal file
7
views/mixins/_emptyModule.pug
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mixin emptyModule()
|
||||||
|
.module
|
||||||
|
h1 ️️#{translate('noContentLabel', currentLocale.code)}
|
||||||
|
h2 ️️#{translate('hintsLabel', currentLocale.code)}
|
||||||
|
ul
|
||||||
|
li ️️#{translate('notFoundErrorHint', currentLocale.code)}
|
||||||
|
li ️️#{translate('draftOrPublishedErrorHint', currentLocale.code)}
|
||||||
@@ -2,12 +2,14 @@ include _editorialFeatures
|
|||||||
include _lessonModuleCodeSnippet
|
include _lessonModuleCodeSnippet
|
||||||
include _lessonModuleCopy
|
include _lessonModuleCopy
|
||||||
include _lessonModuleImage
|
include _lessonModuleImage
|
||||||
|
include _emptyModule
|
||||||
|
|
||||||
mixin lesson(lesson, course, nextLesson)
|
mixin lesson(lesson, course, nextLesson)
|
||||||
.lesson
|
.lesson
|
||||||
h1.lesson__title #{lesson.fields.title}
|
h1.lesson__title #{lesson.fields.title}
|
||||||
+editorialFeatures(lesson)
|
+editorialFeatures(lesson)
|
||||||
.lesson__modules
|
.lesson__modules
|
||||||
|
if lesson.fields.modules.length
|
||||||
each module in lesson.fields.modules
|
each module in lesson.fields.modules
|
||||||
if module.sys.contentType
|
if module.sys.contentType
|
||||||
case module.sys.contentType.sys.id
|
case module.sys.contentType.sys.id
|
||||||
@@ -22,6 +24,8 @@ mixin lesson(lesson, course, nextLesson)
|
|||||||
p
|
p
|
||||||
span #{translate('lessonModuleErrorBody', currentLocale.code)}
|
span #{translate('lessonModuleErrorBody', currentLocale.code)}
|
||||||
strong #{module.sys.id}
|
strong #{module.sys.id}
|
||||||
|
else
|
||||||
|
+emptyModule()
|
||||||
if nextLesson
|
if nextLesson
|
||||||
a.lesson__cta.cta(href=`/courses/${course.fields.slug}/lessons/${nextLesson.fields.slug}${queryString}`) #{translate('nextLessonLabel', currentLocale.code)}
|
a.lesson__cta.cta(href=`/courses/${course.fields.slug}/lessons/${nextLesson.fields.slug}${queryString}`) #{translate('nextLessonLabel', currentLocale.code)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user