Slug-based RSS URLs and success flash messages
Build and Deploy / build-and-deploy (push) Successful in 45s
Build and Deploy / build-and-deploy (push) Successful in 45s
- Add podcast_slug to users with global uniqueness check
- RSS available at /rss/{slug} (path-based) with legacy ?slug= fallback
- Slug field in dashboard settings with validation (lowercase, hyphens)
- JS flash messages for success/error after form submissions
- Remove unused imports
This commit is contained in:
+4
-3
@@ -43,6 +43,7 @@ func (h *EpisodeHandler) ServeDashboard(w http.ResponseWriter, r *http.Request)
|
||||
h.Tpl.Render(w, "dashboard", map[string]any{
|
||||
"Episodes": episodes,
|
||||
"PodcastTitle": title,
|
||||
"PodcastSlug": user.PodcastSlug,
|
||||
"PodcastImage": user.PodcastImage,
|
||||
"PodcastAuthor": user.PodcastAuthor,
|
||||
"BaseURL": h.BaseURL,
|
||||
@@ -105,7 +106,7 @@ func (h *EpisodeHandler) ServeNew(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
return
|
||||
}
|
||||
http.Redirect(w, r, "/", http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/?success=episode+created", http.StatusSeeOther)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +182,7 @@ func (h *EpisodeHandler) ServeEdit(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "update failed", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
http.Redirect(w, r, "/", http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/?success=episode+updated", http.StatusSeeOther)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +209,7 @@ func (h *EpisodeHandler) ServeDelete(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "delete failed", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
http.Redirect(w, r, "/", http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/?success=episode+deleted", http.StatusSeeOther)
|
||||
}
|
||||
|
||||
func (h *EpisodeHandler) ServeUpload(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user