mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-25 08:41:00 +00:00
Show parent post on individual page
This commit is contained in:
parent
0bced8fe17
commit
4420507f62
2 changed files with 8 additions and 0 deletions
|
@ -41,6 +41,10 @@ class Individual(TemplateView):
|
|||
return super().get(request)
|
||||
|
||||
def get_context_data(self):
|
||||
if self.post_obj.in_reply_to:
|
||||
parent = Post.objects.filter(object_uri=self.post_obj.in_reply_to).first()
|
||||
else:
|
||||
parent = None
|
||||
return {
|
||||
"identity": self.identity,
|
||||
"post": self.post_obj,
|
||||
|
@ -49,6 +53,7 @@ class Individual(TemplateView):
|
|||
self.request.identity,
|
||||
),
|
||||
"link_original": True,
|
||||
"parent": parent,
|
||||
"replies": Post.objects.filter(
|
||||
models.Q(
|
||||
visibility__in=[
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
{% block title %}Post by {{ post.author.name_or_handle }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if parent %}
|
||||
{% include "activities/_post.html" with post=parent reply=True link_original=False %}
|
||||
{% endif %}
|
||||
{% include "activities/_post.html" %}
|
||||
{% for reply in replies %}
|
||||
{% include "activities/_post.html" with post=reply reply=True link_original=False %}
|
||||
|
|
Loading…
Reference in a new issue