fix: use parent id for card anchor

This commit is contained in:
Ayo Ayco 2024-05-26 14:50:47 +02:00
parent 53d09a057e
commit 21a6f86402
2 changed files with 3 additions and 3 deletions

View file

@ -19,7 +19,7 @@
<relative-time datetime="{{ thread.created_at }}" precision="day">{{ thread.created_at }}</relative-time>
</a>
<span>&middot;</span>
<a href="{{ url_for('threads.thread', id=thread['id']) + '#' + thread['id'] }}">Anchor</a>
<a href="{{ url_for('threads.thread', id=parent_id) + '#' + thread['id'] }}">Anchor</a>
</div>
</div>

View file

@ -253,12 +253,12 @@
<a href="{{url_for('threads.home')}}">Back</a>
</div>
{% for thread in threads %}
{% with thread=thread, is_thread=threads|length > 1 %}
{% with thread=thread, parent_id=thread.id, is_thread=threads|length > 1 %}
{% include "card.html" %}
{% endwith %}
{% if thread.descendants is defined %}
{% for descendant in thread.descendants %}
{% with thread=descendant %}
{% with thread=descendant, parent_id=thread.id %}
{% include "card.html" %}
{% endwith %}
{% endfor %}