ingredients, Type type) {
+ return ingredients.stream()
+ .filter(x -> x.getType()
+ .equals(type))
+ .collect(Collectors.toList());
+ }
+}
diff --git a/src/main/java/tacos/web/OrderController.java b/src/main/java/tacos/web/OrderController.java
new file mode 100644
index 0000000..e39985e
--- /dev/null
+++ b/src/main/java/tacos/web/OrderController.java
@@ -0,0 +1,35 @@
+package tacos.web;
+
+import javax.validation.Valid;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.validation.Errors;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import lombok.extern.slf4j.Slf4j;
+import tacos.Order;
+
+@Slf4j
+@Controller
+@RequestMapping("/orders")
+public class OrderController {
+
+ @GetMapping("/current")
+ public String orderForm(Model model) {
+ model.addAttribute("order", new Order());
+ return "orderForm";
+ }
+
+ @PostMapping
+ public String processOrder(@Valid Order order, Errors errors) {
+ if (errors.hasErrors()) {
+ return "orderForm";
+ }
+
+ log.info("Order submitted: " + order);
+ return "redirect:/";
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/tacos/web/WebConfig.java b/src/main/java/tacos/web/WebConfig.java
new file mode 100644
index 0000000..59d2b98
--- /dev/null
+++ b/src/main/java/tacos/web/WebConfig.java
@@ -0,0 +1,15 @@
+package tacos.web;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+
+ @Override
+ public void addViewControllers(ViewControllerRegistry registry) {
+ registry.addViewController("/")
+ .setViewName("home");
+ }
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
deleted file mode 100644
index 8b13789..0000000
--- a/src/main/resources/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
new file mode 100644
index 0000000..e69de29
diff --git a/src/main/resources/static/images/TacoCloud.png b/src/main/resources/static/images/TacoCloud.png
index ca7b00f..5d78239 100644
Binary files a/src/main/resources/static/images/TacoCloud.png and b/src/main/resources/static/images/TacoCloud.png differ
diff --git a/src/main/resources/static/styles.css b/src/main/resources/static/styles.css
new file mode 100644
index 0000000..a2eaa4e
--- /dev/null
+++ b/src/main/resources/static/styles.css
@@ -0,0 +1,29 @@
+div.ingredient-group:nth-child(odd) {
+ float: left;
+ padding-right: 20px;
+}
+
+div.ingredient-group:nth-child(even) {
+ float: left;
+ padding-right: 0;
+}
+
+div.ingredient-group {
+ width: 50%;
+}
+
+.grid:after {
+ content: "";
+ display: table;
+ clear: both;
+}
+
+*, *:after, *:before {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+span.validationError {
+ color: red;
+}
\ No newline at end of file
diff --git a/src/main/resources/templates/design.html b/src/main/resources/templates/design.html
new file mode 100644
index 0000000..0884c64
--- /dev/null
+++ b/src/main/resources/templates/design.html
@@ -0,0 +1,76 @@
+
+
+
+ Taco Cloud
+
+
+
+
+Design your taco!
+
+
+
+
+
diff --git a/src/main/resources/templates/home.html b/src/main/resources/templates/home.html
index a5ceb70..f4ae9d3 100644
--- a/src/main/resources/templates/home.html
+++ b/src/main/resources/templates/home.html
@@ -1,11 +1,14 @@
-
-
-
- Taco Cloud
-
-
- Welcome to...
-
-
+
+
+ Taco Cloud
+
+
+
+ Welcome to...
+
+
+ Design a taco
+
\ No newline at end of file
diff --git a/src/main/resources/templates/orderForm.html b/src/main/resources/templates/orderForm.html
new file mode 100644
index 0000000..77021bd
--- /dev/null
+++ b/src/main/resources/templates/orderForm.html
@@ -0,0 +1,85 @@
+
+
+
+ Taco Cloud
+
+
+
+
+
+
+
+
+
diff --git a/src/test/java/tacos/HomeControllerTest.java b/src/test/java/tacos/HomeControllerTest.java
deleted file mode 100644
index fa791c6..0000000
--- a/src/test/java/tacos/HomeControllerTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package tacos;
-
-import static org.hamcrest.Matchers.containsString;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.test.web.servlet.MockMvc;
-
-@RunWith(SpringRunner.class)
-@WebMvcTest(HomeController.class)
-public class HomeControllerTest {
- @Autowired
- private MockMvc mockMvc;
-
- @Test
- public void testHomePage() throws Exception {
- mockMvc.perform(get("/"))
- .andExpect(status().isOk())
- .andExpect(view().name("home"))
- .andExpect(content().string(containsString("Welcome to...")));
- }
-}
\ No newline at end of file