summaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-02-22 17:22:41 -0500
committerAdam T. Carpenter <atc@53hor.net>2021-02-22 17:22:41 -0500
commit76da278e446e06731ff0676778fa3c960238070e (patch)
treeeeb7e058a6dd3bba31690f4a8c169d3c3581c137 /src/templates
parente58403f3b9c4c8686537c4716a6ed3f65ca48370 (diff)
downloadtwinh-76da278e446e06731ff0676778fa3c960238070e.tar.xz
twinh-76da278e446e06731ff0676778fa3c960238070e.zip
basic template, forms for browsing make/model started
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/index.html38
-rw-r--r--src/templates/mod.rs1
2 files changed, 34 insertions, 5 deletions
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>
diff --git a/src/templates/mod.rs b/src/templates/mod.rs
new file mode 100644
index 0000000..1a594fb
--- /dev/null
+++ b/src/templates/mod.rs
@@ -0,0 +1 @@
+pub static INDEX_T: &str = include_str!("index.html");