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:
+12
-32
@@ -11,8 +11,8 @@
|
||||
|
||||
{% block content %}
|
||||
<style>
|
||||
.settings-overlay{position:fixed;inset:0;z-index:500;display:flex;background:rgba(0,0,0,.5);backdrop-filter:blur(2px);}
|
||||
.settings-panel{display:flex;width:1050px;max-width:98vw;height:85vh;margin:auto;background:var(--bg-primary);border:1px solid var(--border-strong);border-radius:14px;box-shadow:0 16px 48px rgba(0,0,0,.6);overflow:hidden;}
|
||||
.settings-overlay{position:fixed;inset:0;z-index:500;display:flex;background:rgba(0,0,0,.4);backdrop-filter:blur(2px);}
|
||||
.settings-panel{display:flex;width:1050px;max-width:98vw;height:85vh;margin:auto;background:var(--bg-primary);border:1px solid var(--border-strong);border-radius:14px;box-shadow:var(--shadow-modal);overflow:hidden;}
|
||||
.settings-nav{width:200px;min-width:200px;background:var(--bg-sidebar);border-right:1px solid var(--border);padding:8px 0;overflow-y:auto;}
|
||||
.settings-nav-header{padding:12px 16px;font-size:13px;font-weight:600;color:var(--text-dim);text-transform:uppercase;letter-spacing:.5px;}
|
||||
.settings-nav-item{display:flex;align-items:center;gap:8px;padding:6px 16px;font-size:13px;color:var(--text-secondary);cursor:pointer;transition:background 100ms;border-radius:0;}
|
||||
@@ -38,7 +38,7 @@
|
||||
.avatar-upload-input{display:none;}
|
||||
|
||||
/* Avatar color swatches */
|
||||
.avatar-color-swatch{width:40px;height:40px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;color:#fff;cursor:pointer;border:2px solid transparent;transition:all 120ms;}
|
||||
.avatar-color-swatch{width:40px;height:40px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;color:var(--text-primary);cursor:pointer;border:2px solid transparent;transition:all 120ms;}
|
||||
.avatar-color-swatch:hover{transform:scale(1.1);}
|
||||
.avatar-color-swatch.selected{border-color:var(--accent);box-shadow:0 0 0 2px rgba(35,131,226,.4);}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
.color-swatch.selected{border-color:var(--text);box-shadow:0 0 0 2px var(--accent);}
|
||||
|
||||
/* Admin tables */
|
||||
.table-wrap{overflow-x:auto;border-radius:8px;border:1px solid #333;}
|
||||
.table-wrap{overflow-x:auto;border-radius:8px;border:1px solid var(--border);}
|
||||
.admin-table{width:100%;border-collapse:collapse;font-size:13px;}
|
||||
.admin-table th{background:var(--bg-tertiary);color:var(--text-dim);font-weight:500;padding:8px 12px;text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.5px;white-space:nowrap;}
|
||||
.admin-table td{padding:8px 12px;border-top:1px solid var(--border);color:var(--text);}
|
||||
@@ -63,11 +63,11 @@
|
||||
.stat-value{font-size:22px;font-weight:700;color:var(--accent);}
|
||||
.stat-label{font-size:11px;color:var(--text-dim);margin-top:2px;text-transform:uppercase;letter-spacing:.5px;}
|
||||
.role-badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:500;}
|
||||
.role-admin{background:rgba(35,131,226,.2);color:#4DA3F5;}
|
||||
.role-admin{background:rgba(35,131,226,.2);color:var(--accent);}
|
||||
.role-user{background:rgba(120,119,116,.2);color:var(--text-dim);}
|
||||
.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:5px;vertical-align:middle;}
|
||||
.status-dot.active{background:#0F7B6C;}
|
||||
.status-dot.inactive{background:#E03E3E;}
|
||||
.status-dot.active{background:var(--toast-success-bg);}
|
||||
.status-dot.inactive{background:var(--danger);}
|
||||
|
||||
/* Close button */
|
||||
.settings-close{position:absolute;top:12px;right:12px;width:32px;height:32px;background:none;border:none;color:var(--text-dim);font-size:20px;cursor:pointer;border-radius:6px;display:flex;align-items:center;justify-content:center;}
|
||||
@@ -154,7 +154,7 @@
|
||||
<span x-show="!accountSaving">💾 Save changes</span>
|
||||
<span x-show="accountSaving">Saving…</span>
|
||||
</button>
|
||||
<span x-show="accountMsg" x-text="accountMsg" style="margin-left:12px;font-size:13px;color:#0F7B6C;"></span>
|
||||
<span x-show="accountMsg" x-text="accountMsg" style="margin-left:12px;font-size:13px;color:var(--toast-success-bg);"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
<h3 style="margin:0 0 8px;">Delete tag</h3>
|
||||
<p style="color:var(--text-dim);margin:0 0 16px;">
|
||||
Are you sure you want to delete the tag "<strong x-text="deletingTag?.name"></strong>"?
|
||||
<span x-show="deletingTag?.count > 0" style="color:#E03E3E;display:block;margin-top:4px;">
|
||||
<span x-show="deletingTag?.count > 0" style="color:var(--danger);display:block;margin-top:4px;">
|
||||
⚠️ This tag is used on <span x-text="deletingTag?.count"></span> item(s).
|
||||
</span>
|
||||
</p>
|
||||
@@ -324,7 +324,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<span x-show="giteaLinked" style="font-size:12px;color:#0F7B6C;">✅ Active</span>
|
||||
<span x-show="giteaLinked" style="font-size:12px;color:var(--toast-success-bg);">✅ Active</span>
|
||||
<button x-show="giteaLinked && authMethod!=='gitea'" class="btn-sm" style="color:var(--danger);" @click="disconnectGitea()">Disconnect</button>
|
||||
<a x-show="!giteaLinked" class="btn-sm" href="/auth/login?provider=gitea&mode=link" style="text-decoration:none;color:var(--accent);">🔗 Connect</a>
|
||||
</div>
|
||||
@@ -339,7 +339,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<span x-show="githubLinked" style="font-size:12px;color:#0F7B6C;">✅ Active</span>
|
||||
<span x-show="githubLinked" style="font-size:12px;color:var(--toast-success-bg);">✅ Active</span>
|
||||
<button x-show="githubLinked && authMethod!=='github'" class="btn-sm" style="color:var(--danger);" @click="disconnectGithub()">Disconnect</button>
|
||||
<a x-show="!githubLinked" class="btn-sm" href="/auth/login?provider=github&mode=link" style="text-decoration:none;color:var(--accent);">🔗 Connect</a>
|
||||
</div>
|
||||
@@ -522,7 +522,7 @@ document.addEventListener('alpine:init', function() {
|
||||
giteaLinked: false,
|
||||
githubLinked: false,
|
||||
// Theme
|
||||
theme: localStorage.getItem('fd_theme') || 'dark',
|
||||
theme: localStorage.getItem('fd_theme') || 'light',
|
||||
// Account form
|
||||
accountForm: {login:'{{ user.login or "" }}', full_name:'{{ user.full_name or "" }}', email:'{{ user.email or "" }}', password:''},
|
||||
accountSaving: false,
|
||||
@@ -739,26 +739,6 @@ document.addEventListener('alpine:init', function() {
|
||||
applyTheme() {
|
||||
localStorage.setItem('fd_theme', this.theme);
|
||||
document.documentElement.setAttribute('data-theme', this.theme);
|
||||
if (this.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');
|
||||
} else {
|
||||
document.documentElement.style.removeProperty('--bg-primary');
|
||||
document.documentElement.style.removeProperty('--bg-secondary');
|
||||
document.documentElement.style.removeProperty('--bg-tertiary');
|
||||
document.documentElement.style.removeProperty('--text');
|
||||
document.documentElement.style.removeProperty('--text-secondary');
|
||||
document.documentElement.style.removeProperty('--text-dim');
|
||||
document.documentElement.style.removeProperty('--border');
|
||||
document.documentElement.style.removeProperty('--border-strong');
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
}
|
||||
},
|
||||
|
||||
saveDefaultView() {
|
||||
|
||||
Reference in New Issue
Block a user