diff options
Diffstat (limited to 'Biz/PodcastItLater/Web.py')
| -rw-r--r-- | Biz/PodcastItLater/Web.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Biz/PodcastItLater/Web.py b/Biz/PodcastItLater/Web.py index 71970cd..f4c65b1 100644 --- a/Biz/PodcastItLater/Web.py +++ b/Biz/PodcastItLater/Web.py @@ -433,7 +433,7 @@ class QueueStatus(Component[AnyChildren, QueueStatusAttrs]): if item["error_message"] else [] ), - # Add cancel button for pending jobs + # Add cancel button for pending jobs, remove for others html.div( html.button( html.i(classes=["bi", "bi-x-lg", "me-1"]), @@ -451,11 +451,28 @@ class QueueStatus(Component[AnyChildren, QueueStatusAttrs]): "btn-outline-danger", "mt-2", ], + ) + if item["status"] == "pending" + else html.button( + html.i(classes=["bi", "bi-trash", "me-1"]), + "Remove", + hx_delete=f"/queue/{item['id']}", + hx_trigger="click", + hx_confirm="Remove this item from the queue?", + hx_on=( + "htmx:afterRequest: " + "if(event.detail.successful) " + "htmx.trigger('body', 'queue-updated')" + ), + classes=[ + "btn", + "btn-sm", + "btn-outline-secondary", + "mt-2", + ], ), classes=["mt-2"], - ) - if item["status"] == "pending" - else html.div(), + ), classes=["card-body"], ), classes=["card", "mb-2"], |
