forked from trongthanh/family-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
book.html
43 lines (43 loc) · 1.27 KB
/
book.html
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
<html>
<head>
<script src="scripts/jquery-3.3.1.min.js"></script>
<script src="scripts/js-yaml.min.js"></script>
<script src="scripts/handlebars.min.js"></script>
<link rel="stylesheet" type="text/css" href="style/book.css">
</head>
<body>
<input type="text" id="search" placeholder="Find a person by name..."></input>
<h1></h1>
<p id="instructions"><em>Click on picture to expand children.</em></p>
<div id="tree">
</div>
<script id="person-template" type="text/x-handlebars-template">
<div class="person">
{{#if image}}
<img src="{{image}}">
{{else}}
<img src="images/placeholder{{#isFemale gender}}-female{{/isFemale}}.png">
{{/if}}
{{#if children}}
<span class="expand">+{{children.length}}</span>
{{/if}}
<div class="name-and-bio">
<h2 class="name">
{{#if english-name}}
{{english-name}}
{{else}}
{{name}}
{{/if}}
</h2>
<p class="bio">{{{bio}}}</p>
</div>
{{#each children}}
<div class="child">
{{> person}}
</div>
{{/each}}
</div>
</script>
<script src="scripts/book.js" type="text/javascript"></script>
</body>
</html>