Replace on-screen action buttons with right-click context menus

The tree and main panels now behave like a native file manager: right
click (or the keyboard Menu key) on a folder, asset, breadcrumb crumb, or
empty tree/panel background brings up the relevant actions instead of a
row of always-visible buttons.

- New generic showContextMenu() in app.js with per-target-kind menu
  builders (folder/asset/tree background/panel background), gated by
  admin role the same way the old buttons were.
- Removed: the "..." tree-row action button, and the New Folder/Add
  Asset/Rename/Delete/Edit/Move/Duplicate/Import/Export buttons from the
  inventory toolbar and every panel. Expand All/Collapse All shrank to two
  icon-only buttons next to the search box; everything else creation- or
  mutation-related is right-click only.
- Replaced the per-asset embedded "Move" modal with one shared
  #moveAssetModal populated via a new GET /app/folders/options endpoint,
  since move can now be triggered from any asset row, not just its own
  detail view.
- Breadcrumb crumbs (including the current folder) and folder/asset table
  rows are now valid right-click targets too, not just tree rows.
This commit is contained in:
Owen
2026-08-17 15:24:32 -05:00
parent 218687a1ee
commit 4ceb1cbc03
13 changed files with 299 additions and 193 deletions
+4 -11
View File
@@ -1,8 +1,8 @@
{{define "panel_root"}}
<div class="panel-content p-3">
<div class="panel-content p-3" data-panel-type="root">
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-2">
<li class="breadcrumb-item active" aria-current="page">Inventory</li>
<li class="breadcrumb-item active" aria-current="page" data-type="root">Inventory</li>
</ol>
</nav>
@@ -62,14 +62,7 @@
</div>
</div>
<div class="d-flex align-items-center mb-2">
<h6 class="mb-0">Top-Level Folders</h6>
<div class="ms-auto d-flex gap-2">
<a class="btn btn-sm btn-outline-secondary" href="/export/assets.csv"><i class="bi bi-download"></i> Export CSV</a>
<button class="btn btn-sm btn-outline-secondary admin-only" data-bs-toggle="modal" data-bs-target="#importModal"><i class="bi bi-upload"></i> Import CSV</button>
<button class="btn btn-sm btn-primary admin-only" id="btn-new-folder-root"><i class="bi bi-folder-plus"></i> New Folder</button>
</div>
</div>
<h6 class="mb-2">Top-Level Folders</h6>
{{if .Folders}}
<div class="list-group mb-3">
@@ -83,7 +76,7 @@
{{end}}
</div>
{{else}}
<p class="text-body-secondary">No folders yet. {{if true}}<span class="admin-only">Create one to start organizing your inventory.</span>{{end}}</p>
<p class="text-body-secondary">No folders yet. <span class="admin-only">Right-click here (or the tree) to create one.</span></p>
{{end}}
{{if .UnfiledAssets}}