You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
3.4 KiB

extends ../layouts/main
block content
include ../comment/components/comment
section.uk-section.uk-section-default.uk-section-small
.uk-container.uk-container-expand
div(uk-grid).uk-flex-middle
.uk-width-expand
h1.uk-margin-remove Author Dashboard
.uk-width-auto
a(href= "/post/compose").uk-button.uk-button-primary.uk-border-rounded
span
i.fas.fa-plus
span.uk-margin-small-left Create Post
div(uk-grid)
div(class="uk-width-1-1 uk-width-2-3@m")
+renderSectionTitle('Recent Comments', { url: '/author/comments', title: 'See All', label: 'SEE ALL' })
ul.uk-list.uk-list-divider
each comment in comments
li
.uk-margin
a(href=`/post/${comment.resource.slug}`).uk-display-block.uk-link-reset
div(uk-grid).uk-grid-small
if comment.resource.image
.uk-width-auto
img(src= `/image/${comment.resource.image}`).uk-width-small
.uk-width-expand
.uk-text-large.uk-text-bold(style="line-height: 1em;")= comment.resource.title
.uk-text-small.uk-text-muted
div= comment.resource.summary
div= moment(comment.resource.created).fromNow()
+renderComment(comment)
div(class="uk-width-1-1 uk-width-1-3@m")
if Array.isArray(drafts) && (drafts.length > 0)
+renderSectionTitle('Drafts')
ul.uk-list.uk-list-divider
each draft in drafts
li
div(uk-grid).uk-grid-small.uk-flex-middle
.uk-width-expand
a(href=`/post/${draft._id}/edit`, title="Edit draft")= draft.title
.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
button(
type="button",
title="Delete draft",
data-draft-id= draft._id,
data-draft-title= draft.title,
onclick="return dtp.app.deleteDraft(event);",
).uk-button.uk-button-danger.uk-button-small
span
i.fas.fa-trash
if Array.isArray(posts) && (posts.length > 0)
+renderSectionTitle('Posts')
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
span= formatCount(post.stats.totalVisitCount)
span.uk-margin-small-left
i.fas.fa-eye