diff --git a/api/watchlist/handler.go b/api/watchlist/handler.go index 468876c..cfe31e7 100644 --- a/api/watchlist/handler.go +++ b/api/watchlist/handler.go @@ -211,11 +211,6 @@ func (h *Handler) HandleGetWatchlist(w http.ResponseWriter, r *http.Request) { return } - layout := r.URL.Query().Get("view") - if layout != "grid" && layout != "table" { - layout = "grid" - } - statusFilter := r.URL.Query().Get("status") sortBy := r.URL.Query().Get("sort") sortOrder := r.URL.Query().Get("order") @@ -255,7 +250,7 @@ func (h *Handler) HandleGetWatchlist(w http.ResponseWriter, r *http.Request) { // Sort entries h.sortEntries(filteredEntries, sortBy, sortOrder) - if err := templates.Watchlist(filteredEntries, layout, statusFilter, sortBy, sortOrder).Render(r.Context(), w); err != nil { + if err := templates.Watchlist(filteredEntries, statusFilter, sortBy, sortOrder).Render(r.Context(), w); err != nil { log.Printf("render error: %v", err) http.Error(w, "Internal Server Error", http.StatusInternalServerError) } diff --git a/web/components/sort_filter.templ b/web/components/sort_filter.templ index 745f07c..795222d 100644 --- a/web/components/sort_filter.templ +++ b/web/components/sort_filter.templ @@ -3,7 +3,6 @@ package ui type SortFilterOptions struct { Sort string // "title", "date" Order string // "asc", "desc" - View string // for watchlist: "grid", "table" Status string // for watchlist: "all", "watching", etc } @@ -27,9 +26,6 @@ templ SortFilter(opts SortFilterOptions) { -
- - Grid - - - Table - -
+
All Watching On hold Plan to watch Dropped Completed @@ -118,7 +102,6 @@ templ Watchlist( @components.SortFilter(components.SortFilterOptions{ Sort: sortBy, Order: sortOrder, - View: viewLayout, Status: currentStatus, }) if len(entries) == 0 { @@ -130,92 +113,43 @@ templ Watchlist( } } } else { - if viewLayout == "grid" { -
- for _, entry := range entries { - - } else { - - - - - - - - - - for _, entry := range entries { - - - - - - } - -
Title
- - { - - - - { entry.DisplayTitle() } - - @watchlist.Progress(entry) - - -
- } +
+ { +
+
+
+ { entry.DisplayTitle() } +
+ @watchlist.Progress(entry) + + +
+ } +
} } }