gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit5db849745db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre5db84974/components/mymovies.hl

2.5 KB

  1. // components/mymovies.hl — `/my/movies` (tracker.worldapi.org#13): every MOVIE the signed-in user follows, the one
  2. // followed last on top — the architect: "/my/movies = the movies you follow, like /my/shows". A row: the small poster, the
  3. // title with its year linking to the movie's page (`/movies/<slug>`, tracker#21: the one title page and its Follow button).
  4. // Read-only like /my/shows, the same row look (the my-show-row tags/classes in styles.hl). Reused: `followsOfUser`,
  5. // `insertByFollowDesc` (follows.hl), `cardOf`, `posterUrlOfName` (shows.hl). tracker#30 (mission 025): the slim cached card per
  6. // movie and the user's cached watched set, no whole record (cast + crew) per load.
  7. // mission 058 (tracker#24): a movie watched on its page (watch `movie:<id>`, watches.hl) shows the solid check in its row,
  8. // and the count line says how many of them are watched ("3 movies · 1 watched"). The user's watched set (watchedSetOf, kept).
  9. parent './main.hl'
  10. import { appTitle } from '../lib/app.hl'
  11. import { userIdOfSession } from '../lib/users.hl'
  12. import { myMoviesRowsOf } from '../lib/follows.hl'
  13. import { watchedCountOf } from '../lib/watches.hl'
  14. session = null
  15. userId = userIdOfSession(&session)
  16. signedIn = userId != null
  17. // a plain copy of userId for `rows` (mission 047: session sync, see components/show.hl `me`)
  18. me = userId
  19. rows = signedIn ? myMoviesRowsOf(&me) : []
  20. hasRows = rows.length > 0
  21. noRows = !hasRows
  22. countText = rows.length + (rows.length == 1 ? ' movie' : ' movies') + ' · ' + watchedCountOf(&rows) + ' watched'
  23. emptyText = signedIn ? 'You follow no movies yet.' : 'Sign in to see the movies you follow.'
  24. __title = 'My movies — ' + appTitle
  25. // Component styles use the shared theme variables.
  26. Style {
  27. myMovieWatched {
  28. flex = 'none'
  29. display = 'grid'
  30. placeItems = 'center'
  31. width = '2rem'
  32. height = '2rem'
  33. }
  34. myMoviesPage {
  35. display = 'block'
  36. }
  37. }
  38. View {
  39. myMoviesPage {
  40. h1 { "My movies" }
  41. if (noRows) { p { class = "muted" emptyText } }
  42. if (hasRows) {
  43. p { class = "muted list-count" id = "mymovies-count" countText }
  44. myShowsRows {
  45. for (row of rows) {
  46. myShowRow {
  47. img { class = "myshow-poster" src = row.posterUrl alt = row.title }
  48. a { class = "myshow-title" href = row.href row.title }
  49. if (row.watched) {
  50. myMovieWatched { class = "checkicon solid" title = "Watched"
  51. svg { viewBox = "0 0 24 24" width = "22" height = "22" "aria-hidden" = "true"
  52. circle { cx = "12" cy = "12" r = "10" }
  53. path { d = "M7 12.5 L10.5 16 L17 8.5" }
  54. }
  55. }
  56. }
  57. }
  58. }
  59. }
  60. }
  61. }
  62. }

Branches

Latest commits

  • 5db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre
  • e84586a7Mission AP56bmre
  • 15917f03Record PR workflow rule (gitoria#50)mre
  • 942ac995status: paused workers statemre
  • 44b934e5log: respawn cleanupmre
  • 03a80097Log: Anton GC A/Bmre
  • c7cdef62Log: Apollo STOP, workers pausedmre
  • d0c083fbLog: usage stopmre
  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
  • 1eb6f1a1Missions AP56, BS1mre
  • 4871f8adLog: AP52 live on day52, browser gate greenmre
  • d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
  • c4a60ef2Log: RT52 retest passed, AP52 startedmre
  • 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
  • 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
  • 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
  • ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre
  • 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
  • 7c051eddLog: hybriel#338 answermre
  • d049b8b8Log: HM50 live, #52 donemre