summaryrefslogtreecommitdiff
path: root/src/templates/index.hbs
blob: 6bd539b8cffe900048271b533f35bdcd403510af (plain) (blame)
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
{{#> base}}
{{#*inline "navItem"}}
<li>
	<div class="menuToggle">
		<a class="openMenu" href="#"><span>
				<svg style="width: 24px; height: 24px" viewBox="0 0 24 24">
					<path fill="currentColor" d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
				</svg>
			</span></a>
		<a class="closeMenu" href="#hidden"><span>
				<svg style="width: 24px; height: 24px" viewBox="0 0 24 24">
					<path fill="currentColor"
						d="M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z" />
				</svg>
			</span></a>
	</div>
</li>
{{/inline}}
{{#*inline "body"}}
<nav class="sidebar">
	{{#each makes}}
	<form action="/">
		{{#if (eq this ../selected_make)}}
		<button disabled class="make">
			{{ this }}
		</button>
		<input type="hidden" name="make" value="{{ ../selected_make }}" />
		{{#each ../models}}
		{{#if (eq this ../../selected_model)}}
		<button disabled class="model">{{~ this ~}}</button>
		{{else}}
		<button class="model" name="model" value="{{ this }}">
			{{~ this ~}}
		</button>
		{{/if}}
		{{else}}
		<button disabled class="model">(No models found)</button>
		{{/each}}
		{{else}}
		<button class="make" name="make" value="{{ this }}">
			{{~ this ~}}
		</button>
		{{/if}}
	</form>
	{{else}}
	<button disabled class="make">(No makes found)</button>
	{{/each}}
</nav>

<section>
	<form>
		{{#if selected_make}}
		<input type="hidden" name="make" value="{{ selected_make }}" />
		{{/if}}
		{{#if selected_model}}
		<input type="hidden" name="model" value="{{ selected_model }}" />
		{{/if}}
		<input autofocus type="search" name="search" placeholder="hit enter to search" />
	</form>
</section>

<section>
	<table class="catalogTable">
		<tbody>
			{{#each parts}}
			<tr>
				<td>{{ this }}</td>
			</tr>
			{{/each}}
		</tbody>
	</table>
</section>
{{/inline}}
{{/base}}