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
parent
842913659a
commit
cada7ab6c2
|
|
@ -185,3 +185,6 @@ section { margin-bottom: 2em; }
|
||||||
|
|
||||||
/* TOOLBAR */
|
/* TOOLBAR */
|
||||||
.toolbar { margin-bottom: 1em; }
|
.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; }
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
<span>{{.RackType}} / {{.Depth}} / {{.HeightUnits}}U</span>
|
<span>{{.RackType}} / {{.Depth}} / {{.HeightUnits}}U</span>
|
||||||
{{if .Comment}}<small>{{.Comment}}</small>{{end}}
|
{{if .Comment}}<small>{{.Comment}}</small>{{end}}
|
||||||
</a>
|
</a>
|
||||||
|
{{else}}
|
||||||
|
<div class="empty-state">No racks yet. Create one below.</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<details>
|
<details>
|
||||||
|
|
@ -33,6 +35,8 @@
|
||||||
{{if .Model}}<span>{{.Model.Manufacturer}} {{.Model.Name}}</span>{{end}}
|
{{if .Model}}<span>{{.Model.Manufacturer}} {{.Model.Name}}</span>{{end}}
|
||||||
{{if .UsageDescription}}<small>{{.UsageDescription}}</small>{{end}}
|
{{if .UsageDescription}}<small>{{.UsageDescription}}</small>{{end}}
|
||||||
</a>
|
</a>
|
||||||
|
{{else}}
|
||||||
|
<div class="empty-state">No devices yet. Create one or add a rack first.</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<details>
|
<details>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue