Add user auth, cart, checkout and personal account for guests and registered users
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
{{define "register.html"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{.Title}}</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<link rel="stylesheet" href="/static/css/shop.css">
|
||||
</head>
|
||||
<body>
|
||||
{{template "shop_header" .}}
|
||||
<main class="shop-page container">
|
||||
<div class="shop-card">
|
||||
<h1>Регистрация</h1>
|
||||
{{if .Error}}<div class="shop-alert shop-alert--error">{{.Error}}</div>{{end}}
|
||||
<form method="POST" action="/register" class="shop-form">
|
||||
<label>Имя<input type="text" name="name" required></label>
|
||||
<label>Email<input type="email" name="email" required></label>
|
||||
<label>Пароль (мин. 6 символов)<input type="password" name="password" required minlength="6"></label>
|
||||
<button type="submit" class="btn btn--primary btn--lg">Зарегистрироваться</button>
|
||||
</form>
|
||||
<p class="shop-hint">Уже есть аккаунт? <a href="/login">Войти</a></p>
|
||||
<p class="shop-hint">Можно покупать и <a href="/cart">без регистрации</a></p>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
||||
{{define "login.html"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{.Title}}</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<link rel="stylesheet" href="/static/css/shop.css">
|
||||
</head>
|
||||
<body>
|
||||
{{template "shop_header" .}}
|
||||
<main class="shop-page container">
|
||||
<div class="shop-card">
|
||||
<h1>Вход</h1>
|
||||
{{if .Error}}<div class="shop-alert shop-alert--error">{{.Error}}</div>{{end}}
|
||||
<form method="POST" action="/login" class="shop-form">
|
||||
<label>Email<input type="email" name="email" required></label>
|
||||
<label>Пароль<input type="password" name="password" required></label>
|
||||
<button type="submit" class="btn btn--primary btn--lg">Войти</button>
|
||||
</form>
|
||||
<p class="shop-hint">Нет аккаунта? <a href="/register">Регистрация</a></p>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user