summaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-02-23 17:37:08 -0500
committerAdam T. Carpenter <atc@53hor.net>2021-02-23 17:37:08 -0500
commit1259dad8d561bd390262314035d5252905d1c12e (patch)
treefb560349dfa27f8eb48fa76daa9cba90695d6540 /src/templates
parent76da278e446e06731ff0676778fa3c960238070e (diff)
downloadtwinh-1259dad8d561bd390262314035d5252905d1c12e.tar.xz
twinh-1259dad8d561bd390262314035d5252905d1c12e.zip
basic make/model/parts list flow functional
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>