fix: Gitea sidebar now has separate Repository section below Private
Backend: - _sidebar_data() no longer clears workspace_pages for Gitea workspaces The local tree stays intact in the 'Private' section - workspace_pages is always loaded from DB (local files) Sidebar template (base.html): - Workspace section renamed to 'Private' when gitea_workspace is true - New 'Repository (Gitea)' section added below, visible only for Gitea workspaces, with its own toggle (sectionsOpen.gitea) and refresh button - Uses #sidebar-gitea-items container for the remote file tree Gitea workspace: - loadSidebarTree() now targets #sidebar-gitea-items - window._gwData exposed for sidebar refresh button - sectionsOpen now includes gitea: true by default
This commit is contained in:
+23
-3
@@ -116,12 +116,12 @@
|
||||
</div>
|
||||
|
||||
<div class="sidebar-scroll">
|
||||
<!-- Workspace -->
|
||||
<!-- Workspace / Private -->
|
||||
<div class="sidebar-section">
|
||||
<div class="sidebar-section-header" @click="toggleSection('workspace')">
|
||||
<div class="sidebar-section-title">
|
||||
<span class="chevron" :class="{ open: sectionsOpen.workspace }" x-text="sectionsOpen.workspace ? '▼' : '▶'"></span>
|
||||
<span>{% if workspace_key and '/' in workspace_key %}🔗{% else %}📁{% endif %} {{ active_ws_name or 'Workspace' }}</span>
|
||||
<span>{% if gitea_workspace %}📁 Private{% elif workspace_key and '/' in workspace_key %}🔗{% else %}📁{% endif %} {{ active_ws_name if not gitea_workspace else '' }}</span>
|
||||
</div>
|
||||
<div class="sidebar-section-actions">
|
||||
<button class="section-action-btn" title="New Page" @click.stop="newPageInWorkspace()">📄</button>
|
||||
@@ -143,6 +143,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Repository (Gitea) — only visible for Gitea workspaces -->
|
||||
{% if gitea_workspace %}
|
||||
<div class="sidebar-section">
|
||||
<div class="sidebar-section-header" @click="toggleSection('gitea')">
|
||||
<div class="sidebar-section-title">
|
||||
<span class="chevron" :class="{ open: sectionsOpen.gitea }" x-text="sectionsOpen.gitea ? '▼' : '▶'"></span>
|
||||
<span>🔗 Repository (Gitea)</span>
|
||||
</div>
|
||||
<div class="sidebar-section-actions">
|
||||
<button class="section-action-btn" title="Refresh" @click.stop="if(window._gwData)window._gwData.refreshTree()">🔄</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-section-items" x-show="sectionsOpen.gitea" x-transition>
|
||||
<ul class="sidebar-items" data-section="gitea" id="sidebar-gitea-items">
|
||||
<li class="sidebar-item empty-hint"><span class="page-icon">🔗</span><span class="page-name text-dim">Loading...</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Meetings -->
|
||||
<div class="sidebar-section">
|
||||
<div class="sidebar-section-header" @click="toggleSection('meetings')">
|
||||
@@ -585,7 +605,7 @@
|
||||
|
||||
// ── Sections collapsible ──
|
||||
sectionsOpen: (function() {
|
||||
var def = { recents: true, private: true, meetings: true, favorites: true, agents: true, shared: true, published: true, apps: true, workspace: true };
|
||||
var def = { recents: true, private: true, meetings: true, favorites: true, agents: true, shared: true, published: true, apps: true, workspace: true, gitea: true };
|
||||
try {
|
||||
var saved = JSON.parse(localStorage.getItem('fd_sections') || '{}');
|
||||
return Object.assign(def, saved);
|
||||
|
||||
Reference in New Issue
Block a user