Initial
This commit is contained in:
21
views/base.jet
Normal file
21
views/base.jet
Normal 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>
|
||||
18
views/index.jet
Normal file
18
views/index.jet
Normal file
@ -0,0 +1,18 @@
|
||||
{{ extends "./base.jet" }}
|
||||
{{ import "./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 }}
|
||||
15
views/table_component.jet
Normal file
15
views/table_component.jet
Normal 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 }}
|
||||
Reference in New Issue
Block a user