Tree thread preference seems to be working.
This commit is contained in:
parent
77e352b820
commit
70e0eeafd8
|
@ -18,22 +18,32 @@ mastodon.status_context(<numerical id>)
|
|||
<h1 id="title" class="title">
|
||||
Thread
|
||||
</h1>
|
||||
{% for op in toots %}
|
||||
{% if op == IN %}
|
||||
<ul>
|
||||
{% elif op == OUT %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<li>
|
||||
{% if op.toot == toot %}
|
||||
{% include "main/toot_partial.html" with toot=op.toot active=True %}
|
||||
{% else %}
|
||||
{% include "main/toot_partial.html" with toot=op.toot %}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if preferences.tree_threads %}
|
||||
{% for op in toots %}
|
||||
{% if op == IN %}
|
||||
<ul>
|
||||
{% elif op == OUT %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<li>
|
||||
{% if op.toot == activetoot %}
|
||||
{% include "main/toot_partial.html" with toot=op.toot active=True %}
|
||||
{% else %}
|
||||
{% include "main/toot_partial.html" with toot=op.toot %}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% include "main/toot_partial.html" with toot=root %}
|
||||
{% for cur in descendants %}
|
||||
{% if cur == activetoot %}
|
||||
{% include "main/toot_partial.html" with toot=cur active=True %}
|
||||
{% else %}
|
||||
{% include "main/toot_partial.html" with toot=cur %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if not preferences.no_javascript %}
|
||||
<script type="application/javascript">
|
||||
Intercooler.ready(expandCWButtonPrepare);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="subtitle">Options</h2>
|
||||
<div class="columns">
|
||||
<div class="column is-quarter">
|
||||
|
@ -43,7 +42,7 @@
|
|||
{{ form.preview_sensitive.help_text }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column is-quarter">
|
||||
<label class="label checkbox" for="id_open_details">
|
||||
|
@ -56,7 +55,22 @@
|
|||
{{ form.open_detail.help_text }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column is-quarter">
|
||||
<label class="label checkbox" for="id_tree_threads">
|
||||
{% render_field form.tree_threads class+="checkbox" %}
|
||||
{{ form.tree_threads.label }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="column is-quarter">
|
||||
<p class="notification is-info preferences-help">
|
||||
{{ form.tree_threads.help_text }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="column is-half">
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="subtitle">Timeline Options</h2>
|
||||
<div class="field">
|
||||
<label class="label checkbox">
|
||||
|
|
|
@ -692,20 +692,28 @@ def thread(request, id):
|
|||
# descendants = [
|
||||
# x for x in context.descendants if not toot_matches_filters(x, filters)
|
||||
# ]
|
||||
toots = tuple(threadtree.build(mastodon, root, context.descendants))
|
||||
if account.preferences.tree_threads:
|
||||
toots = tuple(threadtree.build(mastodon, root, context.descendants))
|
||||
def vars(defaults):
|
||||
defaults['toots'] = toots
|
||||
defaults['IN'] = threadtree.IN
|
||||
defaults['OUT'] = threadtree.OUT
|
||||
return defaults
|
||||
else:
|
||||
def vars(defaults):
|
||||
defaults['descendants'] = context.descendants
|
||||
defaults['root'] = toot
|
||||
return defaults
|
||||
return render(
|
||||
request,
|
||||
"main/thread.html",
|
||||
{
|
||||
vars({
|
||||
"context": context,
|
||||
"toot": toot,
|
||||
"toots": toots,
|
||||
"activetoot": toot,
|
||||
"own_acct": request.session["active_user"],
|
||||
"notifications": notifications,
|
||||
"preferences": account.preferences,
|
||||
"IN": threadtree.IN,
|
||||
"OUT": threadtree.OUT,
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue