style: ✨ add HTMX
This commit is contained in:
parent
a2c6842b71
commit
b8e449006b
16 changed files with 299 additions and 84 deletions
13
www/templates/ajax/closed_folder_listing.html
Normal file
13
www/templates/ajax/closed_folder_listing.html
Normal 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>
|
4
www/templates/ajax/folder_listing.html
Normal file
4
www/templates/ajax/folder_listing.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
{% for post in subposts %}
|
||||
{{ include('ajax/folder_listing_entry.html') }}
|
||||
{% endfor %}
|
26
www/templates/ajax/folder_listing_entry.html
Normal file
26
www/templates/ajax/folder_listing_entry.html
Normal 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>
|
20
www/templates/ajax/open_folder_listing.html
Normal file
20
www/templates/ajax/open_folder_listing.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue