headline/view/templates/article_detail.html

62 lines
1.7 KiB
HTML
Raw Normal View History

2023-08-16 23:01:45 +02:00
{% extends "base.html" %}
{% block body %}
2023-08-20 16:22:59 +02:00
<div class="container my-6">
<h1 class="text-lg mb-6">
2023-08-17 17:03:18 +02:00
Diffs for the article at
<a href="{{ article_url }}">{{ article_url|truncate(50) }}</a>
</h1>
2023-08-20 16:22:59 +02:00
<section class="mb-6" id="filters" hx-preserve>
<label class="checkbox">
<input type="checkbox" x-model="expandDiffs" x-bind:checked="expandDiffs" />
<p>Expand diffs</p>
</label>
</section>
<section class="card">
2023-08-20 16:22:59 +02:00
<ul class="md:hidden list-none p-0">
2023-08-17 22:49:13 +02:00
{% for diff in diffs %}
2023-08-20 16:22:59 +02:00
<div class="px-4 py-3 border-b">
<p class="text-caption mb-2">{{ diff.diff_time }}</p>
<p x-bind:class="{ hidden: expandDiffs }">{{ diff.diff_html|safe }}</p>
<div x-bind:class="{ hidden: !expandDiffs }">
<div class="mb-2">
<p class="text-caption mb-2">Before</p>
<p class="diff-before">{{ diff.diff_html|safe }}</p>
</div>
<div>
<p class="text-caption mb-2">After</p>
<p class="diff-after">{{ diff.diff_html|safe }}</p>
</div>
2023-08-17 22:49:13 +02:00
</div>
</div>
{% endfor %}
2023-08-20 16:22:59 +02:00
</ul>
2023-08-17 22:49:13 +02:00
2023-08-20 16:22:59 +02:00
<table class="hidden md:display-table table-styled">
2023-08-17 11:03:34 +02:00
{% for diff in diffs %}
<tr>
2023-08-20 16:22:59 +02:00
<th class="text-caption">{{ diff.diff_time }}</th>
<td class="p-0 w-full">
<p x-bind:class="{ hidden: expandDiffs }">
{{ diff.diff_html|safe }}
</p>
<table class="table-styled" x-bind:class="{ hidden: !expandDiffs }">
2023-08-17 16:54:52 +02:00
<tr>
2023-08-20 16:22:59 +02:00
<th class="text-caption">Before</th>
<td class="diff-before w-full">{{ diff.diff_html|safe }}</td>
2023-08-17 16:54:52 +02:00
</tr>
<tr>
2023-08-20 16:22:59 +02:00
<th class="text-caption">After</th>
<td class="diff-after w-full">{{ diff.diff_html|safe }}</td>
2023-08-17 16:54:52 +02:00
</tr>
</table>
</td>
2023-08-17 11:03:34 +02:00
</tr>
{% endfor %}
</table>
</section>
2023-08-16 23:01:45 +02:00
</div>
{% endblock body %}