Cleaning up, adding tokens
Doing some token based temporary flattening for django
This commit is contained in:
parent
8eea5b05b1
commit
11546907a6
|
@ -50,5 +50,5 @@ def unmaketree(tree):
|
||||||
yield from unmaketree(children)
|
yield from unmaketree(children)
|
||||||
yield OUT
|
yield OUT
|
||||||
|
|
||||||
def threadtree(descendants):
|
def build(descendants):
|
||||||
return unmaketree(maketree(descendants))
|
return unmaketree(maketree(descendants))
|
||||||
|
|
|
@ -671,6 +671,7 @@ def note(request, next=None, prev=None):
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
import threadtree
|
||||||
|
|
||||||
@br_login_required
|
@br_login_required
|
||||||
def thread(request, id):
|
def thread(request, id):
|
||||||
|
@ -687,10 +688,6 @@ def thread(request, id):
|
||||||
notifications = _notes_count(account, mastodon)
|
notifications = _notes_count(account, mastodon)
|
||||||
filters = get_filters(mastodon, context="thread")
|
filters = get_filters(mastodon, context="thread")
|
||||||
|
|
||||||
import pprint
|
|
||||||
pprint.pprint(context)
|
|
||||||
raise SystemExit(23)
|
|
||||||
|
|
||||||
# Apply filters
|
# Apply filters
|
||||||
descendants = [
|
descendants = [
|
||||||
x for x in context.descendants if not toot_matches_filters(x, filters)
|
x for x in context.descendants if not toot_matches_filters(x, filters)
|
||||||
|
@ -703,10 +700,12 @@ def thread(request, id):
|
||||||
"context": context,
|
"context": context,
|
||||||
"toot": toot,
|
"toot": toot,
|
||||||
"root": root,
|
"root": root,
|
||||||
"descendants": unmaketree(maketree(descendants)),
|
"posts": threadtree.build(descendants)),
|
||||||
"own_acct": request.session["active_user"],
|
"own_acct": request.session["active_user"],
|
||||||
"notifications": notifications,
|
"notifications": notifications,
|
||||||
"preferences": account.preferences,
|
"preferences": account.preferences,
|
||||||
|
"IN": threadtree.IN,
|
||||||
|
"OUT": threadtree.OUT,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue