Files
vibetree/web/templates/pages/settings_statuses.html
T
Owen 8d9106542c Blank root panel, asset form as a modal, and a dedicated Statuses page
- Main panel is now blank at the top level ("Select a folder or asset
  from the tree") instead of showing a dashboard - browsing happens in
  the tree, the panel only shows something once you click into it.
  Removed the now-dead DashboardStats/Stats() machinery it depended on.
- Add/Edit Asset no longer takes over the main panel; it opens in
  #assetModal instead; asset_form.html was trimmed down to just the form
  (no more breadcrumb/panel wrapper) since the modal chrome provides the
  title and footer buttons now. The dynamic item-type-fields and submit
  listeners moved from #main-panel's delegation to the modal element's.
- Statuses split out of the General settings page into its own
  /settings/statuses page and sub-nav entry, alongside General, Item
  Types, and Users.
2026-08-17 15:45:38 -05:00

72 lines
3.5 KiB
HTML

{{define "content"}}
<div class="container-fluid p-3">
<h4 class="mb-3">Settings</h4>
<div class="row g-3">
<div class="col-md-3 col-lg-2">
{{template "settings_nav" "statuses"}}
</div>
<div class="col-md-9 col-lg-10" style="max-width: 800px">
<div class="card">
<div class="card-header py-2 fw-semibold">Statuses</div>
<div class="table-responsive">
<table class="table mb-0 align-middle">
<thead><tr><th>Order</th><th>Preview</th><th>Name &amp; Color</th><th></th></tr></thead>
<tbody>
{{range $i, $st := .Statuses}}
<tr>
<td class="text-nowrap">
<form method="post" action="/settings/statuses/{{$st.ID}}/reorder" class="d-inline">
<input type="hidden" name="dir" value="up">
<button type="submit" class="btn btn-sm btn-outline-secondary" {{if eq $i 0}}disabled{{end}}><i class="bi bi-arrow-up"></i></button>
</form>
<form method="post" action="/settings/statuses/{{$st.ID}}/reorder" class="d-inline">
<input type="hidden" name="dir" value="down">
<button type="submit" class="btn btn-sm btn-outline-secondary" {{if eq (add $i 1) (len $.Statuses)}}disabled{{end}}><i class="bi bi-arrow-down"></i></button>
</form>
</td>
<td><span class="badge text-bg-{{$st.Color}}">{{$st.Name}}</span></td>
<td>
<form method="post" action="/settings/statuses/{{$st.ID}}" class="d-flex gap-2 align-items-center">
<input type="text" class="form-control form-control-sm" name="name" value="{{$st.Name}}" style="max-width:160px" required>
<select class="form-select form-select-sm" name="color" style="max-width:130px">
{{range (list "primary" "secondary" "success" "danger" "warning" "info" "dark")}}
<option value="{{.}}" {{if eq . $st.Color}}selected{{end}}>{{.}}</option>
{{end}}
</select>
<button type="submit" class="btn btn-sm btn-outline-secondary">Save</button>
</form>
</td>
<td>
<form method="post" action="/settings/statuses/{{$st.ID}}/delete" onsubmit="return confirm('Delete this status?')">
<button type="submit" class="btn btn-sm btn-outline-danger">Delete</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
<div class="card-body border-top">
<h6>Add Status</h6>
<form method="post" action="/settings/statuses" class="d-flex gap-2 align-items-end">
<div>
<label class="form-label small mb-1">Name</label>
<input type="text" class="form-control form-control-sm" name="name" required>
</div>
<div>
<label class="form-label small mb-1">Color</label>
<select class="form-select form-select-sm" name="color">
{{range (list "primary" "secondary" "success" "danger" "warning" "info" "dark")}}<option value="{{.}}">{{.}}</option>{{end}}
</select>
</div>
<button type="submit" class="btn btn-sm btn-primary">Add</button>
</form>
</div>
</div>
</div>
</div>
</div>
{{end}}