Restructure app

This commit is contained in:
Eden Kirin
2023-10-23 23:05:18 +02:00
parent f0e323f2ce
commit 002f6a3d06
11 changed files with 250 additions and 10 deletions

View File

@ -0,0 +1,21 @@
{{ title := "Hello world" }}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container-fluid">
<h1>{{ title }}</h1>
<main>
{{ yield mainContent() }}
</main>
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
{{ block usersTable(users) }}
<p>blablabla</p>
<table class="table">
<tbody>
{{ range users }}
<tr>
<td>{{ .firstName }}</td>
<td>{{ .lastName }}</td>
<td>{{ .email }}</td>
</tr>
{{ end }}
</tbody>
</table>
{{ end }}

View File

@ -0,0 +1,18 @@
{{ extends "/base/base.jet" }}
{{ import "/components/table_component.jet" }}
{{ block mainContent() }}
{{ title = "Hello world from index" }}
<ul>
{{ range params1 }}
<li>{{ . }}</li>
{{ end }}
</ul>
<h3>{{ title }}</h3>
{{ yield usersTable(users=users) }}
{{ end }}