style: add HTMX

This commit is contained in:
David Bailey 2024-02-12 23:07:58 +01:00
parent a2c6842b71
commit b8e449006b
16 changed files with 299 additions and 84 deletions

View file

@ -0,0 +1,13 @@
<li class="folder-listing">
<span hx-boost="false"
hx-get="/ajax/open_folder_listing{{ post.post_path }}"
hx-target="closest li"
hx-swap="outerHTML">
{{ fa[post.post_metadata.icon] | raw }}
</span>
<a href={{post.post_path}}>
{{ post.post_metadata.title }}
</a>
</li>

View file

@ -0,0 +1,4 @@
{% for post in subposts %}
{{ include('ajax/folder_listing_entry.html') }}
{% endfor %}

View file

@ -0,0 +1,26 @@
<li class="folder-listing">
{% set folder_key = random() %}
<label for="folder-open-{{folder_key}}"
hx-trigger="click once queue:all"
hx-get="/ajax/folder_listing{{post.post_path}}"
hx-target="next ul">
{{ fa[post.post_metadata.icon] | raw }}
</label>
<a href={{post.post_path}}>
{{ post.post_metadata.title }}
</a>
<input type="checkbox" id="folder-open-{{folder_key}}">
<ul class="folder-listing">
<li>
<span>
Loading...
</span>
</li>
</ul>
</li>

View file

@ -0,0 +1,20 @@
<li class="folder-listing">
<span hx-boost="false"
hx-get="/ajax/closed_folder_listing{{ post.post_path }}"
hx-target="closest li"
hx-swap="outerHTML">
{{ fa[post.post_metadata.icon] | raw }}
</span>
<a href={{post.post_path}}>
{{ post.post_metadata.title }}
</a>
<ul class="folder-listing">
{% for post in subposts %}
{{ include('ajax/closed_folder_listing.html') }}
{% endfor %}
</ul>
</li>