back interdiff of round #1 and #0

appview: allow timeline db queries to be filterable by users follows #626

closed
opened by willdot.net targeting master from willdot.net/tangled-core: feat/filter-user-timeline

Signed-off-by: Will Andrews did:plc:dadhhalkfcq3gucaq25hjqon

files
appview
db
pages
templates
timeline
fragments
state
ERROR
appview/db/timeline.go

Failed to calculate interdiff for this file.

REVERTED
appview/state/state.go
··· 234 234 if user != nil { 235 235 userDid = user.Did 236 236 } 237 + timeline, err := db.MakeTimeline(s.db, 50, userDid) 237 - timeline, err := db.MakeTimeline(s.db, 50, userDid, false) 238 238 if err != nil { 239 239 log.Println(err) 240 240 s.pages.Notice(w, "timeline", "Uh oh! Failed to load timeline.")
NEW
appview/pages/pages.go
··· 306 306 LoggedInUser *oauth.User 307 307 Timeline []models.TimelineEvent 308 308 Repos []models.Repo 309 + Filtered bool 309 310 } 310 311 311 312 func (p *Pages) Timeline(w io.Writer, params TimelineParams) error {
NEW
appview/pages/templates/timeline/fragments/timeline.html
··· 1 1 {{ define "timeline/fragments/timeline" }} 2 2 <div class="py-4"> 3 - <div class="px-6 pb-4"> 4 - <p class="text-xl font-bold dark:text-white">Timeline</p> 3 + 4 + <div class="flex gap-2 px-6 pb-4"> 5 + <div> 6 + <p class="text-xl font-bold dark:text-white">Timeline</p> 7 + </div> 8 + {{ if .LoggedInUser }} 9 + <div> 10 + {{ if .Filtered }} 11 + <a href="/timeline" class="hover:underline text-sm"> 12 + Show All 13 + </a> 14 + {{ else }} 15 + <a href="/timeline?filtered=true" class="hover:underline text-sm"> 16 + Show following only 17 + </a> 18 + {{ end }} 19 + </div> 20 + {{ end }} 5 21 </div> 6 22 7 23 <div class="flex flex-col gap-4">