Add empty-state messages to overview page

Grid sections for Racks and Devices now show a dashed 'No X yet' message
when the collection is empty, using Go template {{else}} blocks. CSS
styles the placeholder with muted text and a dashed border.
master
Joca 2026-06-09 18:55:03 -03:00
parent 842913659a
commit cada7ab6c2
Signed by: jocadbz
GPG Key ID: B1836DCE2F50BDF7
2 changed files with 7 additions and 0 deletions

View File

@ -185,3 +185,6 @@ section { margin-bottom: 2em; }
/* TOOLBAR */
.toolbar { margin-bottom: 1em; }
/* EMPTY STATE */
.empty-state { padding: 2em 1em; text-align: center; color: var(--text-muted); font-style: italic; border: 1px dashed var(--border); border-radius: 4px; grid-column: 1 / -1; }

View File

@ -11,6 +11,8 @@
<span>{{.RackType}} / {{.Depth}} / {{.HeightUnits}}U</span>
{{if .Comment}}<small>{{.Comment}}</small>{{end}}
</a>
{{else}}
<div class="empty-state">No racks yet. Create one below.</div>
{{end}}
</div>
<details>
@ -33,6 +35,8 @@
{{if .Model}}<span>{{.Model.Manufacturer}} {{.Model.Name}}</span>{{end}}
{{if .UsageDescription}}<small>{{.UsageDescription}}</small>{{end}}
</a>
{{else}}
<div class="empty-state">No devices yet. Create one or add a rack first.</div>
{{end}}
</div>
<details>