Introduce client-side localization helper and en/fr locale bundles. Route admin control, picks, movies, stats, winners and settings UIs through i18n keys instead of hardcoded text. Remove French text from the English UI and standardize shared messages (saving, network errors, confirmations). Update .gitignore to ignore editor metadata and localization helper artifacts.
124 lines
5.4 KiB
HTML
124 lines
5.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title data-i18n="auth.register">Oscar Pool - Register</title>
|
|
<script src="./js/app_theme.js"></script>
|
|
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="./css/app.css" rel="stylesheet">
|
|
<style>
|
|
/* Hide translatable content until translations are ready - prevents flash during page navigation */
|
|
body:not(.i18n-ready) [data-i18n] {
|
|
opacity: 0;
|
|
transition: opacity 0.1s ease-in;
|
|
}
|
|
body.i18n-ready [data-i18n] {
|
|
opacity: 1;
|
|
}
|
|
/* Fallback: show content after 2 seconds even if JS fails */
|
|
body:not(.i18n-ready) [data-i18n] {
|
|
animation: show-after-delay 0.1s 2s forwards;
|
|
}
|
|
@keyframes show-after-delay {
|
|
to { opacity: 1; }
|
|
}
|
|
#dog {
|
|
width: 30%;
|
|
margin: 5px;
|
|
padding: 5px;
|
|
border-radius: 10%;
|
|
}
|
|
</style>
|
|
<script src="./js/localization.js" defer></script>
|
|
</head>
|
|
<body class="bg-light">
|
|
<button class="theme-toggle theme-toggle--floating" type="button" data-theme-toggle role="switch" aria-checked="false" data-i18n-aria-label="common.toggleDarkMode" aria-label="Toggle dark mode">
|
|
<span class="theme-toggle-icon theme-toggle-icon-sun" aria-hidden="true">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="4"></circle>
|
|
<path d="M12 2v2"></path>
|
|
<path d="M12 20v2"></path>
|
|
<path d="M4.93 4.93l1.41 1.41"></path>
|
|
<path d="M17.66 17.66l1.41 1.41"></path>
|
|
<path d="M2 12h2"></path>
|
|
<path d="M20 12h2"></path>
|
|
<path d="M4.93 19.07l1.41-1.41"></path>
|
|
<path d="M17.66 6.34l1.41-1.41"></path>
|
|
</svg>
|
|
</span>
|
|
<span class="theme-toggle-thumb" aria-hidden="true"></span>
|
|
<span class="theme-toggle-icon theme-toggle-icon-moon" aria-hidden="true">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"></path>
|
|
</svg>
|
|
</span>
|
|
</button>
|
|
|
|
<div class="container d-flex justify-content-center align-items-center vh-100">
|
|
<!-- Setup needed banner (hidden by default) -->
|
|
<div id="setup-needed-card" class="card p-4 d-none" style="max-width: 400px;">
|
|
<div class="text-center mb-4">
|
|
<img src="img/logo.png" class="logo-invert" style="width: 80%;" alt="Oscar Pool">
|
|
</div>
|
|
<div class="alert alert-warning mb-3">
|
|
<strong data-i18n="auth.setupRequired">Setup required</strong><br>
|
|
<span data-i18n="auth.appMustBeConfigured">The application must first be configured by an administrator.</span>
|
|
</div>
|
|
<a href="/" class="btn btn-primary w-100" data-i18n="auth.goToSetup">Go to setup page</a>
|
|
</div>
|
|
|
|
<!-- Normal registration card -->
|
|
<div id="register-card" class="card p-4" style="max-width: 400px;">
|
|
<div class="text-center mb-4">
|
|
<img src="img/logo.png" class="logo-invert" style="width: 80%;" alt="Oscar Pool">
|
|
</div>
|
|
<form id="register-form">
|
|
<div class="mb-3">
|
|
<label for="name" class="form-label" data-i18n="auth.name">Name</label>
|
|
<input type="text" class="form-control" id="name" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="email" class="form-label" data-i18n="auth.email">Email</label>
|
|
<input type="email" class="form-control" id="email" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="password" class="form-label" data-i18n="auth.password">Password</label>
|
|
<input type="password" class="form-control" id="password" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="verifoof" class="form-label" data-i18n="auth.dogQuestion">What is Cath & Nath's dog's name?</label>
|
|
<img id="dog" src="img/doglmao.png">
|
|
<input type="text" class="form-control" id="verifoof" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary w-100" data-i18n="auth.register">Register</button>
|
|
</form>
|
|
<p class="mt-3 text-center"><span data-i18n="auth.hasAccount">Already have an account?</span> <a href="/" data-i18n="auth.signIn">Sign in</a></p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal for displaying registration response -->
|
|
<div class="modal fade" id="responseModal" tabindex="-1" aria-labelledby="responseModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="responseModalLabel" data-i18n="auth.registrationStatus">Registration status</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body" id="response-message">
|
|
<!-- Response message will be inserted here -->
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-i18n="common.close">Close</button>
|
|
<button type="button" class="btn btn-primary" id="redirect-login" data-i18n="auth.returnToHome">Return to home page</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="./js/app_register.js"></script>
|
|
|
|
</body>
|
|
</html>
|