quetre/views/pug/pages/topic.pug
zyachel a0ac36a174 fix: remove stats from UI that aren't available anymore
includes no. of topic's followers, no. of topics a person is following, etc.
2024-04-08 00:28:59 +05:30

56 lines
2.4 KiB
Text

//-//////////////////////////////////////////////////////
//- INCLUDES/EXTENDS
//-//////////////////////////////////////////////////////
extends ../base
include ../mixins/_metadata
include ../mixins/_utils
//-//////////////////////////////////////////////////////
//- MAIN CONTENT
//-//////////////////////////////////////////////////////
block content
main#main.main.topic
//- TOPIC NAME AND METADATA
section.topic__stats.topic-stats
.metadata-primary
h1.heading.heading__primary.metadata-primary__heading.topic__name= data.name
+proxifyImg(data.image)(class='metadata-primary__image', alt='', aria-hidden='true')
.metadata-secondary
if data.isAdult
+addMetadataSecondary('danger', 'Adult Topic', '18+', true)
+quorafyUrl(meta.url)(class='link')
//- AUTHORS RELATED TO THE TOPIC AND METADATA
.topic__famous-authors.famous-authors
h2.heading.heading__secondary Most viewed authors
.famous-authors__list
each author in data.mostViewedAuthors
.famous-authors__item
.metadata-primary
p.metadata-primary__heading
if author.isAnon
span Anonymous
else
a.link(href=author.profile)= author.name
if author.isVerified
svg.icon.metadata-primary__icon
title verified
use(href='/misc/sprite.svg#icon-verified')
+proxifyImg(author.image)(class='metadata-primary__image', alt='', aria-hidden='true')
p.metadata-primary__misc(aria-label=`${author.name}'s credentials`)= author.credential || ''
.metadata-secondary
+addMetadataSecondary('user', 'Followers', author.numFollowers)
+addMetadataSecondary('eye', 'Views', author.numViews)
+addMetadataSecondary('comments', 'Answers', author.numAnswers)
//- RELATED TOPICS
.topic__related-topics.related-topics
h2.heading.heading__secondary Related Topics
.related-topics__list
each topic in data.relatedTopics
.metadata-primary
a.link.metadata-primary__heading(href=topic.url)= topic.name
+proxifyImg(topic.image)(class='metadata-primary__image', aria-hidden='true', alt='')
p.metadata-primary__misc
+formatNumber(topic.numFollowers)
| Followers