diff --git a/app/controllers/post.js b/app/controllers/post.js index 07dd90b..aac52d4 100644 --- a/app/controllers/post.js +++ b/app/controllers/post.js @@ -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) { diff --git a/app/views/components/page-sidebar.pug b/app/views/components/page-sidebar.pug index 1a04b41..1e8c711 100644 --- a/app/views/components/page-sidebar.pug +++ b/app/views/components/page-sidebar.pug @@ -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 diff --git a/app/views/post/author/components/list.pug b/app/views/post/author/components/list.pug index e0d3846..cc142b7 100644 --- a/app/views/post/author/components/list.pug +++ b/app/views/post/author/components/list.pug @@ -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}` diff --git a/app/views/post/author/view.pug b/app/views/post/author/view.pug index 8faa735..bf431d5 100644 --- a/app/views/post/author/view.pug +++ b/app/views/post/author/view.pug @@ -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 ) \ No newline at end of file + 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 ) \ No newline at end of file diff --git a/app/views/post/components/author-credit.pug b/app/views/post/components/author-credit.pug index 1f2d600..1d824fc 100644 --- a/app/views/post/components/author-credit.pug +++ b/app/views/post/components/author-credit.pug @@ -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