diff options
Diffstat (limited to 'Biz/PodcastItLater/Web.py')
| -rw-r--r-- | Biz/PodcastItLater/Web.py | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/Biz/PodcastItLater/Web.py b/Biz/PodcastItLater/Web.py index 57d9b91..ab46811 100644 --- a/Biz/PodcastItLater/Web.py +++ b/Biz/PodcastItLater/Web.py @@ -543,35 +543,35 @@ class EpisodeList(Component[AnyChildren, EpisodeListAttrs]): episode_sqid = encode_episode_id(episode["id"]) is_public = episode.get("is_public", 0) == 1 - # Admin toggle button for public/private status - admin_toggle = html.div() + # Admin "Add to public feed" button at bottom of card + admin_button: html.div | html.button = html.div() if user and Core.is_admin(user): - admin_toggle = html.div( - html.button( - html.i( - classes=[ - "bi", - "bi-globe" if is_public else "bi-lock", - "me-1", - ], - ), - "Public" if is_public else "Private", + if is_public: + admin_button = html.button( + html.i(classes=["bi", "bi-check-circle-fill", "me-1"]), + "Added to public feed", + hx_post=f"/admin/episode/{episode['id']}/toggle-public", + hx_target="body", + hx_swap="outerHTML", + classes=["btn", "btn-sm", "btn-success", "mt-2"], + ) + else: + admin_button = html.button( + html.i(classes=["bi", "bi-plus-circle", "me-1"]), + "Add to public feed", hx_post=f"/admin/episode/{episode['id']}/toggle-public", hx_target="body", hx_swap="outerHTML", classes=[ "btn", "btn-sm", - "btn-success" if is_public else "btn-secondary", + "btn-outline-success", + "mt-2", ], - ), - classes=["position-absolute", "top-0", "end-0", "m-2"], - style={"z-index": "10"}, - ) + ) episode_items.append( html.div( - admin_toggle, html.div( html.h5( html.a( @@ -618,9 +618,11 @@ class EpisodeList(Component[AnyChildren, EpisodeListAttrs]): ) if episode.get("original_url") else html.div(), + # Admin button to add/remove from public feed + admin_button, classes=["card-body"], ), - classes=["card", "mb-3", "position-relative"], + classes=["card", "mb-3"], ), ) |
