search.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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.T.Query}} — 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">
  13. <a href="/" class="decoration-none">
  14. <h1 class="inline valign-mid text sans margin-lr-1">a·muse</h1>
  15. </a>
  16. <form action="/items/" method="get" class="flex inline margin-lr-1 border-bottom">
  17. <input type="search" name="q" class="phone-max-width-8 border-none bg-none sans text" placeholder="{{.Strings.Global.search}}" value="{{ .Data.T.Query }}" />
  18. </form>
  19. <div class="margin-lr-1 text">
  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>
  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">&#xe7ff;</span>
  40. </li>
  41. </ul>
  42. </nav>
  43. {{ end }}
  44. </div>
  45. </header>
  46. <main class="margin-lr-1">
  47. <div class="flex flex-row flex-wrap flex-justify-space flex-align-start margin-top-1">
  48. <div>
  49. {{if gt .Data.T.Page 1}}
  50. <a href="/items/?q={{.Data.T.Query}}&page={{.Data.T.PrevPage}}" class="decoration-none" title="{{.Strings.Search.prev_link_title}}"><span class="material-icon font-2">&#xe408;</span></a>
  51. {{end}}
  52. </div>
  53. <div>
  54. {{if lt .Data.T.Page .Data.T.Total_pages}}
  55. <a href="/items/?q={{.Data.T.Query}}&page={{.Data.T.NextPage}}" class="decoration-none" title="{{.Strings.Search.next_link_title}}"><span class="material-icon font-2">&#xe409;</span></a>
  56. {{end}}
  57. </div>
  58. </div>
  59. <div class="flex flex-row flex-wrap flex-justify-space flex-align-start">
  60. {{if or .Data.T.Results .Data.I.Results}}
  61. {{range .Data.T.Results}}
  62. {{if eq .Media_type "movie"}}
  63. <a href="/films/{{.Id}}" class="decoration-none force-width-18 margin-tb-1 no-outline border-solid border-gradient border-tb-transparent border-_5 padding-tb-_25 padding-lr-_25">
  64. {{else if eq .Media_type "person"}}
  65. <a href="/persons/{{.Id}}" class="decoration-none force-width-18 margin-tb-1 no-outline border-solid border-gradient border-tb-transparent border-_5 padding-tb-_25 padding-lr-_25">
  66. {{else if eq .Media_type "tv"}}
  67. <a href="/tvseries/{{.Id}}" class="decoration-none force-width-18 margin-tb-1 no-outline border-solid border-gradient border-tb-transparent border-_5 padding-tb-_25 padding-lr-_25">
  68. {{end}}
  69. <div class="flex">
  70. <div>
  71. {{if .Poster_path}}
  72. <img src="https://image.tmdb.org/t/p/w154{{.Poster_path}}" class="min-height-231px width-154px" />
  73. {{else if eq .Media_type "movie"}}
  74. <img src="/static/img/poster_empty.webp" class="min-height-231px width-154px" />
  75. {{else if eq .Media_type "tv"}}
  76. <img src="/static/img/tv_empty.webp" class="min-height-231px width-154px" />
  77. {{else if eq .Media_type "person"}}
  78. <img src="/static/img/person_empty.webp" class="min-height-231px width-154px" />
  79. {{end}}
  80. </div>
  81. <div class="margin-lr-1">
  82. <p class="sans">{{.Name}}</p>
  83. {{if not .Release_date.IsZero}}
  84. <p class="sans font-_875 text-grey">{{.Release_date.Year}}</p>
  85. {{end}}
  86. {{if eq .Media_type "tv"}}
  87. <p class="sans font-_875 text-grey">{{$.Strings.Search.tvserie}}</p>
  88. {{else if eq .Media_type "movie"}}
  89. <p class="sans font-_875 text-grey">{{$.Strings.Search.film}}</p>
  90. {{else if eq .Media_type "person"}}
  91. <p class="sans font-_875 text-grey">{{$.Strings.Search.person}}</p>
  92. {{end}}
  93. </div>
  94. </div>
  95. </a>
  96. {{end}}
  97. {{range .Data.I.Results}}
  98. {{if eq .Type "works"}}
  99. <a href="/books/{{.Uri}}" class="decoration-none force-width-18 margin-tb-1 no-outline border-solid border-gradient border-tb-transparent border-_5 padding-tb-_25 padding-lr-_25">
  100. {{else if eq .Type "humans"}}
  101. <a href="/authors/{{.Uri}}" class="decoration-none force-width-18 margin-tb-1 no-outline border-solid border-gradient border-tb-transparent border-_5 padding-tb-_25 padding-lr-_25">
  102. {{else if eq .Type "series"}}
  103. <a href="/bookseries/{{.Uri}}" class="decoration-none force-width-18 margin-tb-1 no-outline border-solid border-gradient border-tb-transparent border-_5 padding-tb-_25 padding-lr-_25">
  104. {{end}}
  105. <div class="flex">
  106. <div>
  107. {{if .ImagePath}}
  108. <img src="{{.ImagePath}}" class="min-height-231px width-154px" />
  109. {{else if eq .Type "works"}}
  110. <img src="/static/img/book_empty.webp" class="min-height-231px width-154px" />
  111. {{else if eq .Type "humans"}}
  112. <img src="/static/img/person_empty.webp" class="min-height-231px width-154px" />
  113. {{else if eq .Type "series"}}
  114. <img src="/static/img/bookserie_empty.webp" class="min-height-231px width-154px" />
  115. {{end}}
  116. </div>
  117. <div class="margin-lr-1">
  118. <p class="sans">{{.Label}}</p>
  119. {{if eq .Type "works"}}
  120. <p class="sans font-_875 text-grey">{{$.Strings.Search.book}}</p>
  121. {{else if eq .Type "humans"}}
  122. <p class="sans font-_875 text-grey">{{$.Strings.Search.author}}</p>
  123. {{else if eq .Type "series"}}
  124. <p class="sans font-_875 text-grey">{{$.Strings.Search.bookserie}}</p>
  125. {{end}}
  126. </div>
  127. </div>
  128. </a>
  129. {{end}}
  130. </div>
  131. <div class="centre">
  132. <a href="/about#sources">{{$.Strings.Search.droids}}</a>
  133. </div>
  134. <div class="flex flex-row flex-wrap flex-justify-space flex-align-start">
  135. <div>
  136. {{if gt .Data.T.Page 1}}
  137. <a href="/items/?q={{.Data.T.Query}}&page={{.Data.T.PrevPage}}" class="decoration-none" title="{{.Strings.Search.prev_link_title}}"><span class="material-icon font-2">&#xe408;</span></a>
  138. {{end}}
  139. </div>
  140. <div>
  141. {{if lt .Data.T.Page .Data.T.Total_pages}}
  142. <a href="/items/?q={{.Data.T.Query}}&page={{.Data.T.NextPage}}" class="decoration-none" title="{{.Strings.Search.next_link_title}}"><span class="material-icon font-2">&#xe409;</span></a>
  143. {{end}}
  144. </div>
  145. </div>
  146. {{else if eq .Data.T.Total_pages 0}}
  147. <div class="font-2 w12 flex flex-centre margin-top-10">
  148. <div>
  149. <p>{{.Strings.Search.not_found_quote}}</p>
  150. <p class="indent-2 sans">—{{.Strings.Search.not_found_character}} (<span class="italic sans">{{.Strings.Search.not_found_title}}</span>, {{.Strings.Search.not_found_code}} {{.Strings.Search.not_found_episode}})</p>
  151. </div>
  152. </div>
  153. <div>
  154. {{else if gt .Data.T.Page .Data.T.Total_pages}}
  155. <div class="font-2 w12 flex flex-centre margin-top-10">
  156. <div>
  157. <p>{{.Strings.Search.too_far_quote}}</p>
  158. <p class="indent-2 sans">—{{.Strings.Search.too_far_character}} (<span class="italic sans">{{.Strings.Search.too_far_title}}</span>)</p>
  159. </div>
  160. </div>
  161. {{end}}
  162. </main>
  163. </body>
  164. </html>