feat: workspace contextuel — pages liées au projet, sidebar vues cliquables
- pages.workspace = owner/repo (ex: bruno/flowdeck) au lieu du nom user
- Sidebar: Kanban board + 4 sous-vues avec URLs distinctes (?view=kanban|table|...)
- Cliquer sur 'Table view' dans sidebar → change la vue à droite
- Dashboard (/): sidebar montre uniquement les projets Gitea
- Board (/board/{o}/{r}): sidebar montre les pages de ce projet
- Changement de projet = changement de contexte (pages isolées)
- newPage/newSubPage passent workspace_key à l'API
- Auto-switch view depuis paramètre URL dans board.html
This commit is contained in:
@@ -342,6 +342,7 @@
|
||||
pageIcon: '{% block page_icon %}📁{% endblock %}',
|
||||
pageTitle: '{% block page_title %}FlowDeck{% endblock %}',
|
||||
lastEdited: '{{ last_edited }}',
|
||||
workspaceKey: '{{ workspace_key }}',
|
||||
currentView: 'home',
|
||||
contextMenu: { visible: false, x: 0, y: 0, pageId: null, pageName: '' },
|
||||
contextActions: {},
|
||||
@@ -383,7 +384,8 @@
|
||||
return m ? m[1] : '';
|
||||
},
|
||||
newPage(section) {
|
||||
fetch(`/board/api/pages?title=New%20page§ion=${encodeURIComponent(section)}`, {
|
||||
const project = this.workspaceKey || '';
|
||||
fetch(`/board/api/pages?title=New%20page§ion=${encodeURIComponent(section)}&project=${encodeURIComponent(project)}`, {
|
||||
method: 'POST',
|
||||
headers: { 'X-CSRF-Token': this.getCsrfToken() }
|
||||
})
|
||||
@@ -392,7 +394,8 @@
|
||||
.catch(err => { alert('Failed to create page: ' + err.message); });
|
||||
},
|
||||
newSubPage(parentId) {
|
||||
fetch(`/board/api/pages?title=New%20page§ion=Private`, {
|
||||
const project = this.workspaceKey || '';
|
||||
fetch(`/board/api/pages?title=New%20page§ion=Private&project=${encodeURIComponent(project)}`, {
|
||||
method: 'POST',
|
||||
headers: { 'X-CSRF-Token': this.getCsrfToken() }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user