aggiunto e testato quasar apps
This commit is contained in:
2
web/static/css/app.css
Normal file
2
web/static/css/app.css
Normal file
File diff suppressed because one or more lines are too long
5
web/static/vendor/flags/ch.svg
vendored
Normal file
5
web/static/vendor/flags/ch.svg
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" role="img" aria-label="Swiss flag">
|
||||
<rect width="32" height="32" fill="#d52b1e"/>
|
||||
<rect x="13" y="6" width="6" height="20" fill="#ffffff"/>
|
||||
<rect x="6" y="13" width="20" height="6" fill="#ffffff"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 271 B |
5
web/static/vendor/flags/de.svg
vendored
Normal file
5
web/static/vendor/flags/de.svg
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 32" role="img" aria-label="German flag">
|
||||
<rect width="48" height="10.67" x="0" y="0" fill="#000000"/>
|
||||
<rect width="48" height="10.67" x="0" y="10.67" fill="#dd0000"/>
|
||||
<rect width="48" height="10.66" x="0" y="21.34" fill="#ffce00"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 301 B |
9
web/static/vendor/flags/en.svg
vendored
Normal file
9
web/static/vendor/flags/en.svg
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 32" role="img" aria-label="English flag">
|
||||
<rect width="48" height="32" fill="#012169"/>
|
||||
<path d="M0 0 48 32M48 0 0 32" stroke="#ffffff" stroke-width="6"/>
|
||||
<path d="M0 0 48 32M48 0 0 32" stroke="#c8102e" stroke-width="3"/>
|
||||
<rect x="20" y="0" width="8" height="32" fill="#ffffff"/>
|
||||
<rect x="0" y="12" width="48" height="8" fill="#ffffff"/>
|
||||
<rect x="22" y="0" width="4" height="32" fill="#c8102e"/>
|
||||
<rect x="0" y="14" width="48" height="4" fill="#c8102e"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 531 B |
53
web/static/vendor/flags/en_us.svg
vendored
Normal file
53
web/static/vendor/flags/en_us.svg
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 32" role="img" aria-label="United States flag">
|
||||
<rect width="48" height="32" fill="#b22234"/>
|
||||
<g fill="#ffffff">
|
||||
<rect y="2.46" width="48" height="2.46"/>
|
||||
<rect y="7.38" width="48" height="2.46"/>
|
||||
<rect y="12.30" width="48" height="2.46"/>
|
||||
<rect y="17.22" width="48" height="2.46"/>
|
||||
<rect y="22.14" width="48" height="2.46"/>
|
||||
<rect y="27.06" width="48" height="2.46"/>
|
||||
</g>
|
||||
<rect width="20" height="17.23" fill="#3c3b6e"/>
|
||||
<g fill="#ffffff">
|
||||
<circle cx="2.2" cy="2.2" r="0.7"/>
|
||||
<circle cx="5.4" cy="2.2" r="0.7"/>
|
||||
<circle cx="8.6" cy="2.2" r="0.7"/>
|
||||
<circle cx="11.8" cy="2.2" r="0.7"/>
|
||||
<circle cx="15.0" cy="2.2" r="0.7"/>
|
||||
<circle cx="18.2" cy="2.2" r="0.7"/>
|
||||
<circle cx="3.8" cy="4.4" r="0.7"/>
|
||||
<circle cx="7.0" cy="4.4" r="0.7"/>
|
||||
<circle cx="10.2" cy="4.4" r="0.7"/>
|
||||
<circle cx="13.4" cy="4.4" r="0.7"/>
|
||||
<circle cx="16.6" cy="4.4" r="0.7"/>
|
||||
<circle cx="2.2" cy="6.6" r="0.7"/>
|
||||
<circle cx="5.4" cy="6.6" r="0.7"/>
|
||||
<circle cx="8.6" cy="6.6" r="0.7"/>
|
||||
<circle cx="11.8" cy="6.6" r="0.7"/>
|
||||
<circle cx="15.0" cy="6.6" r="0.7"/>
|
||||
<circle cx="18.2" cy="6.6" r="0.7"/>
|
||||
<circle cx="3.8" cy="8.8" r="0.7"/>
|
||||
<circle cx="7.0" cy="8.8" r="0.7"/>
|
||||
<circle cx="10.2" cy="8.8" r="0.7"/>
|
||||
<circle cx="13.4" cy="8.8" r="0.7"/>
|
||||
<circle cx="16.6" cy="8.8" r="0.7"/>
|
||||
<circle cx="2.2" cy="11" r="0.7"/>
|
||||
<circle cx="5.4" cy="11" r="0.7"/>
|
||||
<circle cx="8.6" cy="11" r="0.7"/>
|
||||
<circle cx="11.8" cy="11" r="0.7"/>
|
||||
<circle cx="15.0" cy="11" r="0.7"/>
|
||||
<circle cx="18.2" cy="11" r="0.7"/>
|
||||
<circle cx="3.8" cy="13.2" r="0.7"/>
|
||||
<circle cx="7.0" cy="13.2" r="0.7"/>
|
||||
<circle cx="10.2" cy="13.2" r="0.7"/>
|
||||
<circle cx="13.4" cy="13.2" r="0.7"/>
|
||||
<circle cx="16.6" cy="13.2" r="0.7"/>
|
||||
<circle cx="2.2" cy="15.4" r="0.7"/>
|
||||
<circle cx="5.4" cy="15.4" r="0.7"/>
|
||||
<circle cx="8.6" cy="15.4" r="0.7"/>
|
||||
<circle cx="11.8" cy="15.4" r="0.7"/>
|
||||
<circle cx="15.0" cy="15.4" r="0.7"/>
|
||||
<circle cx="18.2" cy="15.4" r="0.7"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
5
web/static/vendor/flags/fr.svg
vendored
Normal file
5
web/static/vendor/flags/fr.svg
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 32" role="img" aria-label="French flag">
|
||||
<rect width="16" height="32" x="0" y="0" fill="#0055a4"/>
|
||||
<rect width="16" height="32" x="16" y="0" fill="#ffffff"/>
|
||||
<rect width="16" height="32" x="32" y="0" fill="#ef4135"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 286 B |
5
web/static/vendor/flags/it.svg
vendored
Normal file
5
web/static/vendor/flags/it.svg
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 32" role="img" aria-label="Italian flag">
|
||||
<rect width="16" height="32" x="0" y="0" fill="#009246"/>
|
||||
<rect width="16" height="32" x="16" y="0" fill="#ffffff"/>
|
||||
<rect width="16" height="32" x="32" y="0" fill="#ce2b37"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 287 B |
1
web/static/vendor/htmx.min.js
vendored
Normal file
1
web/static/vendor/htmx.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
62
web/static/vendor/theme.js
vendored
Normal file
62
web/static/vendor/theme.js
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
(function () {
|
||||
var STORAGE_KEY = 'theme';
|
||||
var isAuthenticated = !!window.__TC_IS_AUTHENTICATED;
|
||||
var serverTheme = (window.__TC_SERVER_THEME || '').toLowerCase();
|
||||
var hasStoredTheme = false;
|
||||
|
||||
function getPreferredTheme() {
|
||||
var stored = localStorage.getItem(STORAGE_KEY);
|
||||
hasStoredTheme = stored === 'dark' || stored === 'light';
|
||||
if (hasStoredTheme) return stored;
|
||||
if (serverTheme === 'dark' || serverTheme === 'light') return serverTheme;
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
}
|
||||
|
||||
function applyTheme(theme) {
|
||||
var isDark = theme === 'dark';
|
||||
document.documentElement.classList.toggle('dark', isDark);
|
||||
var button = document.getElementById('themeToggle');
|
||||
if (button) {
|
||||
button.setAttribute('aria-pressed', isDark ? 'true' : 'false');
|
||||
button.textContent = isDark ? 'Light mode' : 'Dark mode';
|
||||
}
|
||||
}
|
||||
|
||||
function persistTheme(theme) {
|
||||
localStorage.setItem(STORAGE_KEY, theme);
|
||||
hasStoredTheme = true;
|
||||
}
|
||||
|
||||
function sendThemeToServer(theme) {
|
||||
if (!isAuthenticated) return;
|
||||
fetch('/preferences/theme', {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
|
||||
body: 'theme=' + encodeURIComponent(theme),
|
||||
}).catch(function () {});
|
||||
}
|
||||
|
||||
window.toggleTheme = function toggleTheme() {
|
||||
var currentIsDark = document.documentElement.classList.contains('dark');
|
||||
var nextTheme = currentIsDark ? 'light' : 'dark';
|
||||
applyTheme(nextTheme);
|
||||
persistTheme(nextTheme);
|
||||
sendThemeToServer(nextTheme);
|
||||
};
|
||||
|
||||
window.initThemeToggle = function initThemeToggle() {
|
||||
applyTheme(document.documentElement.classList.contains('dark') ? 'dark' : 'light');
|
||||
};
|
||||
|
||||
var initialTheme = getPreferredTheme();
|
||||
applyTheme(initialTheme);
|
||||
|
||||
var mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
if (typeof mediaQuery.addEventListener === 'function') {
|
||||
mediaQuery.addEventListener('change', function (event) {
|
||||
if (hasStoredTheme) return;
|
||||
applyTheme(event.matches ? 'dark' : 'light');
|
||||
});
|
||||
}
|
||||
})();
|
||||
@@ -11,7 +11,7 @@
|
||||
<script src="/static/vendor/theme.js?v={{.BuildHash}}"></script>
|
||||
<link rel="stylesheet" href="/static/css/app.css?v={{.BuildHash}}">
|
||||
<script src="/static/vendor/htmx.min.js"></script>
|
||||
<script src="/static/vendor/flowbite.js"></script>
|
||||
|
||||
</head>
|
||||
<body class="flex min-h-screen flex-col bg-white text-gray-900 antialiased dark:bg-gray-900 dark:text-gray-100">
|
||||
{{template "navbar" .}}
|
||||
@@ -45,7 +45,7 @@
|
||||
'forgot.title': 'Password dimenticata', 'forgot.subtitle': 'Inserisci la tua email per ricevere il link di reset.', 'forgot.submit': 'Invia link reset', 'forgot.back_login': 'Torna al login',
|
||||
'reset.title': 'Reset password', 'reset.subtitle': 'Imposta una nuova password.', 'reset.new_password': 'Nuova password', 'reset.submit': 'Aggiorna password', 'reset.invalid_token': 'Token mancante o non valido.',
|
||||
'verify.title': 'Verifica email', 'verify.p1': 'Controlla la casella di posta e apri il link di verifica ricevuto.', 'verify.p2': 'Se il link è scaduto, ripeti la registrazione o contatta supporto.', 'verify.go_login': 'Vai al login',
|
||||
'welcome.title': 'Dashboard', 'welcome.back_prefix': 'Bentornato', 'welcome.generic': 'Benvenuto.', 'welcome.quick_links': 'Link rapidi',
|
||||
'private.title': 'Dashboard', 'private.back_prefix': 'Bentornato', 'private.generic': 'Benvenuto.', 'private.quick_links': 'Link rapidi',
|
||||
'admin.dashboard.title': 'Admin Dashboard', 'admin.dashboard.area': 'Area amministrazione.', 'admin.users_count': 'Utenti', 'admin.current_role': 'Ruolo corrente', 'admin.navigation': 'Navigazione', 'admin.manage_users': 'Gestione utenti',
|
||||
'users.title': 'Users', 'users.subtitle': 'Ricerca, ordinamento e paging server-side via HTMX.', 'users.new_user': 'Nuovo Utente', 'users.search': 'Search', 'users.search_placeholder': 'Cerca nome o email', 'users.page_size': 'Page size', 'users.search_button': 'Cerca', 'users.user_detail': 'Dettaglio utente', 'users.actions': 'Azioni', 'users.open': 'Apri', 'users.none': 'Nessun utente trovato.', 'users.total': 'Totale', 'users.users_label': 'utenti', 'users.page': 'Pagina', 'users.prev': 'Prev', 'users.next': 'Next', 'users.close': 'Chiudi',
|
||||
'users.new_user_modal_title': 'Nuovo utente', 'users.new_user_modal_placeholder': 'Placeholder UI Flowbite. La creazione utente può essere collegata a una route backend quando disponibile.',
|
||||
@@ -60,7 +60,7 @@
|
||||
'forgot.title': 'Forgot Password', 'forgot.subtitle': 'Enter your email to receive a reset link.', 'forgot.submit': 'Send reset link', 'forgot.back_login': 'Back to login',
|
||||
'reset.title': 'Reset Password', 'reset.subtitle': 'Set a new password.', 'reset.new_password': 'New password', 'reset.submit': 'Update password', 'reset.invalid_token': 'Missing or invalid token.',
|
||||
'verify.title': 'Verify email', 'verify.p1': 'Check your inbox and open the verification link.', 'verify.p2': 'If the link expired, sign up again or contact support.', 'verify.go_login': 'Go to login',
|
||||
'welcome.title': 'Dashboard', 'welcome.back_prefix': 'Welcome back', 'welcome.generic': 'Welcome.', 'welcome.quick_links': 'Quick links',
|
||||
'private.title': 'Dashboard', 'private.back_prefix': 'Signed in as', 'private.generic': 'Signed in.', 'private.quick_links': 'Quick links',
|
||||
'admin.dashboard.title': 'Admin Dashboard', 'admin.dashboard.area': 'Administration area.', 'admin.users_count': 'Users', 'admin.current_role': 'Current role', 'admin.navigation': 'Navigation', 'admin.manage_users': 'Manage users',
|
||||
'users.title': 'Users', 'users.subtitle': 'Search, sorting and server-side paging via HTMX.', 'users.new_user': 'New user', 'users.search': 'Search', 'users.search_placeholder': 'Search by name or email', 'users.page_size': 'Page size', 'users.search_button': 'Search', 'users.user_detail': 'User details', 'users.actions': 'Actions', 'users.open': 'Open', 'users.none': 'No users found.', 'users.total': 'Total', 'users.users_label': 'users', 'users.page': 'Page', 'users.prev': 'Prev', 'users.next': 'Next', 'users.close': 'Close',
|
||||
'users.new_user_modal_title': 'New user', 'users.new_user_modal_placeholder': 'Flowbite placeholder UI. Connect creation to backend route when available.',
|
||||
@@ -75,7 +75,7 @@
|
||||
'forgot.title': 'Passwort vergessen', 'forgot.subtitle': 'Geben Sie Ihre E-Mail ein, um einen Reset-Link zu erhalten.', 'forgot.submit': 'Reset-Link senden', 'forgot.back_login': 'Zurück zum Login',
|
||||
'reset.title': 'Passwort zurücksetzen', 'reset.subtitle': 'Legen Sie ein neues Passwort fest.', 'reset.new_password': 'Neues Passwort', 'reset.submit': 'Passwort aktualisieren', 'reset.invalid_token': 'Token fehlt oder ist ungültig.',
|
||||
'verify.title': 'E-Mail verifizieren', 'verify.p1': 'Öffnen Sie die Verifizierungs-E-Mail in Ihrem Posteingang.', 'verify.p2': 'Wenn der Link abgelaufen ist, registrieren Sie sich erneut oder kontaktieren Sie den Support.', 'verify.go_login': 'Zum Login',
|
||||
'welcome.title': 'Dashboard', 'welcome.back_prefix': 'Willkommen zurück', 'welcome.generic': 'Willkommen.', 'welcome.quick_links': 'Schnelllinks',
|
||||
'private.title': 'Dashboard', 'private.back_prefix': 'Willkommen zurück', 'private.generic': 'Willkommen.', 'private.quick_links': 'Schnelllinks',
|
||||
'admin.dashboard.title': 'Admin-Dashboard', 'admin.dashboard.area': 'Administrationsbereich.', 'admin.users_count': 'Benutzer', 'admin.current_role': 'Aktuelle Rolle', 'admin.navigation': 'Navigation', 'admin.manage_users': 'Benutzer verwalten',
|
||||
'users.title': 'Benutzer', 'users.subtitle': 'Suche, Sortierung und serverseitiges Paging via HTMX.', 'users.new_user': 'Neuer Benutzer', 'users.search': 'Suche', 'users.search_placeholder': 'Nach Name oder E-Mail suchen', 'users.page_size': 'Seitengröße', 'users.search_button': 'Suchen', 'users.user_detail': 'Benutzerdetails', 'users.actions': 'Aktionen', 'users.open': 'Öffnen', 'users.none': 'Keine Benutzer gefunden.', 'users.total': 'Gesamt', 'users.users_label': 'Benutzer', 'users.page': 'Seite', 'users.prev': 'Zurück', 'users.next': 'Weiter', 'users.close': 'Schließen',
|
||||
'users.new_user_modal_title': 'Neuer Benutzer', 'users.new_user_modal_placeholder': 'Flowbite-Placeholder-UI. Bei Bedarf mit Backend-Route verbinden.',
|
||||
@@ -89,7 +89,7 @@
|
||||
'forgot.title': 'Mot de passe oublié', 'forgot.subtitle': 'Entrez votre email pour recevoir un lien de réinitialisation.', 'forgot.submit': 'Envoyer le lien', 'forgot.back_login': 'Retour à la connexion',
|
||||
'reset.title': 'Réinitialiser le mot de passe', 'reset.subtitle': 'Définissez un nouveau mot de passe.', 'reset.new_password': 'Nouveau mot de passe', 'reset.submit': 'Mettre à jour', 'reset.invalid_token': 'Jeton manquant ou invalide.',
|
||||
'verify.title': 'Vérifier l’email', 'verify.p1': 'Vérifiez votre boîte mail et ouvrez le lien de vérification.', 'verify.p2': 'Si le lien a expiré, réinscrivez-vous ou contactez le support.', 'verify.go_login': 'Aller à la connexion',
|
||||
'welcome.title': 'Tableau de bord', 'welcome.back_prefix': 'Bon retour', 'welcome.generic': 'Bienvenue.', 'welcome.quick_links': 'Liens rapides',
|
||||
'private.title': 'Tableau de bord', 'private.back_prefix': 'Bon retour', 'private.generic': 'Bienvenue.', 'private.quick_links': 'Liens rapides',
|
||||
'admin.dashboard.title': 'Tableau de bord admin', 'admin.dashboard.area': 'Zone d’administration.', 'admin.users_count': 'Utilisateurs', 'admin.current_role': 'Rôle actuel', 'admin.navigation': 'Navigation', 'admin.manage_users': 'Gérer les utilisateurs',
|
||||
'users.title': 'Utilisateurs', 'users.subtitle': 'Recherche, tri et pagination côté serveur via HTMX.', 'users.new_user': 'Nouvel utilisateur', 'users.search': 'Recherche', 'users.search_placeholder': 'Rechercher par nom ou email', 'users.page_size': 'Taille de page', 'users.search_button': 'Rechercher', 'users.user_detail': 'Détails utilisateur', 'users.actions': 'Actions', 'users.open': 'Ouvrir', 'users.none': 'Aucun utilisateur trouvé.', 'users.total': 'Total', 'users.users_label': 'utilisateurs', 'users.page': 'Page', 'users.prev': 'Préc.', 'users.next': 'Suiv.', 'users.close': 'Fermer',
|
||||
'users.new_user_modal_title': 'Nouvel utilisateur', 'users.new_user_modal_placeholder': 'UI Flowbite placeholder. Connecter à une route backend si nécessaire.',
|
||||
@@ -207,22 +207,60 @@
|
||||
});
|
||||
}
|
||||
|
||||
function reinitFlowbiteComponents(target) {
|
||||
if (typeof window.initDropdowns === 'function') window.initDropdowns();
|
||||
if (typeof window.initModals === 'function') {
|
||||
if (!target || target.id === 'usersTableContainer') {
|
||||
window.initModals();
|
||||
}
|
||||
function initNavbarComponents(root) {
|
||||
(root || document).querySelectorAll('[data-collapse-toggle]').forEach(function (button) {
|
||||
if (button.dataset.tcBound === '1') return;
|
||||
button.dataset.tcBound = '1';
|
||||
var targetId = button.getAttribute('data-collapse-toggle');
|
||||
var target = document.getElementById(targetId);
|
||||
if (!target) return;
|
||||
button.addEventListener('click', function () {
|
||||
var isHidden = target.classList.contains('hidden');
|
||||
target.classList.toggle('hidden', !isHidden);
|
||||
button.setAttribute('aria-expanded', isHidden ? 'true' : 'false');
|
||||
});
|
||||
});
|
||||
|
||||
var userButton = document.getElementById('user-menu-button');
|
||||
var userDropdown = document.getElementById('user-dropdown');
|
||||
if (userButton && userDropdown && userButton.dataset.tcBound !== '1') {
|
||||
userButton.dataset.tcBound = '1';
|
||||
userButton.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
var isHidden = userDropdown.classList.contains('hidden');
|
||||
userDropdown.classList.toggle('hidden', !isHidden);
|
||||
userButton.setAttribute('aria-expanded', isHidden ? 'true' : 'false');
|
||||
});
|
||||
}
|
||||
|
||||
if (!window.__tcNavbarDocBound) {
|
||||
window.__tcNavbarDocBound = true;
|
||||
document.addEventListener('click', function (event) {
|
||||
var btn = document.getElementById('user-menu-button');
|
||||
var menu = document.getElementById('user-dropdown');
|
||||
if (!btn || !menu || menu.classList.contains('hidden')) return;
|
||||
if (btn.contains(event.target) || menu.contains(event.target)) return;
|
||||
menu.classList.add('hidden');
|
||||
btn.setAttribute('aria-expanded', 'false');
|
||||
});
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if (event.key !== 'Escape') return;
|
||||
var btn = document.getElementById('user-menu-button');
|
||||
var menu = document.getElementById('user-dropdown');
|
||||
if (!btn || !menu) return;
|
||||
menu.classList.add('hidden');
|
||||
btn.setAttribute('aria-expanded', 'false');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
reinitFlowbiteComponents();
|
||||
initNavbarComponents(document);
|
||||
applyTranslations(document);
|
||||
if (typeof window.initThemeToggle === 'function') {
|
||||
window.initThemeToggle();
|
||||
}
|
||||
document.body.addEventListener('htmx:afterSwap', function (evt) {
|
||||
reinitFlowbiteComponents(evt.target || null);
|
||||
initNavbarComponents(evt.target || document);
|
||||
applyTranslations(evt.target || document);
|
||||
if (typeof window.initThemeToggle === 'function') {
|
||||
window.initThemeToggle();
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<ul class="mt-4 flex flex-col gap-2 rounded-lg border border-gray-100 bg-gray-50 p-4 text-sm font-medium md:mt-0 md:flex-row md:items-center md:gap-1 md:border-0 md:bg-transparent md:p-0 dark:border-gray-700 dark:bg-gray-800 md:dark:bg-transparent">
|
||||
{{if eq .NavSection "home"}}
|
||||
{{if .CurrentUser}}
|
||||
<li><a href="/welcome" class="block rounded-lg px-3 py-2 text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-700">Welcome</a></li>
|
||||
{{else}}
|
||||
<li><a href="/login" class="block rounded-lg px-3 py-2 text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-700" data-i18n="nav.login">Login</a></li>
|
||||
{{end}}
|
||||
@@ -53,6 +52,10 @@
|
||||
<span class="block truncate text-sm text-gray-500 dark:text-gray-400">{{.CurrentUser.Email}}</span>
|
||||
</div>
|
||||
<div class="py-2">
|
||||
<a href="/private" class="block w-full rounded-lg px-2 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-700">Private</a>
|
||||
{{if eq .CurrentUser.Role "admin"}}
|
||||
<a href="/admin" class="block w-full rounded-lg px-2 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-700" data-i18n="nav.admin">Admin</a>
|
||||
{{end}}
|
||||
<form action="/logout" method="post" class="px-2">
|
||||
<button type="submit" class="block w-full rounded-lg px-2 py-2 text-left text-sm text-red-700 hover:bg-red-50 dark:text-red-300 dark:hover:bg-red-900/40" data-i18n="nav.logout">Logout</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user