diff --git a/app/views/tag/components/list.pug b/app/views/tag/components/list.pug index 6bb667c..5c953d6 100644 --- a/app/views/tag/components/list.pug +++ b/app/views/tag/components/list.pug @@ -1,17 +1,17 @@ -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() - span by - a(href=`/user/${post.author.username}`)=` ${post.author.username}` - - else - div There are no posts with this tag. \ No newline at end of file +mixin renderPostSummaryFull (post) + div(uk-grid).uk-grid-small + if post.image + .uk-width-auto + img(src= `/image/${post.image}`).uk-width-medium + else + .uk-width-auto + img(src="/img/default-poster.jpg").uk-width-medium + .uk-width-expand + .uk-text-large.uk-text-bold(style="line-height: 1em;") + a(href=`${post.slug}`)= `${post.title}` + .uk-text-small.uk-text-muted + div + div= moment(post.created).fromNow() + span by + a(href=`/user/${post.author.username}`)=` ${post.author.username}` + div= post.summary \ No newline at end of file diff --git a/app/views/tag/view.pug b/app/views/tag/view.pug index 29166d6..d7dabff 100644 --- a/app/views/tag/view.pug +++ b/app/views/tag/view.pug @@ -1,6 +1,6 @@ extends ../layouts/main-sidebar -include components/list.pug +include components/list block content @@ -10,8 +10,14 @@ block content ul.uk-list.uk-list-divider each post in posts li + +renderPostSummaryFull(post) + //- li + if post.image + img(src= `/image/${post.image._id}`, href=`/post/${post.slug}`, style="max-height: 350px; object-fit: cover; vertical-align:middle;margin:0px 20px;").responsive + else + img(src="/img/default-poster.jpg", href=`/post/${post.slug}`, style="max-height: 350px; object-fit: cover; vertical-align:middle;margin:0px 20px;").responsive a(href=`/post/${post.slug}`).uk-display-block - div= post.title + div.h2= post.title .uk-article-meta div(uk-grid).uk-grid-small.uk-text-small @@ -19,6 +25,8 @@ block content a(href=`/post/${post.slug}`)= moment(post.created).fromNow() span by a(href=`/user/${post.author.username}`)=` ${post.author.username}` + .uk-width-expand + div= post.summary else h3= `There are no posts with the tag ${tag}.` \ No newline at end of file