-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only update affected media list when deleting destination in HTMX fro…
…ntend * Update only related list when deleting destination * Remove functionality for generic error This was added so the "This destination cannot be deleted error" could be shown separate from field specific errors, but after the changes done to the delete endpoint this is no longer used. _render_destination_list is complicated enough as-is that removing this makes it a bit nicer
- Loading branch information
Showing
6 changed files
with
38 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Only update the related media list when deleting a destination. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/argus/htmx/templates/htmx/destination/_collapse_with_forms.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<details class="collapse bg-base-200 collapse-arrow" open=""> | ||
<summary class="collapse-title text-xl font-medium">{{ media.name }} ({{ forms|length }})</summary> | ||
<div class="collapse-content"> | ||
{% if error_msg %}<p class="text-error">{{ error_msg }}</p>{% endif %} | ||
{% for form in forms %} | ||
<div class="flex w-full h-fit items-center justify-center"> | ||
{% include "htmx/destination/_edit_form.html" %} | ||
{% include "htmx/destination/_delete_form.html" %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<div id="destination-content" class="flex flex-col items-center gap-4"> | ||
{% include "htmx/destination/_create_form.html" %} | ||
{% for error in errors %}<p class="text-error">{{ error }}</p>{% endfor %} | ||
{% include "htmx/destination/_form_list.html" %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,5 @@ | ||
<div id="form-list" class="flex flex-col max-w-4xl w-full gap-4"> | ||
{% for media, forms in grouped_forms.items %} | ||
<details class="collapse bg-base-200 collapse-arrow" open=""> | ||
<summary class="collapse-title text-xl font-medium">{{ media.name }} ({{ forms|length }})</summary> | ||
<div class="collapse-content"> | ||
{% for form in forms %} | ||
<div class="flex w-full h-fit items-center justify-center"> | ||
{% include "htmx/destination/_edit_form.html" %} | ||
{% include "htmx/destination/_delete_form.html" %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</details> | ||
{% include "htmx/destination/_collapse_with_forms.html" with error_msg=None %} | ||
{% endfor %} | ||
</div> |