quetre/views/pug/pages/answers.pug
zyachel 595b720ee1 fix: fix outgoing url on error page
also refactor some related code
2023-01-15 21:41:09 +05:30

44 lines
1.7 KiB
Text

//-//////////////////////////////////////////////////////
//- INCLUDES/EXTENDS
//-//////////////////////////////////////////////////////
extends ../base
include ../mixins/_formatText
include ../mixins/_answer
include ../mixins/_utils
//-//////////////////////////////////////////////////////
//- MAIN CONTENT
//-//////////////////////////////////////////////////////
block content
main#main.main.answers
//- THIS QUESTION AND METADATA
.answers__question-box
h1.heading.heading__primary.answers__question
+spansChecker(data.question.text[0].spans)
.answers__metadata
p.answers__answers-total= `${ data.numAnswers ? 'Total answers: ' + data.numAnswers : 'Unanswered'}`
p.answers__answers-shown Viewable answers: #{data.answers.length}
+quorafyUrl(meta.url)(class='answers__question-link answers__link')
//- ANSWERS TO THIS QUESTION
.answers-box.answers__answers-box
h2.heading.heading__secondary.answers__answers-box-heading Answers
.answers-box__list
each answer in data.answers
+addAnswer(answer)
//- TOPICS TAGGED WITH THIS QUESTION
aside.topics.answers__topics
h2.heading.heading__secondary.answers__topic-heading Tagged Topics
ul.topics__list
each topic in data.topics
li.topics__item: a.topics__link.answers__link(href=topic.url)= topic.name
//- RELATED QUESTIONS
aside.related.answers__related
h2.heading.heading__secondary.answers__related-heading Related Questions
ul.related__questions
each question in data.relatedQuestions
li.related__question-item: a.related__question-link.answers__link(href=question.url)
+spansChecker(question.text[0].spans)