feat: Add empty content module (#111)

* Add empty content module

* Make Bene Happy again
This commit is contained in:
Khaled Garbaya
2018-02-22 16:13:37 +01:00
committed by GitHub
parent f2e5310168
commit 1d513b9ede
7 changed files with 8352 additions and 27 deletions

View File

@@ -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.",
@@ -120,4 +121,4 @@
"stackTraceErrorHint": "Schauen Sie sich den folgenden Stack Trace an.", "stackTraceErrorHint": "Schauen Sie sich den folgenden Stack Trace an.",
"errorLabel": "Fehler von Contentful:", "errorLabel": "Fehler von Contentful:",
"stackTraceLabel": "Stack trace:" "stackTraceLabel": "Stack trace:"
} }

View File

@@ -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.",
@@ -120,4 +121,4 @@
"stackTraceErrorHint": "Check the stack trace below.", "stackTraceErrorHint": "Check the stack trace below.",
"errorLabel": "Error from Contentful:", "errorLabel": "Error from Contentful:",
"stackTraceLabel": "Stack trace:" "stackTraceLabel": "Stack trace:"
} }

8304
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -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
each course in courses if courses.length
.grid-list__item each course in courses
+courseCard(course) .grid-list__item
+courseCard(course)
else
+emptyModule()

View File

@@ -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,13 +14,16 @@ block content
.layout-centered .layout-centered
+editorialFeatures(landingPage) +editorialFeatures(landingPage)
.modules-container .modules-container
each module in landingPage.fields.contentModules if landingPage.fields.contentModules.length
case module.sys.contentType.sys.id each module in landingPage.fields.contentModules
when 'layoutCopy' case module.sys.contentType.sys.id
+moduleCopy(module) when 'layoutCopy'
+moduleCopy(module)
when 'layoutHeroImage' when 'layoutHeroImage'
+moduleHeroImage(module) +moduleHeroImage(module)
when 'layoutHighlightedCourse' when 'layoutHighlightedCourse'
+moduleHighlightedCourse(module, module.fields.course) +moduleHighlightedCourse(module, module.fields.course)
else
+emptyModule()

View 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)}

View File

@@ -2,26 +2,30 @@ 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
each module in lesson.fields.modules if lesson.fields.modules.length
if module.sys.contentType each module in lesson.fields.modules
case module.sys.contentType.sys.id if module.sys.contentType
when 'lessonCodeSnippets' case module.sys.contentType.sys.id
+lessonModuleCodeSnippet(module) when 'lessonCodeSnippets'
when 'lessonCopy' +lessonModuleCodeSnippet(module)
+lessonModuleCopy(module) when 'lessonCopy'
when 'lessonImage' +lessonModuleCopy(module)
+lessonModuleImage(module) when 'lessonImage'
else +lessonModuleImage(module)
h2 #{translate('lessonModuleErrorTitle', currentLocale.code)} else
p h2 #{translate('lessonModuleErrorTitle', currentLocale.code)}
span #{translate('lessonModuleErrorBody', currentLocale.code)} p
strong #{module.sys.id} span #{translate('lessonModuleErrorBody', currentLocale.code)}
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)}