formated orders template

This commit is contained in:
bronku 2025-04-05 11:57:27 +02:00
parent f13a4ecde2
commit 939665ea02

View file

@ -1,10 +1,10 @@
{{define "title"}} {{define "title"}}
Orders Orders
{{end}} {{end}}
{{define "main"}} {{define "main"}}
<main> <main>
<form class="search-container" hx-get="/orders/search" hx-target="#results-table" hx-trigger="keyup delay:500ms, change"> <form class="search-container" hx-get="/orders/search" hx-target="#results-table"
hx-trigger="keyup delay:500ms, change">
<label> <label>
<input type="search" name="q" placeholder="Search orders..."> <input type="search" name="q" placeholder="Search orders...">
</label> </label>
@ -26,28 +26,28 @@
{{end}} {{end}}
{{define "orders-table"}} {{define "orders-table"}}
<table id="orders_table"> <table id="orders_table">
<tr> <tr>
<th></th> <th></th>
<th>Name</th> <th>Name</th>
<th>Surname</th> <th>Surname</th>
<th>Phone</th> <th>Phone</th>
<th>Location</th> <th>Location</th>
<th>Date</th> <th>Date</th>
<th>Status</th> <th>Status</th>
<th>Total</th> <th>Total</th>
</tr> </tr>
{{range .}} {{range .}}
<tr> <tr>
<th><a href="/order/{{.ID}}">edit</a></th> <th><a href="/order/{{.ID}}">edit</a></th>
<th>{{.Name}}</th> <th>{{.Name}}</th>
<th>{{.Surname}}</th> <th>{{.Surname}}</th>
<th>{{.Phone}}</th> <th>{{.Phone}}</th>
<th>{{.Location}}</th> <th>{{.Location}}</th>
<th>{{.Date.Format "2006-01-02"}}</th> <th>{{.Date.Format "2006-01-02"}}</th>
<th>{{.Status}}</th> <th>{{.Status}}</th>
<th>{{.Total}}</th> <th>{{.Total}}</th>
</tr> </tr>
{{end}} {{end}}</table>
</table> {{end}}
{{end}}