summaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/index.html41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/templates/index.html b/src/templates/index.html
index 6b2f54a..683891c 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -11,28 +11,27 @@
</head>
<body>
<h1>Parts Catalog</h1>
+ {{#each makes}}
<form action="/parts">
- <ul>
- {{#each makes}}
- <li>
- <input type="submit" name="make" value="{{ this }}" />
- {{#if (eq this "Hudson")}}
- <ul>
- <input type="hidden" name="make" value="{{ selected_make }}" />
- {{#each models}}
- <li>
- <input type="submit" name="model" value="{{ this }}" />
- </li>
- {{else}}
- No models found.
- {{/each}}
- </ul>
- {{/if}}
- </li>
- {{else}}
- No makes found.
- {{/each}}
- </ul>
+ {{#if (eq this ../selected_make)}}
+ <input disabled type="submit" name="make" value="{{ this }}" />
+ <input type="hidden" name="make" value="{{ ../selected_make }}" />
+ {{#each ../models}}
+ {{#if (eq this ../../selected_model)}}
+ <input disabled type="submit" name="model" value="{{ this }}" />
+ Parts for {{ this }}
+ {{else}}
+ <input type="submit" name="model" value="{{ this }}" />
+ {{/if}}
+ {{else}}
+ No models found.
+ {{/each}}
+ {{else}}
+ <input type="submit" name="make" value="{{ this }}" />
+ {{/if}}
</form>
+ {{else}}
+ No makes found.
+ {{/each}}
</body>
</html>