added author credit to author page

master
Andrew Woodlee 2 years ago
parent 3badc7a615
commit 28b5256c3a

@ -343,7 +343,6 @@ class PostController extends SiteController {
res.locals.pagination = this.getPaginationParameters(req, 20);
const {posts, totalPostCount} = await postService.getForAuthor(res.locals.author, ['published'], res.locals.pagination);
res.locals.posts = posts;
this.dtp.log.debug("Posts found ", { posts })
res.locals.totalPostCount = totalPostCount;
res.render('post/author/view');
} catch (error) {

@ -3,6 +3,7 @@ include ../newsroom/components/feed-entry-list-item
include ../venue/components/channel-card
include ../venue/components/channel-list-item
include ../post/components/author-credit
- var isLive = !!shingChannelStatus && shingChannelStatus.isLive && !!shingChannelStatus.liveEpisode;
@ -116,6 +117,13 @@ mixin renderPageSidebar ( )
+renderNewsroomFeedEntryListItem(entry)
//-
//- Author credit
//-
if author && posts.length > 0
.uk-card.uk-card-default.uk-card-small
.uk-card-body
+renderPostAuthorCredit(author)
//-
//- Newsletter Signup
//-
div(uk-sticky={ offset: 60, bottom: '#dtp-content-grid' }, style="z-index: initial;").uk-margin-medium

@ -2,10 +2,10 @@ mixin renderPostSummaryFull (post)
div(uk-grid).uk-grid-small
if post.image
.uk-width-auto
img(src= `/image/${post.image._id}`).uk-width-medium
img(src= `/image/${post.image._id}`).uk-width-small
else
.uk-width-auto
img(src="/img/default-poster.jpg").uk-width-medium
img(src="/img/default-poster.jpg").uk-width-small
.uk-width-expand
.uk-text-large.uk-text-bold(style="line-height: 1em;")
a(href=`/post/${post.slug}`)= `${post.title}`

@ -1,19 +1,16 @@
extends ../../layouts/main
extends ../../layouts/main-sidebar
block content
include ../../components/pagination-bar
include components/list
section.uk-section.uk-section-default.uk-section-xsmall
.uk-container.uk-container-expand
div(uk-grid).uk-flex-middle
.uk-width-expand
h1.uk-margin-remove= `Posts by ${author.username}`
if Array.isArray(posts) && (posts.length > 0)
ul.uk-list.uk-list-divider
each post in posts
li
+renderPostSummaryFull(post)
.uk-card-footer
+renderPaginationBar(`/post/author/${author.username}`, posts.length )
div(uk-grid).uk-flex-expand
.uk-width-expand
h3.uk-margin-remove= `Posts by ${author.username}`
if Array.isArray(posts) && (posts.length > 0)
ul.uk-list.uk-list-divider
each post in posts
li
+renderPostSummaryFull(post)
.uk-card-footer
+renderPaginationBar(`/post/author/${author.username}`, posts.length )

@ -6,7 +6,7 @@ mixin renderPostAuthorCredit (author)
.uk-margin-small
div(uk-grid).uk-flex-middle
.uk-width-expand
- var userUrl = !!author.coreUserId ? `/user/core/${author._id}` : `/user/${author._id}`;
- var userUrl = !!author.coreUserId ? `/user/core/${author._id}` : `/user/${author.username}`;
a(href= userUrl, title="View member profile")
.uk-text-bold(style="line-height: 1em;")= author.displayName || author.username
.uk-width-auto

Loading…
Cancel
Save