Initial content

This commit is contained in:
Adam Freeman
2024-05-29 18:54:49 +01:00
parent 2dbc1a8088
commit 5215a1d919
1944 changed files with 203378 additions and 0 deletions
@@ -0,0 +1,37 @@
<div class="container fluid">
<div class="row">
<div class="col-7">
{{#if name}}
<div class="m-2">
<h4>Hello {{ name }}. You will be {{ nextage }}
in {{ years }} years.</h4>
</div>
{{/if}}
<div>
<form id="age_form" action="/form" method="post">
<div class="m-2">
<label class="form-label">Name</label>
<input name="name" class="form-control"
value="{{ name }}"/>
</div>
<div class="m-2">
<label class="form-label">Current Age</label>
<input name="age" class="form-control"
value="{{ age }}" />
</div>
<div class="m-2">
<label class="form-label">Number of Years</label>
<input name="years" class="form-control"
value="{{ years }}" />
</div>
<div class="m-2">
<button class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
<div class="col-5">
{{> history }}
</div>
</div>
</div>
@@ -0,0 +1,37 @@
<form class="m-2">
<table class="table table-sm table-striped">
<thead>
<tr>
<th>ID</th><th>Name</th><th>Age</th><th>Years</th>
<th>Next Age</th><th></th>
</tr>
</thead>
<tbody>
{{#unless data }}<tr><td colspan="5">No Data</td></tr>{{/unless }}
{{#each data }}
<tr>
<td>{{ this.id }} </td>
<td>{{ this.name }} </td>
<td>{{ this.age }} </td>
<td>{{ this.years }} </td>
<td>{{ this.nextage }} </td>
<td>
<button class="btn btn-danger btn-sm"
formmethod="post"
formaction="/form/delete/{{this.id}}">
Delete
</button>
</td>
</tr>
{{/each }}
</tbody>
</table>
<button class="btn btn-primary"
formmethod="post"
formaction="/form/add">
Add
</button>
<input type="hidden" name="name" value="Alice" />
<input type="hidden" name="age" value="40" />
<input type="hidden" name="years" value="10" />
</form>
@@ -0,0 +1,10 @@
<table class="table table-sm table-striped">
<thead>
<tr><th>Field</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td>Name:</td><td>{{ name }} </td></tr>
<tr><td>City:</td><td>{{ city }} </td></tr>
<tr><td>File:</td><td>{{ fileData }} </td></tr>
</tbody>
</table>
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<script src="/bundle.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
{{{ body }}}
</body>
</html>
@@ -0,0 +1,3 @@
<h4 class="bg-secondary text-white m-2 p-2">
Handlebars Even value: {{ valueOrZero req.query.c }}
</h4>
@@ -0,0 +1,36 @@
{{#if personalHistory }}
<h4>Your History</h4>
<table class="table table-sm table-striped my-2">
{{#each personalHistory }}
<tr>
<td>{{ this.name }} </td>
<td>{{ this.age }} </td>
<td>{{ this.years }} </td>
<td>{{ this.nextage }} </td>
</tr>
{{/each }}
</table>
{{/if }}
<h4>Recent Queries</h4>
<table class="table table-sm table-striped my-2">
<thead>
<tr>
<th>Name</th><th>Age</th><th>Years</th><th>Result</th>
</tr>
</thead>
<tbody>
{{#unless history }}
<tr><td colspan="4">No data available</td></tr>
{{/unless }}
{{#each history }}
<tr>
<td>{{ this.name }} </td>
<td>{{ this.age }} </td>
<td>{{ this.years }} </td>
<td>{{ this.nextage }} </td>
</tr>
{{/each }}
</tbody>
</table>
@@ -0,0 +1,3 @@
<h4 class="bg-primary text-white m-2 p-2">
Handlebars Odd value: {{ valueOrZero req.query.c}}
</h4>