feat: reworked the template structure

This commit is contained in:
David Bailey 2024-08-29 20:40:36 +02:00
parent c607d57221
commit c9808f90f8
24 changed files with 216 additions and 80 deletions

View file

@ -0,0 +1,27 @@
<li class="folder-listing">
{% set folder_key = random() %}
<input type="checkbox" id="folder-open-{{folder_key}}" name="folder-open-{{folder_key}}">
<label for="folder-open-{{folder_key}}"
hx-trigger="click once queue:last, mouseenter once queue:all, intersect once queue:all"
hx-get="/ajax/fragments/directory/compact/listing.html?page={{ post.path }}"
hx-target="next ul">
{{ fa['folder'] | raw }}
{{ fa['folder-open'] | raw }}
</label>
<a href={{post.path}}>
{{ post.basename }} - {{ post.title }}
</a>
<ul class="folder-listing">
<li>
<span>
Loading...
</span>
</li>
</ul>
</li>

View file

@ -0,0 +1,4 @@
{% for post in page.child_posts %}
{{ include('fragments/directory/compact/entry.html') }}
{% endfor %}

View file

@ -0,0 +1,39 @@
<h3>Directory contents for {{page.basename}}:</h3>
<table class="directory">
<tr>
<th></th>
<th class="hsmol_hide">Name</th>
<th>Title</th>
<th class="entry_update_time hsmol_hide">Modified</th>
</tr>
<tr class="entry">
<td>
{{ fa['turn-up'] | raw }}
</td>
<td class="hsmol_hide">
<a href={{page.parent.path}}> .. </a>
</td>
<td class="entry_title">
<a href={{page.parent.path}}> .. </a>
</td>
<td class="entry_update_time hsmol_hide">
</td>
</tr>
{% for post in page.child_posts %}
<tr class="entry">
<td>
{{ fa[post.icon] | raw }}
</td>
<td class="hsmol_hide">
<a href={{post.path}}>{{post.basename}}</a>
</td>
<td class="entry_title">
<a href={{post.path}}>{{ post.title }}</a>
</td>
<td class="entry_update_time hsmol_hide">
{{ post.updated_at }}
</td>
</tr>
{% endfor %}
</table>