Fix trending scope default and filter logicUnverified
a091372 parent: f988072 modified
internal/server/trending_handler.go +2 -2 | @@ -11,8 +11,8 @@ func (s *Server) handleTrending(w http.ResponseWriter, r *http.Request) { | ||
| 11 | 11 | user := currentUser(r) |
| 12 | 12 | |
| 13 | 13 | scope := r.URL.Query().Get("scope") |
| 14 | - if scope != "all" { | |
| 15 | - scope = "for-me" | |
| 14 | + if scope != "for-me" { | |
| 15 | + scope = "all" | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | page := pageFromRequest(r, 25) |
| @@ -11,8 +11,8 @@ func (s *Server) handleTrending(w http.ResponseWriter, r *http.Request) { | |||
| 11 | user := currentUser(r) | 11 | user := currentUser(r) |
| 12 | 12 | ||
| 13 | scope := r.URL.Query().Get("scope") | 13 | scope := r.URL.Query().Get("scope") |
| 14 | - if scope != "all" { | 14 | + if scope != "for-me" { |
| 15 | - scope = "for-me" | 15 | + scope = "all" |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | page := pageFromRequest(r, 25) | 18 | page := pageFromRequest(r, 25) |
modified
internal/tmpl/articles.html +2 -2 | @@ -24,8 +24,8 @@ | ||
| 24 | 24 | <div class="flex items-center gap-2 shrink-0"> |
| 25 | 25 | <a href="/articles?status=all{{if .FeedURL}}&feed={{.FeedURL}}{{end}}" |
| 26 | 26 | class="px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-button transition |
| 27 | - {{if eq .Status ""}}bg-spot-active-pill-bg text-spot-active-pill-text{{else}}bg-spot-hover text-spot-secondary hover:text-spot-text{{end}}"> | |
| 28 | - All | |
| 27 | + {{if or (eq .Status "") (eq .Status "all")}}bg-spot-active-pill-bg text-spot-active-pill-text{{else}}bg-spot-hover text-spot-secondary hover:text-spot-text{{end}}"> | |
| 28 | + All | |
| 29 | 29 | </a> |
| 30 | 30 | <a href="/articles?status=unread{{if .FeedURL}}&feed={{.FeedURL}}{{end}}" |
| 31 | 31 | class="px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-button transition |
| @@ -24,8 +24,8 @@ | |||
| 24 | <div class="flex items-center gap-2 shrink-0"> | 24 | <div class="flex items-center gap-2 shrink-0"> |
| 25 | <a href="/articles?status=all{{if .FeedURL}}&feed={{.FeedURL}}{{end}}" | 25 | <a href="/articles?status=all{{if .FeedURL}}&feed={{.FeedURL}}{{end}}" |
| 26 | class="px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-button transition | 26 | class="px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-button transition |
| 27 | - {{if eq .Status ""}}bg-spot-active-pill-bg text-spot-active-pill-text{{else}}bg-spot-hover text-spot-secondary hover:text-spot-text{{end}}"> | 27 | + {{if or (eq .Status "") (eq .Status "all")}}bg-spot-active-pill-bg text-spot-active-pill-text{{else}}bg-spot-hover text-spot-secondary hover:text-spot-text{{end}}"> |
| 28 | - All | 28 | + All |
| 29 | </a> | 29 | </a> |
| 30 | <a href="/articles?status=unread{{if .FeedURL}}&feed={{.FeedURL}}{{end}}" | 30 | <a href="/articles?status=unread{{if .FeedURL}}&feed={{.FeedURL}}{{end}}" |
| 31 | class="px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-button transition | 31 | class="px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-button transition |