diff options
Diffstat (limited to 'Biz/PodcastItLater')
| -rw-r--r-- | Biz/PodcastItLater/Episode.py | 9 | ||||
| -rw-r--r-- | Biz/PodcastItLater/Web.py | 40 |
2 files changed, 23 insertions, 26 deletions
diff --git a/Biz/PodcastItLater/Episode.py b/Biz/PodcastItLater/Episode.py index b7c302c..7090c70 100644 --- a/Biz/PodcastItLater/Episode.py +++ b/Biz/PodcastItLater/Episode.py @@ -156,8 +156,6 @@ class SignupBanner(Component[AnyChildren, SignupBannerAttrs]): @override def render(self) -> html.div: - creator_email = self.attrs["creator_email"] - return html.div( html.div( html.div( @@ -169,12 +167,9 @@ class SignupBanner(Component[AnyChildren, SignupBannerAttrs]): "me-2", ], ), - html.strong("This episode was created by "), - html.code( - creator_email, - classes=["text-dark"], + html.strong( + "This episode was created using PodcastItLater.", ), - html.strong(" using PodcastItLater."), classes=["mb-3"], ), html.div( 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"], ), ) |
