Adding an outer IN/OUT
If we have multiple roots ever, we need the whole thing in a big <ul></ul>
This commit is contained in:
parent
88d6c6f3ce
commit
4ad3538017
|
@ -5,7 +5,6 @@ def maketree(descendants):
|
|||
replies = {}
|
||||
roots = set()
|
||||
for descendant in descendants:
|
||||
pprint(descendant)
|
||||
if not descendant.in_reply_to_id:
|
||||
roots.add(descendant.id)
|
||||
if descendant.in_reply_to_id in replies:
|
||||
|
@ -54,4 +53,6 @@ def unmaketree(tree):
|
|||
yield OUT
|
||||
|
||||
def build(descendants):
|
||||
return unmaketree(maketree(descendants))
|
||||
yield IN
|
||||
yield from unmaketree(maketree(descendants))
|
||||
yield OUT
|
||||
|
|
|
@ -700,7 +700,7 @@ def thread(request, id):
|
|||
"context": context,
|
||||
"toot": toot,
|
||||
"root": root,
|
||||
"posts": threadtree.build(descendants),
|
||||
"posts": tuple(threadtree.build(descendants)),
|
||||
"own_acct": request.session["active_user"],
|
||||
"notifications": notifications,
|
||||
"preferences": account.preferences,
|
||||
|
|
Loading…
Reference in New Issue