diff --git a/app/templates/_page_editor_content.html b/app/templates/_page_editor_content.html index 54d25d9..045b764 100644 --- a/app/templates/_page_editor_content.html +++ b/app/templates/_page_editor_content.html @@ -743,7 +743,7 @@ @@ -753,41 +753,7 @@ > {{ fd_icon("file",14) }} Templates -
- -
-
- {{ fd_icon("bar-chart",14) }} Table -
-
- {{ fd_icon("copy",14) }} Board -
-
- {{ fd_icon('list',14) }} List -
-
- {{ fd_icon("calendar",14) }} Timeline -
-
- {{ fd_icon("calendar",14) }} Calendar -
-
- {{ fd_icon("image",14) }} Gallery -
-
-
- {{ fd_icon("download",14) }} Import -
-
-
Saving... @@ -1010,4 +976,27 @@
- + +
+
+
+

{{ fd_icon("copy",16) }} Create form

+ +
+
+

Enter a name for the new form.

+ +
+ +
+
+ + diff --git a/app/templates/base.html b/app/templates/base.html index f735648..70e9b8f 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -2613,8 +2613,10 @@ .then(html => { const ul = document.getElementById('sidebar-workspace-items'); if (!ul) return; - // Preserve the "Manage Workspaces" link (last
  • ) - const manageLink = ul.querySelector('li:last-child'); + // Preserve the "Manage Workspaces" link (direct last
  • child only — + // plain 'li:last-child' grabs the last file of a nested folder sublist + // when the tree has folders, splicing it back in → duplicated entry) + const manageLink = ul.querySelector(':scope > li:last-child'); ul.innerHTML = html; if (manageLink) ul.appendChild(manageLink); // Le HTML injecté porte des directives Alpine (@contextmenu, diff --git a/static/js/page_editor_scripts.js b/static/js/page_editor_scripts.js index 8b61da4..72caa94 100644 --- a/static/js/page_editor_scripts.js +++ b/static/js/page_editor_scripts.js @@ -1480,6 +1480,7 @@ const PD=(()=>{try{const el=document.getElementById('page-data');return el?JSON. _commentSel:{range:null,bid:null,start:0,end:0}, _notifiedMentions:{}, undoStack:[],redoStack:[],_histCap:100,_histLock:false, + inlineDBs: [], formOpen: false, formName: '', // ── Cover & icon (v5.10+) ── coverUrl:'', coverOpen:false, @@ -2727,14 +2728,21 @@ applyAIBlocks(text){ }catch(e){} return this.blocks.length; }, - async createForm(){ - const name=prompt('Form name:','New Form'); - if(!name||!name.trim())return; + openFormModal(){ + this.formName='New Form'; + this.formOpen=true; + this.$nextTick(()=>{ const el=this.$refs.formNameInput; if(el) el.focus(); }); + }, + closeFormModal(){ this.formOpen=false; }, + async confirmCreateForm(){ + const name=this.formName.trim(); + if(!name){ this.showToast('Form name required','error'); return; } + this.formOpen=false; const csrf = getCsrf();; try{ const r=await fetch('/db/inline/api',{ method:'POST',headers:{'Content-Type':'application/json','X-CSRF-Token':csrf}, - body:JSON.stringify({name:name.trim(),parent_page_id:this.pid}) + body:JSON.stringify({name:name,parent_page_id:this.pid}) }); const d=await r.json(); if(d.id){