Files
portal/views/card_view.html
2026-11-06 11:29:54 +01:00

35 lines
1.9 KiB
HTML

<form action="/cards/{{ .Id.Get }}" method="POST">
<div class="mx-auto p-3 m-4 flex flex-wrap rounded shadow-md">
<div class="grid grid-cols-15 items-center w-full">
<span class="col-start-1 col-end-2 justify-center w-7 h-7 rounded-full object-left">
{{ if .GetEnabled }}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="w-6 h-6 stroke-current text-green-600" width="64" height="64" viewBox="0 0 512 512">
{{ else }}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="w-6 h-6 stroke-current text-gray-600" width="64" height="64" viewBox="0 0 512 512">
{{ end }}
<path fill="currentColor" d="M32 376a56 56 0 0 0 56 56h336a56 56 0 0 0 56-56V222H32Zm66-76a30 30 0 0 1 30-30h48a30 30 0 0 1 30 30v20a30 30 0 0 1-30 30h-48a30 30 0 0 1-30-30ZM424 80H88a56 56 0 0 0-56 56v26h448v-26a56 56 0 0 0-56-56"></path>
</svg>
</span>
<h3 class="col-start-2 col-end-6 ml-1 pb-2 object-left">{{ .Name }}</h3>
{{ if .GetEnabled }}
<button type="submit" name="action" value="deactivate" class="col-start-11 col-end-16 button-add bg-blue-400 hover:bg-blue-600 ml-1 pr-2 pl-2 pt-1 pb-1">Deactivate</button>
{{ else }}
<button type="submit" name="action" value="activate" class="col-start-11 col-end-16 button-add ml-1 pr-2 pl-2 pt-1 pb-1">Activate</button>
{{ end}}
</div>
<div class="grid grid-cols-3 w-full">
{{ if .GetEnabled }}
<span class="col-start-1 col-end-2 mt-4 text-xs text-green-600 text-left">this card is active!</span>
{{ else }}
<span class="col-start-1 col-end-2 mt-4 text-xs text-red-600 text-left">this card is inactive</span>
{{ end}}
<span class="col-start-3 col-end-4 mt-4 text-xs text-gray-500 text-right">{{ .CardSerial }}</span>
</div>
</div>
</form>