diff --git a/demo/src/main/java/com/example/demo/config/SecurityConfig.java b/demo/src/main/java/com/example/demo/config/SecurityConfig.java index ff2067d..0507a6a 100644 --- a/demo/src/main/java/com/example/demo/config/SecurityConfig.java +++ b/demo/src/main/java/com/example/demo/config/SecurityConfig.java @@ -18,12 +18,12 @@ public class SecurityConfig { public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests(auth -> auth - .requestMatchers("/login", "/css/**").permitAll() + .requestMatchers("/login", "/register", "/css/**", "/images/**").permitAll() .anyRequest().authenticated() ) .formLogin(form -> form .loginPage("/login") -// .defaultSuccessUrl("/", true) + .defaultSuccessUrl("/", true) .permitAll() ) .logout(logout -> logout.permitAll()); diff --git a/demo/src/main/java/com/example/demo/controller/SiteController.java b/demo/src/main/java/com/example/demo/controller/SiteController.java index f349c45..22fee15 100644 --- a/demo/src/main/java/com/example/demo/controller/SiteController.java +++ b/demo/src/main/java/com/example/demo/controller/SiteController.java @@ -1,15 +1,28 @@ package com.example.demo.controller; +import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; +import com.example.demo.service.RecipeService; +import com.example.demo.dto.RecipeDto; +import com.example.demo.entity.Recipe; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @Controller public class SiteController { + + private final RecipeService recipeService; + + public SiteController(RecipeService recipeService) { + this.recipeService = recipeService; + } @GetMapping("/") public String viewHomePage(Model model) { //model.addAttribute("allemplist", employeeServiceImpl.getAllEmployee()); + List recipes = recipeService.getAllRecipes(); + model.addAttribute("recipes", recipes); return "home"; } @@ -17,4 +30,9 @@ public class SiteController { public String viewLoginPage(Model model) { return "login"; } + + @GetMapping("/register") + public String viewRegisterPage(Model model) { + return "create-account"; + } } \ No newline at end of file diff --git a/demo/src/main/java/com/example/demo/service/Impl/RecipeServiceImpl.java b/demo/src/main/java/com/example/demo/service/Impl/RecipeServiceImpl.java index c223bae..fc86289 100644 --- a/demo/src/main/java/com/example/demo/service/Impl/RecipeServiceImpl.java +++ b/demo/src/main/java/com/example/demo/service/Impl/RecipeServiceImpl.java @@ -76,6 +76,7 @@ public class RecipeServiceImpl implements RecipeService { } @Override + @Transactional public RecipeDto saveRecipe(RecipeDto dto) { User user = userRepository.findById(dto.getUserDto().getId()) diff --git a/demo/src/main/resources/static/css/create-account.css b/demo/src/main/resources/static/css/create-account.css index b6df930..fc16cc7 100644 --- a/demo/src/main/resources/static/css/create-account.css +++ b/demo/src/main/resources/static/css/create-account.css @@ -74,7 +74,7 @@ body, html { } -.login-box rows { +.login-box .rows { display: flex; gap: 10px; align-items: center; diff --git a/demo/src/main/resources/templates/create-account.html b/demo/src/main/resources/templates/create-account.html index d1ff785..2d9afb6 100644 --- a/demo/src/main/resources/templates/create-account.html +++ b/demo/src/main/resources/templates/create-account.html @@ -1,50 +1,58 @@ +<<<<<<< HEAD Create Thyme Crunch Account +======= + + Create Thyme Crunch Account + +>>>>>>> 738c6970dde9507734a43ead0f3e9aadd5b41e23
+<<<<<<< HEAD Violin f-hole shape to the left of header.

Thyme Crunch

Violin f-hole shape to the right of header. +======= + Violin f-hole shape to the left of header. +

Thyme Crunch

+ Violin f-hole shape to the right of header. +
+>>>>>>> 738c6970dde9507734a43ead0f3e9aadd5b41e23 - - - -
- + + + +
diff --git a/demo/src/main/resources/templates/home.html b/demo/src/main/resources/templates/home.html index f4d6e65..7e9406c 100644 --- a/demo/src/main/resources/templates/home.html +++ b/demo/src/main/resources/templates/home.html @@ -1,21 +1,35 @@ +<<<<<<< HEAD Thyme Crunch Home +======= + + Thyme Crunch Home + +>>>>>>> 738c6970dde9507734a43ead0f3e9aadd5b41e23
+<<<<<<< HEAD Violin f-hole shape to the left of header.

Thyme Crunch

Violin f-hole shape to the right of header.
+======= + Violin f-hole shape to the left of header. +

Thyme Crunch

+ Violin f-hole shape to the right of header. + +>>>>>>> 738c6970dde9507734a43ead0f3e9aadd5b41e23 -
+
+ + + + Description of the icon + +>>>>>>> 738c6970dde9507734a43ead0f3e9aadd5b41e23
-
- -
-
-

-

-
-
- ${recipe.imageAltText} -

-
-
-
+
+
+
+

+

+
+
+
+ Recipe Image +
+
+
+
-
- -
- - +
diff --git a/demo/src/main/resources/templates/login.html b/demo/src/main/resources/templates/login.html index 989ce48..64eb148 100644 --- a/demo/src/main/resources/templates/login.html +++ b/demo/src/main/resources/templates/login.html @@ -7,10 +7,10 @@ -
- Violin f-hole shape to the left of header. +
+ Violin f-hole shape to the left of header.

Thyme Crunch

- Violin f-hole shape to the right of header. + Violin f-hole shape to the right of header.
@@ -33,9 +33,8 @@
-

OR SIGN UP FOR AN ACCOUNT

+

OR SIGN UP FOR AN ACCOUNT

- - +