Attempt 2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{{ define "content" -}}
|
||||
{{ define "home" -}}
|
||||
<h1>
|
||||
Hello, Pagerino User!
|
||||
</h1>
|
||||
|
||||
27
WebApp/src/layouts/pages/index.tmpl
Normal file
27
WebApp/src/layouts/pages/index.tmpl
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link href="/static/styles/stylesheet.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
|
||||
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
||||
<link rel="manifest" href="/static/site.webmanifest" />
|
||||
|
||||
{{ template "meta" . }}
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
{{ template "navbar" . }}
|
||||
<main>
|
||||
{{ if eq .Page "login" }}
|
||||
{{ template "login" . }}
|
||||
{{ else if eq .Page "home" }}
|
||||
{{ template "home" . }}
|
||||
{{ end }}
|
||||
</main>
|
||||
<footer>
|
||||
{{ template "footer" . }}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,11 +1,35 @@
|
||||
{{ define "content" -}}
|
||||
<form method="POST" action="/login">
|
||||
<label>Username</label>
|
||||
<input type="text" name="username" required />
|
||||
{{ define "login" -}}
|
||||
<div class="flex items-center justify-center min-h-screen bg-gray-100">
|
||||
<form method="POST" action="/login"
|
||||
class="bg-white shadow-lg rounded-2xl p-8 w-full max-w-md space-y-6">
|
||||
|
||||
<h2 class="text-2xl font-bold text-center text-gray-800">Login</h2>
|
||||
|
||||
<label>Password</label>
|
||||
<input type="password" name="password" required />
|
||||
<!-- Username -->
|
||||
<div>
|
||||
<label for="username" class="block text-sm font-medium text-gray-600">Username</label>
|
||||
<input type="text" id="username" name="username" required
|
||||
class="mt-1 w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:outline-none" />
|
||||
</div>
|
||||
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
<!-- Password -->
|
||||
<div>
|
||||
<label for="password" class="block text-sm font-medium text-gray-600">Password</label>
|
||||
<input type="password" id="password" name="password" required
|
||||
class="mt-1 w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:outline-none" />
|
||||
</div>
|
||||
|
||||
<!-- Submit -->
|
||||
<button type="submit"
|
||||
class="w-full bg-blue-600 text-white py-2 rounded-lg font-medium hover:bg-blue-700 transition-colors">
|
||||
Login
|
||||
</button>
|
||||
|
||||
<!-- Optional link -->
|
||||
<p class="text-sm text-center text-gray-500">
|
||||
Don’t have an account?
|
||||
<a href="/register" class="text-blue-600 hover:underline">Sign up</a>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user