<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>{{.Strings.Account.title}}</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">
			<a href="/" class="decoration-none">
				<h1 class="inline valign-mid text sans margin-lr-1">a·muse</h1>
			</a>
			<div class="margin-lr-1 text">
				<nav>
					<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">&#xe7ff;</span>
						</li>
					</ul>
				</nav>
			</div>
		</header>
		<main class="centre">
			<div style="margin-top: 3rem;">
				<img src="/users/{{.State.User.Username}}/avatar?size=large" class="border-radius-25"/>
				<div class="font-2 margin-top-1">{{.Data.Username}}</div>
			</div>
			<div style="margin-top: 2rem;" class="centre">
				<form action="/users/{{.State.User.Username}}" method="POST">
					<div class="flex flex-centre">
						<input type="hidden" value="PUT" name="method" />
						<div style="height: 12rem; flex-direction: column; align-items: flex-start; justify-content: space-evenly" class="flex">
							<label for="avatar">{{.Strings.Account.avatar}}</label>
							<label for="timezone">{{.Strings.Account.timezone}}</label>
							<label for="country">{{.Strings.Account.country}}</label>
							<label for="language">{{.Strings.Account.language}}</label>
							<label for="calendar">{{.Strings.Account.calendar}}</label>
						</div>
						<div style="flex-direction: column; align-items: end; height: 12rem; justify-content: space-evenly;" class="flex">
							<input type="file" id="avatar" accept="image/*" name="avatar" />
							<select id="timezone" name="timezone">
								<optgroup>
									<option value="{{.Data.Timezone}}">{{.Data.Timezone}}</option>
								</optgroup>
								<optgroup> <!-- todo range timezones -->
									<option value="Europe/Warsaw">Europe/Warsaw</option>
									<option value="UTC">UTC</option>
								</optgroup>
							</select>
							<select id="country" name="country">
								<optgroup>
									<option value="{{.Data.Country}}">{{.Data.Country}}</option>
								</optgroup>
								<optgroup> <!-- todo range countries, maybe emoji flags -->
									<option value="US">US</option>
									<option value="PL">PL</option>
								</optgroup>
							</select>
							<select id="language" name="language">
								<optgroup>
									<option value="{{.Data.Language}}">{{.Data.Language}}</option>
								</optgroup>
								<optgroup> <!-- todo range countries -->
									<option value="en-GB">en-GB</option>
									<option value="pl-PL">pl-PL</option>
								</optgroup>
							</select>
							<input type="checkbox" id="calendar" {{if .Data.AutoCalendar}}checked=""{{end}} name="calendar" value="true">
						</div>
					</div>
					<div>
						<input type="submit" value="{{.Strings.Account.update}}" class="border-text hover-bg-dark-accent padding-tb-_25 cursor-hand text-black font-1" />
					</div>
				</form>
				<form action="/users/{{.State.User.Username}}" method="POST" style="margin-top: 2rem;">
					<div class="flex flex-centre">
						<input type="hidden" value="PUT" name="method" />
						<div style="margin-left: 2rem; margin-right: 2rem; height: 4rem; flex-direction: column; align-items: flex-start; justify-content: space-evenly" class="flex">
							<label for="password">{{.Strings.Signup.password}}</label>
							<label for="password2">{{.Strings.Signup.confirm_pass}}</label>
						</div>
						<div style="margin-left: 2rem; margin-right: 2rem; flex-direction: column; align-items: end; height: 4rem; justify-content: space-evenly;" class="flex">
							<input type="password" class="bg-none border-none border-bottom text" id="password" name="password" required="">
							<input type="password" class="bg-none border-none border-bottom text" id="password2" name="password2" required="">
						</div>
					</div>
					<div>
						<input type="submit" value="{{.Strings.Account.change_pass}}" class="border-text hover-bg-dark-accent padding-tb-_25 cursor-hand text-black font-1" />
					</div>
				</form>
			</div>
		</main>
	</body>
</html>
