You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
3.6 KiB
82 lines
3.6 KiB
{% extends 'layout.html.twig' %} |
|
|
|
{% block body %} |
|
<h1>Magazines</h1> |
|
|
|
{% if magazines is empty %} |
|
<p>No magazines found.</p> |
|
{% else %} |
|
<ul class="list-unstyled mb-3"> |
|
{% for mag in magazines %} |
|
<li class="mb-2"> |
|
<details open> |
|
<summary> |
|
<strong>📁 {{ mag.name }}</strong> |
|
<small class="text-muted">(slug: {{ mag.slug }})</small> |
|
<!-- Top-level Edit now points to wizard category management --> |
|
<a class="btn btn-sm ms-2" href="{{ path('mag_wizard_edit', {slug: mag.slug}) }}">Edit</a> |
|
</summary> |
|
{% if mag.categories is not empty %} |
|
<ul class="list-unstyled ms-3 mt-2"> |
|
{% for cat in mag.categories %} |
|
<li class="mb-1"> |
|
<details> |
|
<summary> |
|
📁 {{ cat.name }} <small class="text-muted">(slug: {{ cat.slug }})</small> |
|
<a class="btn btn-sm ms-2" href="{{ path('admin_magazine_edit', {slug: cat.slug}) }}">Edit</a> |
|
</summary> |
|
{% if cat.files is not empty %} |
|
<div class="ms-3 mt-2"> |
|
<table class="magazine-table"> |
|
<thead> |
|
<tr> |
|
<th>Article</th> |
|
<th>Author</th> |
|
<th>Date</th> |
|
<th>Coordinate</th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
{% for file in cat.files %} |
|
<tr> |
|
<td> |
|
📄 <a href="{{ path('article-slug', {slug: file.slug|url_encode}) }}">{{ file.name }}</a> |
|
<div class="small text-muted">slug: {{ file.slug }}</div> |
|
</td> |
|
<td class="author"> |
|
{% if file.authorPubkey %} |
|
<twig:Molecules:UserFromNpub :ident="file.authorPubkey" /> |
|
{% else %} |
|
<span class="text-muted">unknown author</span> |
|
{% endif %} |
|
</td> |
|
<td class="author"> |
|
{% if file.date %} |
|
<span class="small text-muted">{{ file.date|date('M j, Y') }}</span> |
|
<div class="small text-muted">{{ file.date|date('H:i') }}</div> |
|
{% else %} |
|
<span class="small text-muted">—</span> |
|
{% endif %} |
|
</td> |
|
<td class="small text-muted">{{ file.coordinate }}</td> |
|
</tr> |
|
{% endfor %} |
|
</tbody> |
|
</table> |
|
</div> |
|
{% else %} |
|
<div class="ms-3 text-muted">No articles.</div> |
|
{% endif %} |
|
</details> |
|
</li> |
|
{% endfor %} |
|
</ul> |
|
{% else %} |
|
<div class="ms-3 text-muted">No categories.</div> |
|
{% endif %} |
|
</details> |
|
</li> |
|
{% endfor %} |
|
</ul> |
|
{% endif %} |
|
{% endblock %}
|
|
|