<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>{{.Data.Title}}{{if gt .Data.Year 1}} ({{.Data.Year}}){{end}} — a·muse</title>
		<link rel="stylesheet" href="/static/style/style.css" />
		<link rel="icon" type="image/svg+xml" href="/static/img/logo.svg">
		<link rel="apple-touch-icon" type="image/svg+xml" href="/static/img/logo.svg">
	</head>
	<body>
		<header class="w12 padding-bottom-_25 flex flex-row flex-justify-space flex-align-centre bg-primary">
			<a href="/" class="decoration-none">
				<h1 class="inline valign-mid text-white sans margin-lr-1">a·muse</h1>
			</a>
			<form action="/items/" method="get" class="flex inline margin-lr-1 border-bottom-white">
				<input type="search" name="q" class="phone-max-width-8 border-none bg-none sans text-white" placeholder="{{.Strings.Global.search}}" />
			</form>
			<div class="margin-lr-1 text-white">
				{{ if .State.User.IsEmpty }}
				<a href="/login" class="decoration-none sans">{{.Strings.Global.log_in}}</a>
				—
				<a href="/signup" class="decoration-none sans">{{.Strings.Global.sign_up}}</a>
				{{ else }}
				<nav class="text">
					<label for="hamburger" class="cursor-hand">
						<img src="/users/{{.State.User.Username}}/avatar?size=small" class="border-radius-25 width-1_5"/>
					</label>
					<input type="checkbox" id="hamburger" class="display-none" />
					<ul class="absolute right top-1 padding-lr-1 padding-tb-_5 bg align-right list-style-none sans">
						<!--<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>-->
						<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>
						<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>
						<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>
						<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>
						<li class="bg-error">
							<form action="/users/{{.State.User.Username}}/sessions/{{.State.User.Session}}" method="POST" class="inline">
								<input type="hidden" value="DELETE" name="method" />
								<input type="submit" value="{{.Strings.Global.log_out}}" class="border-none bg-none font-normal text-accent padding-lr-0 cursor-hand font-1" />
							</form><span class="material-icon padding-lr-_5 text-white">&#xe7ff;</span>
						</li>
					</ul>
				</nav>
				{{ end }}
			</div>
		</header>
		<div class="absolute top behind w12">
			<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/) -->
			<div class="on-desktop relative bottom-4 sans inline-block w12 padding-l-16 font-3 bg-gradient">
				<span class="text-white">{{.Data.Title}}</span>
				{{if gt .Data.Year 1}}
				<span class="text-unimportant font-thin font-2">({{.Data.Year}})</span>
				{{end}}
			</div>
		</div>
		<main class="margin-top-20 margin-lr-5 flex flex-row flex-wrap flex-justify-space flex-align-start margin-bottom-2">
			<div class="desktop-w3 phone-w12 margin-bottom-2">
				{{if .Data.Cover}}
				<img src="{{.Data.Cover}}" class="block min-height-231px width-154px">
				{{else}}
				<img src="/static/img/book_empty.webp" class="block min-height-231px width-154px" />
				{{end}}
				<div class="on-phone">
					<span class="sans font-3">{{.Data.Title}}</span>
					{{if gt .Data.Year 1}}
					<span class="sans text-unimportant font-thin font-2">({{.Data.Year}})</span>
					{{end}}
				</div>
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe7fd;</span> {{$.Strings.Book.author}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">{{range .Data.Authors}} {{.}}<br/> {{end}}</p>
				{{if .Data.Genres}}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe43a;</span> {{$.Strings.Book.genre}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">{{range .Data.Genres}} {{.}}<br/> {{end}}</p>
				{{end}}
				{{if .Data.SerieUri}}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe431;</span> {{.Strings.Book.serie}}</p>
				<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>
				{{end}}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe157;</span> {{$.Strings.Book.source}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">{{range .Data.Source}}<a href="{{.Url}}">{{.Name}}</a><br/>{{end}}</p>
				{{if and (.Data.IsOnWantList) (not .State.User.IsEmpty)}}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe05f;</span> {{.Strings.Book.Readlist}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">{{.Strings.Book.onReadlist}}</p>
				{{end}}
				{{if .Data.Experiences}}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe431;</span> {{.Strings.Book.read}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">{{len .Data.Experiences}} times<br/>
				last time <span title="{{.Data.GetLastExperienceFull .Strings}}">{{.Data.GetLastExperience .Strings .State.User.Timezone}}</p>
				{{end}}
			</div>
			<div class="desktop-w6 phone-w12 margin-top-10 padding-lr-2 margin-bottom-2">
				<div>
					{{if not .State.User.IsEmpty}}
					<div class="flex flex-row flex-wrap flex-centre flex-align-centre">
						{{if and (not .Data.IsOnWantList) (not .Data.Experiences)}}
						<form action="/users/{{.State.User.Username}}/readlist/" method="POST" class="margin-tb-_5 margin-lr-1">
							<input type="hidden" name="itemId" value="{{.Data.Id}}" />
							<input type="hidden" name="itemType" value="book" />
							<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>
						</form>
						{{end}}
						<form action="/users/{{.State.User.Username}}/experiences/" method="POST" class="margin-tb-_5 margin-lr-1">
							<input type="hidden" name="itemId" value="{{.Data.Id}}" />
							<input type="hidden" name="itemType" value="book" />
							<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">
								<span class="material-icon">&#xe5cf;</span>
							</label>
							<input type="checkbox" id="read-datetime-check" class="display-none experienced-datetime-check" name="isOtherTime" value="true"/>
							<div class="experienced-box absolute">
								<input type="date" name="experiencedDate" class="margin-lr-_5 margin-tb-_5 text bg border-text" placeholder="YYYY-mm-dd"/>
								<input type="time" name="experiencedTime" class="margin-lr-_5 margin-tb-_5 text bg border-text" placeholder="HH:MM" />
							</div>
						</form>
					</div>
					{{end}}
				</div>
				<p>{{.Data.Description}}</p>
				<hr class="material-icon text-grey hr-book"/>
			</div>
			<div class="desktop-w3 phone-w12 margin-top-10 flex phone-flex-flow">
			</div>
		</main>
	</body>
</html>
