feat(entry-states): display entity state for editors
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
include _entryState
|
||||
|
||||
mixin courseCard(course = {fields: {title: '', description: '', categories: [], slug: ''}})
|
||||
.course-card
|
||||
.course-card__categories
|
||||
@@ -7,6 +9,8 @@ mixin courseCard(course = {fields: {title: '', description: '', categories: [],
|
||||
a.course-card__category-link(href=`/courses/categories/${category.fields.slug}${queryString}`) #{category.fields.title}
|
||||
h2.course-card__title
|
||||
a(href=`/courses/${course.fields.slug}${queryString}`)= course.fields.title
|
||||
if currentApi.id === 'cpa' && (entry.draft || entry.pendingChanges)
|
||||
+entryState(course)
|
||||
p.course-card__description= course.fields.shortDescription
|
||||
.course-card__link-wrapper
|
||||
a.course-card__link(href=`/courses/${course.fields.slug}${queryString}`) view course
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
include _entryState
|
||||
|
||||
mixin editorialFeatures(entry)
|
||||
if settings.editorialFeatures
|
||||
.editorial-features
|
||||
if currentApi.id === 'cpa' && (entry.draft || entry.pendingChanges)
|
||||
.editorial-features__item
|
||||
+entryState(entry)
|
||||
.editorial-features__item
|
||||
a.editorial-features__text(
|
||||
href=`https://app.contentful.com/spaces/${settings.space}/entries/${entry.sys.id}`
|
||||
|
||||
5
views/mixins/_entryState.pug
Normal file
5
views/mixins/_entryState.pug
Normal file
@@ -0,0 +1,5 @@
|
||||
mixin entryState(entry)
|
||||
if entry.draft
|
||||
.pill.pill--draft draft
|
||||
if entry.pendingChanges
|
||||
.pill.pill--pending-changes pending changes
|
||||
Reference in New Issue
Block a user