master
Nilo Roberto C Paim 2024-02-04 20:40:59 -03:00
parent afd43e3ff3
commit c06b44b71d
2 changed files with 28 additions and 4 deletions

View File

@ -6,8 +6,9 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.6.0/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>
<script src="https://unpkg.com/htmx.org@latest"></script>
<script src="https://unpkg.com/htmx.org@latest/dist/ext/remove-me.js"></script>
<script src="https://unpkg.com/htmx.org@latest/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/mustache@latest"></script>
<link rel="stylesheet" href="/css/custom.css">
@ -28,6 +29,14 @@
<div id="content">
</div>
<div hx-ext="remove-me" role="alert" class="alert alert-success" remove-me="2s">
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span>Your purchase has been confirmed!</span>
</div>
</body>
</html>

View File

@ -1,6 +1,21 @@
{{ define "users" }}
<h1 class="text-3xl mb-8">Users</h1>
<ul>
{{ range .Users }}<li class="italic hover:font-bold">{{ .FirstName }}, {{ .Age }} years old</li>{{ end }}
</ul>
<div class="flex items-center justify-center!">
<table class="border border-separate table-fixed" style="max-width: 50%;">
<thead>
<tr>
<th>First name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
{{ range .Users }}
<tr>
<td>{{ .FirstName }}</td>
<td>{{ .Age }}</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
{{ end }}