2018-04-27 00:49:43 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% load humanize %}
|
|
|
|
|
|
|
|
{% block title %}
|
2018-08-23 17:19:32 +02:00
|
|
|
Brutaldon ({{ own_acct.username }}) - thread
|
2018-04-27 00:49:43 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% comment %}
|
|
|
|
mastodon.status_context(<numerical id>)
|
2018-08-23 17:19:32 +02:00
|
|
|
# Returns the following dictionary:
|
|
|
|
{
|
|
|
|
'ancestors': # A list of toot dicts
|
|
|
|
'descendants': # A list of toot dicts
|
|
|
|
}
|
|
|
|
{% endcomment %}
|
2018-04-27 00:49:43 +02:00
|
|
|
|
2018-08-23 17:19:32 +02:00
|
|
|
{% block content %}
|
|
|
|
<h1 id="title" class="title">
|
|
|
|
Thread
|
|
|
|
</h1>
|
2018-04-27 00:49:43 +02:00
|
|
|
{% for ancestor in context.ancestors %}
|
2018-08-23 17:19:32 +02:00
|
|
|
{% include "main/toot_partial.html" with toot=ancestor %}
|
|
|
|
<hr class="is-hidden">
|
2018-04-27 00:49:43 +02:00
|
|
|
{% endfor %}
|
2018-08-23 17:19:32 +02:00
|
|
|
{% include "main/toot_partial.html" with toot=toot active=True %}
|
2018-04-27 01:46:05 +02:00
|
|
|
<hr class="is-hidden">
|
2018-04-27 00:49:43 +02:00
|
|
|
{% for descendant in context.descendants %}
|
2018-08-23 17:19:32 +02:00
|
|
|
{% include "main/toot_partial.html" with toot=descendant %}
|
|
|
|
<hr class="is-hidden">
|
2018-04-27 00:49:43 +02:00
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
2018-08-23 17:19:32 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block page_scripts_inline %}
|
|
|
|
<script type="application/javascript">
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
var theButton = document.createElement('p');
|
|
|
|
theButton.textContent = "Expand CWs";
|
|
|
|
theButton.classList.toggle('button');
|
|
|
|
document.querySelector('#title').insertAdjacentElement('afterend', theButton);
|
|
|
|
var details = document.querySelectorAll('details');
|
|
|
|
var openState = false;
|
|
|
|
|
|
|
|
if (details != null) {
|
|
|
|
theButton.addEventListener('click', function() {
|
|
|
|
openState = details.item(0).hasAttribute('open');
|
|
|
|
details.forEach(function ($el) {
|
|
|
|
if (openState)
|
|
|
|
{
|
|
|
|
$el.removeAttribute('open');
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
$el.setAttribute('open', '');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
openState = !openState;
|
|
|
|
if (openState) { theButton.textContent = 'Collapse CWs'; }
|
|
|
|
else { theButton.textContent = "Expand CWs"; };
|
|
|
|
theButton.classList.toggle('is-active');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|