parent
976c415af3
commit
3b074e3a05
@ -0,0 +1,58 @@
|
||||
extends ../../layouts/main
|
||||
block content
|
||||
|
||||
include ../../post/components/draft-list
|
||||
include ../../post/components/list
|
||||
include ../../post/components/summary
|
||||
|
||||
include ../../components/pagination-bar
|
||||
|
||||
section.uk-section.uk-section-default.uk-section-small
|
||||
.uk-container.uk-container-expand
|
||||
h1 Post Author Dashboard
|
||||
div(uk-grid)
|
||||
.uk-width-2-3
|
||||
.uk-margin
|
||||
+renderSectionTitle('Your Posts')
|
||||
.content-block
|
||||
if published && Array.isArray(published.posts) && (published.posts.length > 0)
|
||||
.uk-margin
|
||||
ul.uk-list.uk-list-divider
|
||||
each post in published.posts
|
||||
li
|
||||
a(href=`/post/${post.slug}`).uk-display-block
|
||||
div= post.title
|
||||
.uk-article-meta
|
||||
div(uk-grid).uk-grid-small.uk-text-small
|
||||
.uk-width-expand
|
||||
a(href=`/post/${post.slug}`)= moment(post.created).fromNow()
|
||||
|
||||
.uk-width-auto
|
||||
a(href=`/post/${post._id}/edit`).uk-display-block
|
||||
+renderButtonIcon('fa-pen', 'edit')
|
||||
|
||||
.uk-width-auto
|
||||
a(
|
||||
href="",
|
||||
data-post-id= post._id,
|
||||
data-post-title= post.title,
|
||||
onclick="return dtp.app.deletePost(event);",
|
||||
).uk-display-block.uk-text-danger
|
||||
+renderButtonIcon('fa-trash', 'delete')
|
||||
|
||||
div(style="width: 65px;")
|
||||
span
|
||||
i.fas.fa-eye
|
||||
span.uk-margin-small-left= formatCount(post.stats.totalVisitCount)
|
||||
+renderPaginationBar('/author/post', published.totalPostCount)
|
||||
else
|
||||
div You have no published posts.
|
||||
|
||||
.uk-width-1-3
|
||||
.uk-margin
|
||||
+renderSectionTitle('Your Drafts')
|
||||
+renderPostDraftList(drafts.posts)
|
||||
|
||||
.uk-margin
|
||||
+renderSectionTitle('Archived')
|
||||
+renderPostList(archive.posts)
|
@ -0,0 +1,29 @@
|
||||
mixin renderPostDraftList (posts)
|
||||
if Array.isArray(posts) && (posts.length > 0)
|
||||
ul.uk-list.uk-list-divider
|
||||
each draft in posts
|
||||
li
|
||||
a(href=`/post/${draft.slug}`, title="Preview draft")= draft.title
|
||||
.uk-article-meta
|
||||
div(uk-grid).uk-grid-small.uk-flex-middle
|
||||
.uk-width-expand
|
||||
.uk-article-meta
|
||||
div(uk-grid).uk-grid-small.uk-text-small
|
||||
.uk-width-expand
|
||||
a(href=`/post/${draft.slug}`, title="Edit draft")= moment(draft.created).fromNow()
|
||||
|
||||
.uk-width-auto
|
||||
a(href=`/post/${draft._id}/edit`).uk-display-block
|
||||
+renderButtonIcon('fa-pen', 'edit')
|
||||
|
||||
.uk-width-auto
|
||||
a(
|
||||
href="",
|
||||
title="Delete draft",
|
||||
data-post-id= draft._id,
|
||||
data-post-title= draft.title,
|
||||
onclick="return dtp.app.deletePost(event);",
|
||||
).uk-text-danger
|
||||
+renderButtonIcon('fa-trash', 'delete')
|
||||
else
|
||||
.uk-margin-small You have no drafts.
|
@ -0,0 +1,32 @@
|
||||
mixin renderPostList (posts)
|
||||
if Array.isArray(posts) && (posts.length > 0)
|
||||
ul.uk-list.uk-list-divider
|
||||
each post in posts
|
||||
li
|
||||
a(href=`/post/${post.slug}`).uk-display-block
|
||||
div= post.title
|
||||
|
||||
.uk-article-meta
|
||||
div(uk-grid).uk-grid-small.uk-text-small
|
||||
.uk-width-expand
|
||||
a(href=`/post/${post.slug}`)= moment(post.created).fromNow()
|
||||
|
||||
.uk-width-auto
|
||||
a(href=`/post/${post._id}/edit`).uk-display-block
|
||||
+renderButtonIcon('fa-pen', 'edit')
|
||||
|
||||
.uk-width-auto
|
||||
a(
|
||||
href="",
|
||||
data-post-id= post._id,
|
||||
data-post-title= post.title,
|
||||
onclick="return dtp.app.deletePost(event);",
|
||||
).uk-display-block.uk-text-danger
|
||||
+renderButtonIcon('fa-trash', 'delete')
|
||||
|
||||
div(style="width: 65px;")
|
||||
span
|
||||
i.fas.fa-eye
|
||||
span.uk-margin-small-left= formatCount(post.stats.totalVisitCount)
|
||||
else
|
||||
div You have authored posts.
|
@ -0,0 +1,17 @@
|
||||
mixin renderPostSummaryFull (post)
|
||||
div(uk-grid).uk-grid-small
|
||||
if post.image
|
||||
.uk-width-auto
|
||||
img(src= `/image/${post.image}`).uk-width-small
|
||||
.uk-width-expand
|
||||
.uk-text-large.uk-text-bold(style="line-height: 1em;")= post.title
|
||||
.uk-text-small.uk-text-muted
|
||||
div= post.summary
|
||||
div= moment(post.created).fromNow()
|
||||
|
||||
mixin renderPostSummary (post)
|
||||
div(uk-grid).uk-grid-small.uk-flex-middle
|
||||
div(class="uk-width-1-1 uk-width-expand")
|
||||
.uk-text-large.uk-text-bold(style="line-height: 1em;")= post.title
|
||||
div(class="uk-width-1-1 uk-width-auto")
|
||||
div= moment(post.created).fromNow()
|
Loading…
Reference in new issue