aboutsummaryrefslogtreecommitdiffstats
path: root/templates/fragments
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2023-10-12 09:39:50 +0300
committerJan Tuomi <jans.tuomi@gmail.com>2023-10-12 09:43:39 +0300
commit9cb1b001ae709fc40dc3502f2e7d56178fee4acf (patch)
tree15bf9c7f8f10035c616c13e38fd20003d4cd67fd /templates/fragments
parent873e0766f31dd427f52f0d51477ec71173eed5fa (diff)
Improve stuffHEADmain
Diffstat (limited to 'templates/fragments')
-rw-r--r--templates/fragments/file_browser.html16
-rw-r--r--templates/fragments/files_drawer_form.html2
-rw-r--r--templates/fragments/files_list.html18
3 files changed, 17 insertions, 19 deletions
diff --git a/templates/fragments/file_browser.html b/templates/fragments/file_browser.html
new file mode 100644
index 0000000..54a0f35
--- /dev/null
+++ b/templates/fragments/file_browser.html
@@ -0,0 +1,16 @@
+<ul>
+{% for item in listing %}
+ <li>
+ {% if item.kind == "file" %}
+ <a href="{{ item.static_path }}">📄 {{ item.name }}</a>
+ {% else %}
+ <a
+ href="/?show_files=1&dir={{ item.full_path | urlencode }}"
+ hx-post="/navigate_files/{{ item.full_path | urlencode }}"
+ hx-trigger="click"
+ hx-target="#file-browser"
+ hx-swap="outerHTML">📂 {{ item.name }}/</a>
+ {% endif %}
+ </li>
+{% endfor %}
+</ul>
diff --git a/templates/fragments/files_drawer_form.html b/templates/fragments/files_drawer_form.html
index 8b277da..423d4d7 100644
--- a/templates/fragments/files_drawer_form.html
+++ b/templates/fragments/files_drawer_form.html
@@ -15,7 +15,7 @@
{% if not files_expanded %}
<style>
- #files-list {
+ #file-browser {
display: none;
}
</style>
diff --git a/templates/fragments/files_list.html b/templates/fragments/files_list.html
deleted file mode 100644
index aba3000..0000000
--- a/templates/fragments/files_list.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<div id="files-list">
- <ul>
- {% for item in listing %}
- <li>
- {% if item.kind == "file" %}
- <a href="{{ item.static_path }}">📄 {{ item.name }}</a>
- {% else %}
- <a
- href="/?show_files=1&dir={{ item.full_path | urlencode }}"
- hx-post="/navigate_files/{{ item.full_path | urlencode }}"
- hx-trigger="click"
- hx-target="#files-list"
- hx-swap="outerHTML">📂 {{ item.name }}/</a>
- {% endif %}
- </li>
- {% endfor %}
- </ul>
-</div>