33 lines
1.1 KiB
HTML
33 lines
1.1 KiB
HTML
{{define "port_list"}}
|
|
<div class="ports">
|
|
<div class="port-column">
|
|
<h5>Front</h5>
|
|
{{range .Device.Ports}}{{if eq .Side "front"}}
|
|
{{$pid := .ID}}
|
|
<span class="port {{range $.Connections}}{{if and .Port1 .Port2}}{{if eq .Port1.ID $pid}}connected{{else if eq .Port2.ID $pid}}connected{{end}}{{end}}{{end}}"
|
|
hx-get="/connections/{{.ID}}"
|
|
hx-target="#modal-content"
|
|
hx-trigger="click"
|
|
onclick="openModal()"
|
|
title="{{.Name}}">
|
|
{{.Name}}
|
|
</span>
|
|
{{end}}{{end}}
|
|
</div>
|
|
<div class="port-column">
|
|
<h5>Back</h5>
|
|
{{range .Device.Ports}}{{if eq .Side "back"}}
|
|
{{$pid := .ID}}
|
|
<span class="port {{range $.Connections}}{{if and .Port1 .Port2}}{{if eq .Port1.ID $pid}}connected{{else if eq .Port2.ID $pid}}connected{{end}}{{end}}{{end}}"
|
|
hx-get="/connections/{{.ID}}"
|
|
hx-target="#modal-content"
|
|
hx-trigger="click"
|
|
onclick="openModal()"
|
|
title="{{.Name}}">
|
|
{{.Name}}
|
|
</span>
|
|
{{end}}{{end}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|