Initial content
This commit is contained in:
@@ -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,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/bundle.js"></script>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
{{#if authenticated }}
|
||||
<div class="bg-primary text-white p-1 clearfix">
|
||||
<form method="post" action="/signout">
|
||||
<span class="h5">User: {{ user.username }}</span>
|
||||
<button class="btn btn-secondary btn-sm float-end"
|
||||
type="submit">Sign Out</button>
|
||||
</form>
|
||||
</div>
|
||||
{{else }}
|
||||
{{#unless signinpage }}
|
||||
<div class="bg-primary text-white p-1 clearfix">
|
||||
<a href="/signin"
|
||||
class="btn btn-secondary btn-sm float-end">Sign In</a>
|
||||
</div>
|
||||
{{/unless }}
|
||||
{{/if}}
|
||||
{{{ 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>
|
||||
@@ -0,0 +1,17 @@
|
||||
{{#if failed }}
|
||||
<h4 class="bg-danger text-white p-2 text-center">
|
||||
Authentication failed. Please try again.
|
||||
</h4>
|
||||
{{/if}}
|
||||
<form method="post">
|
||||
<div class="m-2">
|
||||
<label class="form-label">Name</label>
|
||||
<input name="username" class="form-control" value="{{ username }}"/>
|
||||
</div>
|
||||
<div class="m-2">
|
||||
<label class="form-label">Password</label>
|
||||
<input name="password" type="password" class="form-control"
|
||||
value="{{ password }}"/>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mx-2">Sign In</button>
|
||||
</form>
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="bg-danger text-white m-1 p-2">
|
||||
<div class="h2">Unauthorized</div>
|
||||
<div class="h4">
|
||||
You do not have permission to perform this operation
|
||||
</div>
|
||||
</div>
|
||||
<a href="/" class="btn btn-secondary mx-1">Back</a>
|
||||
Reference in New Issue
Block a user