film.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>{{.Data.Title}}{{if not .Data.Release_date.IsZero}} ({{.Data.Release_date.Year}}){{end}} — a·muse</title>
  7. <link rel="stylesheet" href="/static/style/style.css" />
  8. <link rel="icon" type="image/svg+xml" href="/static/img/logo.svg">
  9. <link rel="apple-touch-icon" type="image/svg+xml" href="/static/img/logo.svg">
  10. </head>
  11. <body>
  12. <header class="w12 padding-bottom-_25 flex flex-row flex-justify-space flex-align-centre bg-primary">
  13. <a href="/" class="decoration-none">
  14. <h1 class="inline valign-mid text-white sans margin-lr-1">a·muse</h1>
  15. </a>
  16. <form action="/items/" method="get" class="flex inline margin-lr-1 border-bottom-white">
  17. <input type="search" name="q" class="phone-max-width-8 border-none bg-none sans text-white" placeholder="{{.Strings.Global.search}}" />
  18. </form>
  19. <div class="margin-lr-1 text-white">
  20. {{ if .State.User.IsEmpty }}
  21. <a href="/login" class="decoration-none sans">{{.Strings.Global.log_in}}</a>
  22. <a href="/signup" class="decoration-none sans">{{.Strings.Global.sign_up}}</a>
  23. {{ else }}
  24. <nav class="text">
  25. <label for="hamburger" class="cursor-hand">
  26. <img src="/users/{{.State.User.Username}}/avatar?size=small" class="border-radius-25 width-1_5"/>
  27. </label>
  28. <input type="checkbox" id="hamburger" class="display-none" />
  29. <ul class="absolute right top-1 padding-lr-1 padding-tb-_5 bg align-right list-style-none sans">
  30. <!--<li><a href="/users/{{.State.User.Username}}" class="decoration-none text-accent">{{.Strings.Global.account}}</a><span class="material-icon padding-lr-_5">&#xe851;</span></li>-->
  31. <li><a href="/users/{{.State.User.Username}}/watchlist" class="decoration-none text-accent">{{.Strings.Global.watchlist}}</a><span class="material-icon padding-lr-_5">&#xe04a;</span></li>
  32. <li><a href="/users/{{.State.User.Username}}/tvqueue" class="decoration-none text-accent">{{.Strings.Global.tv_queue}}</a><span class="material-icon padding-lr-_5">&#xe1b2;</span></li>
  33. <li><a href="/users/{{.State.User.Username}}/readlist" class="decoration-none text-accent">{{.Strings.Global.readlist}}</a><span class="material-icon padding-lr-_5">&#xe431;</span></li>
  34. <li><a href="/users/{{.State.User.Username}}/experiences" class="decoration-none text-accent">{{.Strings.Global.experiences}}</a><span class="material-icon padding-lr-_5">&#xe042;</span></li>
  35. <li class="bg-error">
  36. <form action="/users/{{.State.User.Username}}/sessions/{{.State.User.Session}}" method="POST" class="inline">
  37. <input type="hidden" value="DELETE" name="method" />
  38. <input type="submit" value="{{.Strings.Global.log_out}}" class="border-none bg-none font-normal text-accent padding-lr-0 cursor-hand font-1" />
  39. </form><span class="material-icon padding-lr-_5 text-white">&#xe7ff;</span>
  40. </li>
  41. </ul>
  42. </nav>
  43. {{ end }}
  44. </div>
  45. </header>
  46. <div class="absolute top behind w12">
  47. {{if .Data.Backdrop_path}}
  48. <img src="https://image.tmdb.org/t/p/original{{.Data.Backdrop_path}}" class="w12 cover height-30" />
  49. {{else}}
  50. <img src="/static/img/film_backdrop.webp" class="w12 cover height-30" /> <!-- Photo by [mujipanda](https://pixabay.com/users/mujipanda-2035588/) from [Pixabay](https://pixabay.com/photos/menu-cinema-singapore-old-cinema-1192534/) -->
  51. {{end}}
  52. <div class="on-desktop relative bottom-4 sans inline-block w12 padding-l-16 font-3 bg-gradient">
  53. <span class="text-white">{{.Data.Title}}</span>
  54. {{if not .Data.Release_date.IsZero}}
  55. <span class="text-unimportant font-thin font-2">({{.Data.Release_date.Year}})</span>
  56. {{end}}
  57. </div>
  58. </div>
  59. <main class="margin-top-20 margin-lr-5 flex flex-row flex-wrap flex-justify-space flex-align-start margin-bottom-2">
  60. <div class="desktop-w3 phone-w12 margin-bottom-2">
  61. {{if .Data.Poster_path}}
  62. <img src="https://image.tmdb.org/t/p/w154{{.Data.Poster_path}}" class="block min-height-231px width-154px">
  63. {{else}}
  64. <img src="/static/img/poster_empty.webp" class="block min-height-231px width-154px" />
  65. {{end}}
  66. <div class="on-phone">
  67. <span class="sans font-3">{{.Data.Title}}</span>
  68. {{if not .Data.Release_date.IsZero}}
  69. <span class="sans text-unimportant font-thin font-2">({{.Data.Release_date.Year}})</span>
  70. {{end}}
  71. </div>
  72. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe8d0;</span> {{$.Strings.Film.rating}}</p>
  73. {{if eq .Data.Vote_count 0}}
  74. <p class="margin-lr-1 sans margin-tb-_5">{{$.Strings.Film.TBD}}</p>
  75. {{else}}
  76. <p class="margin-lr-1 sans margin-tb-_5">{{.Data.Vote_average}}/10 ({{$.Strings.Film.votes}}: {{.Data.Vote_count}})</p>
  77. {{end}}
  78. {{if .Data.Genres}}
  79. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe43a;</span> {{$.Strings.Film.genre}}</p>
  80. <p class="margin-lr-1 sans margin-tb-_5">{{range .Data.Genres}} {{.Name}}<br/> {{end}}</span></p>
  81. {{end}}
  82. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe422;</span> {{$.Strings.Film.runtime}}</p>
  83. {{if eq .Data.Runtime 0}}
  84. <p class="margin-lr-1 sans margin-tb-_5">{{.Strings.Film.TBD}}</p>
  85. {{else}}
  86. <p class="margin-lr-1 sans margin-tb-_5">{{.Data.Runtime}} {{.Strings.Film.minutes}}</p>
  87. {{end}}
  88. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe923;</span> {{$.Strings.Film.status}}</p>
  89. <p class="margin-lr-1 sans margin-tb-_5">{{.Data.Status}}</p>
  90. <details>
  91. <summary class="cursor-hand margin-bottom-_5">
  92. <span class="sans">{{$.Strings.Film.premieres}}</span>
  93. </summary>
  94. <div>
  95. <span class="sans">{{$.Strings.Film.earliest}}:</span>
  96. <ul class="margin-tb-0">
  97. {{ range .Data.EarliestReleaseDates }}
  98. <li class="sans">
  99. <!-- todo on, in <- strings, locale to country/language name -->
  100. {{ $.GetPremiereType .Type }}: on {{$.FormatDate .ReleaseDate}} in {{.Locale}} {{if .Note}}({{.Note}}){{end}}
  101. </li>
  102. {{ end }}
  103. </ul>
  104. <!-- todo in country from user settings (but check also country alone if not with language) -->
  105. <hr class="margin-tb-_5"/>
  106. {{ range $locale, $releaseDates := .Data.ReleaseDates }}
  107. <div>
  108. <!-- locale to country/language name -->
  109. <span class="sans">{{$locale}}:</span>
  110. <ul class="margin-tb-0">
  111. {{ range $releaseDates }}
  112. <!-- todo on, in <- strings -->
  113. <li class="sans">{{ $.GetPremiereType .Type }} on {{$.FormatDate .ReleaseDate}} {{if .Note}}({{.Note}}){{end}}</li>
  114. {{end}}
  115. </ul>
  116. </div>
  117. {{ end }}
  118. </div>
  119. </details>
  120. {{ if .Data.BasedOn.Title }}
  121. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe865;</span> {{.Strings.Film.based_on}}</p>
  122. <p class="margin-lr-1 sans margin-tb-_5"><a href="{{.Data.BasedOn.Uri}}">{{.Data.BasedOn.Title}}</a></p>
  123. {{ end }}
  124. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe157;</span> {{.Strings.Film.source}}</p>
  125. <p class="margin-lr-1 sans margin-tb-_5"><a href="{{.Data.Source}}">TheMovieDB</a></p>
  126. {{if and (.Data.IsOnWantList) (not .State.User.IsEmpty)}}
  127. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe05f;</span> {{.Strings.Film.Watchlist}}</p>
  128. <p class="margin-lr-1 sans margin-tb-_5">{{.Strings.Film.onWatchlist}}</p>
  129. <form action="/users/{{.State.User.Username}}/watchlist/film:{{.Data.Id}}" method="POST">
  130. <input type="hidden" name="method" value="DELETE" />
  131. <button type="submit" class="border-text sans margin-lr-1 hover-bg-grey padding-tb-_25 cursor-hand text"><span class="padding-lr-_5 material-icon">&#xe16c;</span><span class="sans padding-lr-_5">{{.Strings.Film.remove_want}}</span></button>
  132. </form>
  133. {{end}}
  134. {{if .Data.Experiences}}
  135. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe04a;</span> {{.Strings.Film.watched}}</p>
  136. <p class="margin-lr-1 sans margin-tb-_5">{{len .Data.Experiences}} times<br/>
  137. last time <span title="{{.Data.GetLastExperienceFull .Strings}}">{{.Data.GetLastExperience .Strings .State.User.Timezone}}</p>
  138. {{end}}
  139. </div>
  140. <div class="desktop-w6 phone-w12 margin-top-10 padding-lr-2 margin-bottom-2">
  141. <div>
  142. {{if not .State.User.IsEmpty}}
  143. <div class="flex flex-row flex-wrap flex-centre flex-align-centre">
  144. {{if and (not .Data.IsOnWantList) (not .Data.Experiences)}}
  145. <form action="/users/{{.State.User.Username}}/watchlist/" method="POST" class="margin-tb-_5 margin-lr-1">
  146. <input type="hidden" name="itemId" value="{{.Data.Id}}" />
  147. <input type="hidden" name="itemType" value="film" />
  148. <button type="submit" class="border-text hover-bg-grey padding-tb-_25 cursor-hand text font-2"><span class="padding-lr-_5 material-icon font-2">&#xe03b;</span><span class="sans padding-lr-_5">{{.Strings.Film.want_watch}}</span></button>
  149. </form>
  150. {{end}}
  151. <form action="/users/{{.State.User.Username}}/experiences/" method="POST" class="margin-tb-_5 margin-lr-1">
  152. <input type="hidden" name="itemId" value="{{.Data.Id}}" />
  153. <input type="hidden" name="itemType" value="film" />
  154. <button type="submit" class="border-text hover-bg-dark-accent padding-tb-_25 cursor-hand text-black font-2"><span class="padding-lr-_5 material-icon font-2">&#xe04a;</span><span class="sans padding-lr-_5">{{.Strings.Film.watched}}</span></button><label for="experienced-datetime-check" class="cursor-hand bg-accent inline-block font-2 relative top-m_3 height-3_3 text-black">
  155. <span class="material-icon">&#xe5cf;</span>
  156. </label>
  157. <input type="checkbox" id="experienced-datetime-check" class="display-none experienced-datetime-check" name="isOtherTime" value="true"/>
  158. <div class="experienced-box absolute">
  159. <input type="date" name="experiencedDate" class="margin-lr-_5 margin-tb-_5 text bg border-text" placeholder="YYYY-mm-dd"/>
  160. <input type="time" name="experiencedTime" class="margin-lr-_5 margin-tb-_5 text bg border-text" placeholder="HH:MM" />
  161. </div>
  162. </form>
  163. </div>
  164. {{end}}
  165. </div>
  166. <p class="italic serif">{{.Data.Tagline}}</p>
  167. <p class="serif justify hyphenate">{{.Data.Overview}}</p>
  168. <hr class="material-icon text-grey hr-film" />
  169. {{if .Data.Collection.Parts}}
  170. <p class="sans font-2">{{.Strings.Film.in_this_collection}}:</p>
  171. <div class="flex flex-row flex-wrap felx-justify-space flex-align-start">
  172. {{range .Data.Collection.Parts}}
  173. <a href="/films/{{.Id}}" class="decoration-none no-outline margin-tb-1 margin-lr-1">
  174. <div class="flex force-width-16">
  175. <div>
  176. {{if .Poster_path}}
  177. <img src="https://image.tmdb.org/t/p/w92{{.Poster_path}}" class="min-height-139px width-92px" />
  178. {{else}}
  179. <img src="/static/img/poster_empty.webp" class="min-height-139px width-92px" />
  180. {{end}}
  181. </div>
  182. <div class="margin-lr-1">
  183. <p class="sans">{{.Title}}</p>
  184. {{if not .Release_date.IsZero}}
  185. <p class="sans font-_875 text-grey">{{.Release_date.Year}}</p>
  186. {{end}}
  187. {{if .IsWatched}}<p class="material-icon font-_875 text-grey">&#xe8f4;</p>{{end}}
  188. </div>
  189. </div>
  190. </a>
  191. {{end}}
  192. </div>
  193. {{end}}
  194. </div>
  195. <div class="desktop-w3 phone-w12 margin-top-10 flex phone-flex-flow">
  196. <details class="margin-lr-1 flex-force-40 min-width-13_5">
  197. <summary class="cursor-hand">
  198. <span class="material-icon font-1_5">&#xe7fb;</span> <span class="sans font-1_5">{{.Strings.Film.cast}}</span>
  199. </summary>
  200. <div>
  201. {{if not .Data.Credits.Cast}}
  202. <p class="sans indent-2 margin-top-1">{{.Strings.Film.empty_payroll}}</p>
  203. {{end}}
  204. {{range .Data.Credits.Cast}}
  205. <a href="/persons/{{.Id}}" class="decoration-none no-outline inline-block margin-tb-1">
  206. <div class="flex">
  207. <div>
  208. {{if .Profile_path}}
  209. <img src="https://image.tmdb.org/t/p/w92{{.Profile_path}}" class="min-height-139px width-92px" decoding="async" loading="lazy" />
  210. {{else}}
  211. <img src="/static/img/person_empty.webp" class="min-height-139px width-92px" decoding="async" loading="lazy" />
  212. {{end}}
  213. </div>
  214. <div class="margin-lr-1">
  215. <p class="sans text">{{.Character}}</p>
  216. <p class="sans font-_875">{{.Name}}</p>
  217. </div>
  218. </div>
  219. </a>
  220. {{end}}
  221. </div>
  222. </details>
  223. <details class="margin-lr-1 flex-force-40 min-width-13_5">
  224. <summary class="cursor-hand">
  225. <span class="material-icon font-1_5">&#xe7fc;</span> <span class="sans font-1_5">{{.Strings.Film.crew}}</span>
  226. </summary>
  227. <div>
  228. {{if not .Data.Credits.Crew}}
  229. <p class="sans indent-2 margin-top-1">{{.Strings.Film.empty_payroll}}</p>
  230. {{end}}
  231. {{range .Data.Credits.Crew}}
  232. <a href="/persons/{{.Id}}" class="decoration-none no-outline inline-block margin-tb-1">
  233. <div class="flex">
  234. <div>
  235. {{if .Profile_path}}
  236. <img src="https://image.tmdb.org/t/p/w92{{.Profile_path}}" class="min-height-139px width-92px" decoding="async" loading="lazy" />
  237. {{else}}
  238. <img src="/static/img/person_empty.webp" class="min-height-139px width-92px" decoding="async" loading="lazy" />
  239. {{end}}
  240. </div>
  241. <div class="margin-lr-1">
  242. <p class="sans text">{{.Job}}</p>
  243. <p class="sans font-_875">{{.Name}}</p>
  244. </div>
  245. </div>
  246. </a>
  247. {{end}}
  248. </div>
  249. </details>
  250. </div>
  251. </main>
  252. </body>
  253. </html>