-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
91 lines (88 loc) · 4.22 KB
/
index.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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My Carnivorous Plant Terrarium</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<main>
<h1>My Carnivorous Plant Terrarium</h1>
<hr>
<section id="plot-container"></section>
<section class="add-plant-container" data-bind="template: { name: 'addPlantTemplate' }"></section>
<section id="plant-container" data-bind="template: { name: 'plantCollectionTemplate', data: $data.plantCollection }"></section>
<section class="legends">
<table>
<caption>Save State</caption>
<tbody>
<tr><td>◌</td><td>no changes from hardcoded data</td></tr>
<tr><td>◐</td><td>only local storage</td></tr>
<tr><td>◑</td><td>only db</td></tr>
<tr><td>◉</td><td>both local storage and db</td></tr>
</tbody>
</table>
</section>
<section class="add-plant-container" data-bind="template: { name: 'addPlantTemplate' }"></section>
</main>
</body>
</html>
<script type="text/template" id="plantCollectionTemplate">
<table class="plant-collection-table">
<thead>
<tr>
<td> </td>
<td class="id"> </td>
<td class="taxonomic-link"> </td>
<td class="taxon"> </td>
<td class="common-name"> </td>
<th colspan="3">Temperature Bounds <a>*</a></th>
<td class="crud"> </td>
</tr>
<tr>
<th class="save-state">Save State</th>
<th class="id" data-bind="click: function() { $data.sortBy('id') }">Individual Plant ID</th>
<th class="taxonomic-link" data-bind="click: function() { $data.sortBy('taxonomicLink') }">Taxonomic Link</th>
<th class="taxon" data-bind="click: function() { $data.sortBy('taxon') }">Taxon</th>
<th class="common-name" data-bind="click: function() { $data.sortBy('commonName') }">Common Name</th>
<td class="temperature">Temp</td>
<td class="humidity">Hum</td>
<td class="luminosity">Lum</td>
<td class="crud"> </td>
</tr>
</thead>
<tbody data-bind="foreach: $data.sortedPlants">
<tr>
<td class="save-state"><a data-bind="text: $data.saveStateIcon(), click: $data.sync()"></a></th>
<td class="id"><a data-bind="text: $data.id, attr: { href: 'plant-info/' + $data.id }"></a></td>
<td class="taxonomic-link"><a data-bind="text: $data.taxonomicLink"></a></td>
<td class="taxon" data-bind="text: $data.taxon"></td>
<td class="common-name" data-bind="text: $data.commonName"></td>
<td class="temperature" data-bind="text: $data.formattedTemperature"></td>
<td class="humidity" data-bind="text: $data.formattedHumidity"></td>
<td class="luminosity" data-bind="text: $data.formattedLuminosity"></td>
<td class="crud">
<a class="view" data-bind="attr: { href: 'plant-info/' + $data.id }">View</a>
</td>
</tr>
<!-- ko if: $data.sources -->
<tr>
<td colspan="2"> </td>
<td class="sources" colspan="4">
<ul data-bind="foreach: $data.plant.sources">
<li><a target="_blank" data-bind="attr: { href: $data.link }, text: $data.text"></a></li>
</ul>
</td>
</tr>
<!-- /ko -->
</tbody>
</table>
<p class="environment-note"><a>*</a> Temp is lower/higher ambient temperature. Some plants such as Darlingtonia californica need a different soil temperature than ambient temperature. In these cases it is soil temp and then ambient temp. A third temperature field is if extremes are mentioned. Humidity is lower/higher humidity. Luminosity is for the moment just the number of hours of light needed. When I find more literature for lower/upper bounds I will add this; as well as soil moisture, air flow, and pH.</p>
</script>
<script type="text/html" id="addPlantTemplate">
<a class="create" data-bind="click: $data.addPlant">Add Plant</a>
<input class="plant-id" placeholder="plant id" data-bind="textInput: $data.plantId">
<select class="taxon" data-bind="options: $data.taxonomyTree.validTaxons(), value: $data.plantTaxon"></select>
</script>
<script type="text/javascript" src="bundle.js"></script>
<script type="text/javascript" src="ga.js"></script>