book.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 gt .Data.Year 1}} ({{.Data.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. <img src="/static/img/book_backdrop.webp" class="w12 cover height-30" /> <!-- Photo by [Janko Ferlic](https://www.pexels.com/@thepoorphotographer) from [Pexels](https://www.pexels.com/photo/blur-book-stack-books-bookshelves-590493/) -->
  48. <div class="on-desktop relative bottom-4 sans inline-block w12 padding-l-16 font-3 bg-gradient">
  49. <span class="text-white">{{.Data.Title}}</span>
  50. {{if gt .Data.Year 1}}
  51. <span class="text-unimportant font-thin font-2">({{.Data.Year}})</span>
  52. {{end}}
  53. </div>
  54. </div>
  55. <main class="margin-top-20 margin-lr-5 flex flex-row flex-wrap flex-justify-space flex-align-start margin-bottom-2">
  56. <div class="desktop-w3 phone-w12 margin-bottom-2">
  57. {{if .Data.Cover}}
  58. <img src="{{.Data.Cover}}" class="block min-height-231px width-154px">
  59. {{else}}
  60. <img src="/static/img/book_empty.webp" class="block min-height-231px width-154px" />
  61. {{end}}
  62. <div class="on-phone">
  63. <span class="sans font-3">{{.Data.Title}}</span>
  64. {{if gt .Data.Year 1}}
  65. <span class="sans text-unimportant font-thin font-2">({{.Data.Year}})</span>
  66. {{end}}
  67. </div>
  68. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe7fd;</span> {{$.Strings.Book.author}}</p>
  69. <p class="margin-lr-1 sans margin-tb-_5">{{range .Data.Authors}} {{.}}<br/> {{end}}</p>
  70. {{if .Data.Genres}}
  71. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe43a;</span> {{$.Strings.Book.genre}}</p>
  72. <p class="margin-lr-1 sans margin-tb-_5">{{range .Data.Genres}} {{.}}<br/> {{end}}</p>
  73. {{end}}
  74. {{if .Data.SerieUri}}
  75. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe431;</span> {{.Strings.Book.serie}}</p>
  76. <p class="margin-lr-1 sans margin-tb-_5"><a href="{{.Data.SerieUri}}"><i>{{.Data.SerieName}}</i></a>{{if .Data.PartInSerie}}, {{.Strings.Book.part}} {{.Data.PartInSerie}}{{end}}</p>
  77. {{end}}
  78. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe157;</span> {{$.Strings.Book.source}}</p>
  79. <p class="margin-lr-1 sans margin-tb-_5">{{range .Data.Source}}<a href="{{.Url}}">{{.Name}}</a><br/>{{end}}</p>
  80. {{if and (.Data.IsOnWantList) (not .State.User.IsEmpty)}}
  81. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe05f;</span> {{.Strings.Book.Readlist}}</p>
  82. <p class="margin-lr-1 sans margin-tb-_5">{{.Strings.Book.onReadlist}}</p>
  83. {{end}}
  84. {{if .Data.Experiences}}
  85. <p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe431;</span> {{.Strings.Book.read}}</p>
  86. <p class="margin-lr-1 sans margin-tb-_5">{{len .Data.Experiences}} times<br/>
  87. last time <span title="{{.Data.GetLastExperienceFull .Strings}}">{{.Data.GetLastExperience .Strings .State.User.Timezone}}</p>
  88. {{end}}
  89. </div>
  90. <div class="desktop-w6 phone-w12 margin-top-10 padding-lr-2 margin-bottom-2">
  91. <div>
  92. {{if not .State.User.IsEmpty}}
  93. <div class="flex flex-row flex-wrap flex-centre flex-align-centre">
  94. {{if and (not .Data.IsOnWantList) (not .Data.Experiences)}}
  95. <form action="/users/{{.State.User.Username}}/readlist/" method="POST" class="margin-tb-_5 margin-lr-1">
  96. <input type="hidden" name="itemId" value="{{.Data.Id}}" />
  97. <input type="hidden" name="itemType" value="book" />
  98. <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.Book.want_read}}</span></button>
  99. </form>
  100. {{end}}
  101. <form action="/users/{{.State.User.Username}}/experiences/" method="POST" class="margin-tb-_5 margin-lr-1">
  102. <input type="hidden" name="itemId" value="{{.Data.Id}}" />
  103. <input type="hidden" name="itemType" value="book" />
  104. <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">&#xe431;</span><span class="sans padding-lr-_5">{{.Strings.Book.read}}</span></button><label for="read-datetime-check" class="cursor-hand bg-accent inline-block font-2 relative top-m_3 height-3_3 text-black">
  105. <span class="material-icon">&#xe5cf;</span>
  106. </label>
  107. <input type="checkbox" id="read-datetime-check" class="display-none experienced-datetime-check" name="isOtherTime" value="true"/>
  108. <div class="experienced-box absolute">
  109. <input type="date" name="experiencedDate" class="margin-lr-_5 margin-tb-_5 text bg border-text" placeholder="YYYY-mm-dd"/>
  110. <input type="time" name="experiencedTime" class="margin-lr-_5 margin-tb-_5 text bg border-text" placeholder="HH:MM" />
  111. </div>
  112. </form>
  113. </div>
  114. {{end}}
  115. </div>
  116. <p>{{.Data.Description}}</p>
  117. <hr class="material-icon text-grey hr-book"/>
  118. </div>
  119. <div class="desktop-w3 phone-w12 margin-top-10 flex phone-flex-flow">
  120. </div>
  121. </main>
  122. </body>
  123. </html>