forked from adobe/target-nodejs-sdk-samples
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.handlebars
68 lines (65 loc) · 2.31 KB
/
index.handlebars
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{pageTitle}}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="https://wwwimages2.adobe.com/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="style.css" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="container">
{{#if offer}}
<div class="py-5">
<h1>{{pageTitle}}</h1>
<p class="lead">Experience {{offer.experience}}</p>
<img src="{{offer.asset}}" class="rounded offer" />
</div>
{{/if}}
<div class="py-3">
<h2>Search</h2>
<form class="form-inline">
<div class="form-group mx-sm-3 mb-2">
<input class="form-control searchbox" type="text" placeholder="Search for {{search.domain}}…" name="search" value="{{search.result.term}}">
</div>
<button type="submit" class="btn btn-primary mb-2">Search</button>
</form>
{{#if search.result}}
<p><small>{{search.result.message}}</small></p>
<table class="table table-sm table-striped">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Gender</th>
<th scope="col">Birth Year</th>
</tr>
</thead>
<tbody>
{{#if search.result.list.length }}
{{#each search.result.list}}
<tr>
<td>{{this.name}}</td>
<td>{{this.gender}}</td>
<td>{{this.birth_year}}</td>
</tr>
{{/each}}
{{else}}
<tr><td colspan="999">No results.</td></tr>
{{/if}}
</tbody>
</table>
{{/if}}
</div>
<div class="py-3">
<h2>Flags</h2>
<pre id="result" {{#if error}}class="error"{{/if}}>{{flags}}</pre>
</div>
<div class="py-3" style="display: none">
<h2>Target Response</h2>
<pre id="result" {{#if error}}class="error"{{/if}}>{{targetResponse}}</pre>
</div>
</div>
</body>
</html>