From 76da278e446e06731ff0676778fa3c960238070e Mon Sep 17 00:00:00 2001
From: "Adam T. Carpenter" <atc@53hor.net>
Date: Mon, 22 Feb 2021 17:22:41 -0500
Subject: basic template, forms for browsing make/model started

---
 src/templates/index.html | 38 +++++++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 5 deletions(-)

(limited to 'src/templates/index.html')

diff --git a/src/templates/index.html b/src/templates/index.html
index 7b6070c..6b2f54a 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -1,10 +1,38 @@
 <!DOCTYPE html>
 <html>
+  <head>
+    <meta charset="UTF-8" />
+
+    <style>
+      input[type="submit"] {
+        display: block;
+      }
+    </style>
+  </head>
   <body>
-    <ul>
-      <li>Essex</li>
-      <li>Hudson</li>
-      <li>Terraplane</li>
-    </ul>
+    <h1>Parts Catalog</h1>
+    <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>
+    </form>
   </body>
 </html>
-- 
cgit v1.2.3