mirror of
https://codeberg.org/catask-org/catask.git
synced 2025-04-19 13:23:41 -05:00
use new render_markdown()
function in question card, simplify template
This commit is contained in:
parent
92e4fa9e82
commit
502534131b
1 changed files with 14 additions and 16 deletions
|
@ -1,24 +1,22 @@
|
|||
{% if multipleAnswers %}
|
||||
{% for answer in answers %}
|
||||
<div class="card mt-3 mb-3{% if question.pinned %} border-2{% endif %}" id="question-{{ question.id }}">
|
||||
<div class="position-relative">
|
||||
<div class="card-header{% if question.pinned %} border-2{% endif %}">
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap text-break">
|
||||
<h3 class="h5 card-title my-1 markdown-content">
|
||||
{% if question.from_who %}
|
||||
{{ question.from_who | render_markdown }}
|
||||
{% else %}
|
||||
<i class="bi bi-incognito" data-bs-toggle="tooltip" data-bs-title="This question was asked anonymously" data-bs-placement="top"></i> {{ cfg.anonName }}
|
||||
{% endif %}
|
||||
</h3>
|
||||
<h3 class="h6 card-subtitle fw-light text-body-secondary" data-bs-toggle="tooltip" data-bs-title="{{ question.creation_date.strftime('%B %d, %Y %H:%M') }}" data-bs-placement="top">{{ formatRelativeTime(str(question.creation_date)) }}</h3>
|
||||
</div>
|
||||
{% with question=question %}
|
||||
{% include 'snippets/q-card-text.html' %}
|
||||
{% endwith %}
|
||||
<div class="card-header{% if question.pinned %} border-2{% endif %}">
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap text-break">
|
||||
<h3 class="h5 card-title my-1 markdown-content w-75">
|
||||
{% if question.from_who %}
|
||||
{{ render_markdown(question.from_who, fromWho=True) }}
|
||||
{% else %}
|
||||
<i class="bi bi-incognito" data-bs-toggle="tooltip" data-bs-title="This question was asked anonymously" data-bs-placement="top"></i> {{ cfg.anonName }}
|
||||
{% endif %}
|
||||
</h3>
|
||||
<h3 class="h6 card-subtitle fw-light text-body-secondary" data-bs-toggle="tooltip" data-bs-title="{{ question.creation_date.strftime('%B %d, %Y %H:%M') }}" data-bs-placement="top">{{ formatRelativeTime(str(question.creation_date)) }}</h3>
|
||||
</div>
|
||||
{% with question=question %}
|
||||
{% include 'snippets/q-card-text.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-body markdown-content" id="a-{{ question.id }}-content">
|
||||
{% if answer.cw %}
|
||||
<div class="text-center mb-2 fw-bold cw-text markdown-content">{{ answer.cw | render_markdown }}</div>
|
||||
<div class="collapse question-cw markdown-content" id="answer-cw-{{ answer.id }}">
|
||||
|
|
Loading…
Add table
Reference in a new issue