summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater/Web.py
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-16 09:26:53 -0500
committerBen Sima <ben@bsima.me>2025-11-16 09:26:53 -0500
commit2e95d6eba0d6292ec263ebd8723b6b4fb2c36268 (patch)
tree5bc5d01baccc822d92173d96bc23fea54c57deef /Biz/PodcastItLater/Web.py
parentf3167698665482c8ee2ed9a02d84315f599031f0 (diff)
Improve privacy and UX for public feed controls
Privacy improvements: - Removed email address from episode page signup banner - Changed 'This episode was created by <email>' to 'This episode was created using PodcastItLater' - Protects user privacy while still showing the signup prompt Admin UI improvements: - Removed floating Public/Private toggle button (was confusing) - Added '+ Add to public feed' button at bottom of episode cards - Button only visible to admin users - Shows 'Added to public feed' with checkmark when already public - Shows '+ Add to public feed' with plus icon when private - Clearer and more actionable UX for managing public feed content All tests passing (48 tests)
Diffstat (limited to 'Biz/PodcastItLater/Web.py')
-rw-r--r--Biz/PodcastItLater/Web.py40
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"],
),
)