Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UI): view amount of article views #569

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions src/routes/(pages)/c/[slug]/[messageSlug]/template.pug
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,34 @@ mixin author
+messageHeader("{message.title}", "{message.subtitle}", "{message.cover}")
+else
+messageHeader("{message.title}", "{message.subtitle}")
+content-wrapper
.text-container(
class="flex flex-row w-full items-center justify-between py-[31px] border-y border-solid border-l4 smDown:flex-col smDown:justify-start smDown:items-start smDown:py-4"
class="flex flex-col xs:flex-col w-full border border-solid border-l4 rounded-xl bg-l1 dark:bg-l2"
)
.text-content(class!="flex flex-col items-start")
.text-content(class!="flex flex-col p-4 items-start")
TextParagraph(textColor="text-t3")
time(
datetime="{timeFormat(message.createdAt, 'YYYY-MM-DD')}"
title="{extendedTimeFormat(message.createdAt)}"
) {timeFormat(message.createdAt)} {message.updatedAt ? '| Updated ' + timeFormat(message.updatedAt) : ''}
//- TextParagraph(class="flex flex-wrap flex-row gap-3 xs:gap-2" textColor="text-t3")
//- span(class="inline-flex items-center gap-1")
//- Icon(icon="{Eye}" width="{20}" height="{20}" colorInherit)
//- span {formatNumber(message.viewsCount, '0,0a')}
//- span(class="inline-flex items-center gap-1")
//- Icon(icon="{ChatBubbleLeftEllipsis}" width="{20}" height="{20}" colorInherit)
//- span {formatNumber(message.allReplies.totalCount, '0,0a')}
.text-content(class!="flex flex-col smDown:gap-4")
TextParagraph(class="flex flex-wrap justify-end smDown:justify-start" textColor="text-t3") #[span.mr-1 By] #[+author]
+if('message.isGoogleDoc')
.edit-wrapper(class="flex gap-2 justify-end smDown:justify-start")
TextParagraph(class="flex" textColor="text-t3") Have a suggestion?
+inline-link("{message.isGoogleDoc}",'Edit Article')(
class="xs:text-paragraph-s"
target="_blank"
rel="noreferrer"
TextParagraph(class="flex flex-wrap" textColor="text-t3") #[span.mr-1 By] #[+author]
TextParagraph(class="flex flex-wrap flex-row gap-3 xs:gap-2" textColor="text-t3")
span(class="inline-flex items-center gap-1")
Icon(icon="{Eye}" width="{20}" height="{20}" colorInherit)
span {formatNumber(message.viewsCount, '0,0a')}
span(class="inline-flex items-center gap-1")
Icon(icon="{ChatBubbleLeftEllipsis}" width="{20}" height="{20}" colorInherit)
span {formatNumber(message.allReplies.totalCount, '0,0a')}
+if('message.isGoogleDoc')
.text-content(class="flex flex-row justify-between border-t border-t-solid border-l4 p-4")
TextParagraph(textColor="text-t3") Have a suggestion?
.btn-wrapper
Button(
variant="secondary"
label="Edit Article"
size="small"
onClick!="{() => window.location.href = message.isGoogleDoc}"
)
+content-wrapper
+if('message.tocs && message.tocs.length > 0')
details(
open="false"
Expand Down
Loading