fix: Windows path handling, light theme default, file viewer in editor, first-user admin logic
Config: - Fixed SQLite path parsing on Windows (handle drive letters without prepending /) - Changed default theme from dark to light - Updated OAuth test credentials (gitea_oauth_client_id/secret) Auth: - First real user (excluding default admin with no password) becomes admin - Changed user count query to exclude users without password_hash File viewer: - Removed separate _render_file_viewer() —
This commit is contained in:
+9
-51
@@ -1,12 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr" data-theme="dark">
|
||||
<html lang="fr" data-theme="light">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>FlowDeck — {% block title_prefix %}Home{% endblock %}</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<link rel="stylesheet" href="/static/css/design-tokens.css?v=1.0">
|
||||
<link rel="stylesheet" href="/static/css/app.css?v=2.4.6">
|
||||
<link rel="stylesheet" href="/static/css/app.css?v=3.0.0">
|
||||
<script src="/static/js/htmx.min.js"></script>
|
||||
<script src="/static/js/alpine.min.js" defer></script>
|
||||
<script src="/static/js/sortable.min.js" defer></script>
|
||||
@@ -1049,38 +1048,13 @@
|
||||
toggleTheme() {
|
||||
const html = document.documentElement;
|
||||
const current = html.getAttribute('data-theme');
|
||||
html.setAttribute('data-theme', current === 'dark' ? 'light' : 'dark');
|
||||
localStorage.setItem('fd_theme', current === 'dark' ? 'light' : 'dark');
|
||||
if (current === 'dark') {
|
||||
// Switching to light
|
||||
html.style.setProperty('--bg-primary', '#FFFFFF');
|
||||
html.style.setProperty('--bg-secondary', '#F7F6F3');
|
||||
html.style.setProperty('--bg-tertiary', '#EDECE9');
|
||||
html.style.setProperty('--text', '#37352F');
|
||||
html.style.setProperty('--text-secondary', '#6B6966');
|
||||
html.style.setProperty('--text-dim', '#9B9A97');
|
||||
html.style.setProperty('--border', '#E0DFDC');
|
||||
html.style.setProperty('--border-strong', '#CCCBC8');
|
||||
} else {
|
||||
// Switching to dark — remove overrides, use CSS defaults
|
||||
['bg-primary','bg-secondary','bg-tertiary','text','text-secondary','text-dim','border','border-strong'].forEach(function(v) {
|
||||
html.style.removeProperty('--'+v);
|
||||
});
|
||||
}
|
||||
const next = current === 'dark' ? 'light' : 'dark';
|
||||
html.setAttribute('data-theme', next);
|
||||
localStorage.setItem('fd_theme', next);
|
||||
},
|
||||
initTheme() {
|
||||
var saved = localStorage.getItem('fd_theme') || 'dark';
|
||||
if (saved === 'light') {
|
||||
document.documentElement.setAttribute('data-theme', 'light');
|
||||
document.documentElement.style.setProperty('--bg-primary', '#FFFFFF');
|
||||
document.documentElement.style.setProperty('--bg-secondary', '#F7F6F3');
|
||||
document.documentElement.style.setProperty('--bg-tertiary', '#EDECE9');
|
||||
document.documentElement.style.setProperty('--text', '#37352F');
|
||||
document.documentElement.style.setProperty('--text-secondary', '#6B6966');
|
||||
document.documentElement.style.setProperty('--text-dim', '#9B9A97');
|
||||
document.documentElement.style.setProperty('--border', '#E0DFDC');
|
||||
document.documentElement.style.setProperty('--border-strong', '#CCCBC8');
|
||||
}
|
||||
var saved = localStorage.getItem('fd_theme') || 'light';
|
||||
document.documentElement.setAttribute('data-theme', saved);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1115,24 +1089,8 @@
|
||||
|
||||
// Apply saved theme on page load (AND on bfcache restore)
|
||||
function applySavedTheme() {
|
||||
var saved = localStorage.getItem('fd_theme') || 'dark';
|
||||
var h = document.documentElement;
|
||||
h.setAttribute('data-theme', saved);
|
||||
if (saved === 'light') {
|
||||
h.style.setProperty('--bg-primary', '#FFFFFF');
|
||||
h.style.setProperty('--bg-secondary', '#F7F6F3');
|
||||
h.style.setProperty('--bg-tertiary', '#EDECE9');
|
||||
h.style.setProperty('--text', '#37352F');
|
||||
h.style.setProperty('--text-secondary', '#6B6966');
|
||||
h.style.setProperty('--text-dim', '#9B9A97');
|
||||
h.style.setProperty('--border', '#E0DFDC');
|
||||
h.style.setProperty('--border-strong', '#CCCBC8');
|
||||
} else {
|
||||
// Remove light overrides, use CSS defaults
|
||||
['bg-primary','bg-secondary','bg-tertiary','text','text-secondary','text-dim','border','border-strong'].forEach(function(v) {
|
||||
h.style.removeProperty('--'+v);
|
||||
});
|
||||
}
|
||||
var saved = localStorage.getItem('fd_theme') || 'light';
|
||||
document.documentElement.setAttribute('data-theme', saved);
|
||||
}
|
||||
applySavedTheme();
|
||||
// Re-apply when page is restored from bfcache (e.g. browser back button)
|
||||
|
||||
Reference in New Issue
Block a user