diff --git a/portal/templates/app/project.html b/portal/templates/app/project.html
index 0382136..e26f990 100644
--- a/portal/templates/app/project.html
+++ b/portal/templates/app/project.html
@@ -454,14 +454,24 @@
: `All`;
html += `
|
-
+ |
${chevron}
${escHtml(name)}
${visBadge}
${childCount} items
-
-
+
+
+ |
+
+
+
|
`;
} else if (item.type === 'section') {
@@ -470,11 +480,19 @@
draggable="true" ondragstart="onDragStart(event)" ondragover="onDragOver(event)" ondragleave="onDragLeave(event)" ondrop="onDrop(event)">
\u2630 |
${escHtml(num)} |
-
+ |
${chevron}
${escHtml(name)}
${item.children_count||0} requests
-
+
+ |
+
+
+
|
`;
} else {
@@ -616,6 +634,36 @@
}
}
+ async function renameListOrSection(id, type) {
+ // Close the menu
+ const menu = document.getElementById('menu-' + id);
+ if (menu) menu.style.display = 'none';
+ openMenuId = null;
+
+ const item = treeData.find(t => t.entry_id === id);
+ if (!item) return;
+ const d = item.data || {};
+ const currentName = d.name || d.title || '';
+ const newName = prompt('Rename ' + (type === 'list' ? 'list' : 'section') + ':', currentName);
+ if (!newName || !newName.trim() || newName.trim() === currentName) return;
+
+ const updated = { ...d, name: newName.trim(), title: newName.trim() };
+ item.data = updated;
+ try {
+ const res = await fetchAPI('/api/projects/' + projectID + '/entries/' + id, {
+ method: 'PUT',
+ body: JSON.stringify({ data: JSON.stringify(updated), version: item.version || 0 })
+ });
+ if (res.ok) {
+ const result = await res.json();
+ if (result.version) item.version = result.version;
+ renderTree();
+ }
+ } catch(e) {
+ loadRequestTree();
+ }
+ }
+
function toggleCollapse(id) {
if (collapsed.has(id)) collapsed.delete(id); else collapsed.add(id);
renderTree();