feat(entry-states): display entity state for editors

This commit is contained in:
Benedikt Rötsch
2017-10-24 15:12:26 +02:00
parent 63ff3e0426
commit fd52efd625
8 changed files with 77 additions and 4 deletions

View File

@@ -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

View File

@@ -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}`

View File

@@ -0,0 +1,5 @@
mixin entryState(entry)
if entry.draft
.pill.pill--draft draft
if entry.pendingChanges
.pill.pill--pending-changes pending changes