diff --git a/app/routers/dashboard.py b/app/routers/dashboard.py
index db3508b..690cebb 100644
--- a/app/routers/dashboard.py
+++ b/app/routers/dashboard.py
@@ -545,14 +545,15 @@ async def create_local_workspace_item(request: Request):
body = await request.json()
name = body.get("name", "Untitled").strip()
item_type = body.get("type", "page")
+ parent_id = body.get("parent_id")
ws = _get_active_workspace(request)
ws_id = ws["id"] if ws else None
section = 'Workspace' if item_type == 'folder' else 'Private'
with get_conn() as conn:
cursor = conn.execute(
- "INSERT INTO pages (workspace, workspace_id, title, content, content_format, parent_section) "
- "VALUES ('', ?, ?, '', 'blocks', ?)",
- (ws_id, name, section),
+ "INSERT INTO pages (workspace, workspace_id, title, content, content_format, parent_section, parent_id) "
+ "VALUES ('', ?, ?, '', 'blocks', ?, ?)",
+ (ws_id, name, section, parent_id),
)
conn.commit()
pid = cursor.lastrowid
diff --git a/app/templates/base.html b/app/templates/base.html
index 6ae46cb..3d80b5d 100644
--- a/app/templates/base.html
+++ b/app/templates/base.html
@@ -631,7 +631,7 @@
.catch(err => { alert('Failed to create sub-page: ' + err.message); });
},
newPageInWorkspace() {
- const name = prompt('Page name:');
+ const name = prompt('File name:');
if (!name || !name.trim()) return;
fetch('/api/local-workspace/items', {
method: 'POST',
diff --git a/app/templates/local_workspace.html b/app/templates/local_workspace.html
index 0f5d86a..1f2fb84 100644
--- a/app/templates/local_workspace.html
+++ b/app/templates/local_workspace.html
@@ -5,22 +5,19 @@
{% block topbar %}
{{ items | length }} item(s)
+Create a new file to start writing, or a folder to organize your content