mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
74 lines
1.9 KiB
HTML
74 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
|
<title>GohCMS | Login</title>
|
|
|
|
<link rel="stylesheet" href="/static/bootstrap.min.css" type="text/css">
|
|
<script src="/static/bootstrap.min.js"
|
|
type="application/javascript"
|
|
defer></script>
|
|
|
|
<style>
|
|
.form-container {
|
|
max-width: 24rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="d-flex min-vh-100 vw-100 justify-content-center align-items-center">
|
|
|
|
<div class="container">
|
|
<div class="d-flex flex-column gap-5 m-auto form-container">
|
|
<h1>GohCMS</h1>
|
|
<form action="login" class="" method="POST">
|
|
<div class="d-flex flex-column gap-4">
|
|
<div class="form-floating">
|
|
<input class="form-control {{ if .IsError }} is-invalid {{ end }}"
|
|
id="username"
|
|
name="username"
|
|
placeholder="Votre nom d'utilisateur"
|
|
required
|
|
type="text">
|
|
<label for="username">Username</label>
|
|
</div>
|
|
<div class="form-floating">
|
|
<input class="form-control {{ if .IsError }} is-invalid {{ end }}"
|
|
id="password"
|
|
name="password"
|
|
placeholder="Votre mot de passe"
|
|
required
|
|
type="password">
|
|
<label for="password">Password</label>
|
|
<div class="invalid-feedback">
|
|
{{.Error}}
|
|
</div>
|
|
</div>
|
|
<button class="btn btn-primary" disabled type="submit">Log in</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const button = document.querySelector("button[type=submit]")
|
|
const inputs = document.querySelectorAll('input')
|
|
|
|
function formFieldsEmpty() {
|
|
return Array.from(inputs).some((input) => input.value === "")
|
|
}
|
|
|
|
function setButtonDisabled() {
|
|
button.disabled = formFieldsEmpty() ? "disabled" : ""
|
|
}
|
|
|
|
window.addEventListener('input', (event) => {
|
|
if (event.target.tagName === "INPUT") setButtonDisabled()
|
|
})
|
|
|
|
setButtonDisabled()
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|