Finalize secret tree page

This commit is contained in:
2025-06-11 19:10:00 +02:00
parent 0eaa913e35
commit b3debd3ed2
4 changed files with 64 additions and 112 deletions

View File

@ -27,6 +27,11 @@
{% if group.group_name in group_path_nodes %}
expanded=""
{% endif %}
{% if selected_group | default(None) %}
{% if group.path == selected_group %}
selected=""
{% endif %}
{% endif %}
{% endif %}
>
@ -77,7 +82,13 @@
id="secret-group-root-item"
data-type="root"
data-name="root"
expanded=""
{% if "/" in group_path_nodes %}
expanded=""
{% endif %}
{% if selected_group == "/"%}
selected=""
{% endif %}
>
<sl-icon name="folder"> </sl-icon>
<span class="px-2">Ungrouped</span>

View File

@ -1,14 +1,14 @@
<div class="w-full">
<div class="mb-4">
<h3 class="text-xl font-semibold dark:text-white">Group {{name}}</h3>
<h3 class="text-xl font-semibold dark:text-white">Group {{group.group_name}}</h3>
{% if description %}
<span class="text-sm text-gray-500 dark:text-gray-400">{{ description }}</span>
<span class="text-sm text-gray-500 dark:text-gray-400">{{ group.description }}</span>
{% endif %}
</div>
<sl-details summary="Create secret">
<form
hx-post="/secrets/create/group/{{ name }}"
hx-post="/secrets/create/group/{{ group.group_name }}"
hx-target="#secretdetails"
hx-swap="OuterHTML"
>
@ -48,7 +48,7 @@
placeholder="Description"
/>
</div>
<input type="hidden" name="parent_group" value="{{ name }}" />
<input type="hidden" name="parent_group" value="{{ group.group_name }}" />
<button
type="submit"
class="text-white w-full justify-center bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"
@ -59,7 +59,7 @@
</sl-details>
<sl-details summary="Edit group">
<form
hx-put="/secrets/partial/group/{{name}}/description"
hx-put="/secrets/partial/group/{{group.group_name}}/description"
hx-target="#secretdetails"
hx-swap="OuterHTML"
>
@ -77,7 +77,7 @@
name="description"
id="description"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
value="{{ description }}"
value="{{ group.description }}"
required=""
/>
</div>
@ -91,7 +91,7 @@
<button
type="button"
class="inline-flex items-center px-3 py-2 text-sm font-medium text-center text-white bg-red-700 rounded-lg hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:focus:ring-red-900"
hx-delete="/secrets/group/{{ name }}"
hx-delete="/secrets/group/{{ group.group_name }}"
hx-target="#secretdetails"
hx-swap="OuterHTML"
hx-confirm="Deleting a group will move all its secrets to the Ungrouped category. Continue?"

View File

@ -0,0 +1,7 @@
<div class="w-full" id="secretdetails">
<a
href="{{ destination }}"
class="font-medium text-blue-600 dark:text-blue-500 hover:underline">
Redirecting...
</a>
</div>