diff --git a/src/main/java/dev/araozu/jerguero/GreetingController.java b/src/main/java/dev/araozu/jerguero/GreetingController.java deleted file mode 100644 index 37018cc..0000000 --- a/src/main/java/dev/araozu/jerguero/GreetingController.java +++ /dev/null @@ -1,19 +0,0 @@ -package dev.araozu.jerguero; - -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; - -@Controller -public class GreetingController { - @GetMapping("/greeting") - public String greeting( - @RequestParam(name = "name", required = false, defaultValue = "World") String name, - Model model - ) { - model.addAttribute("name", name); - return "greeting"; - } -} diff --git a/src/main/java/dev/araozu/jerguero/controller/IndexController.java b/src/main/java/dev/araozu/jerguero/controller/IndexController.java new file mode 100644 index 0000000..bf2a239 --- /dev/null +++ b/src/main/java/dev/araozu/jerguero/controller/IndexController.java @@ -0,0 +1,17 @@ +package dev.araozu.jerguero.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +public class IndexController { + + @GetMapping("/") + public String index(Model model) { + model.addAttribute("time", System.currentTimeMillis()); + + return "views/index"; + } + +} diff --git a/src/main/java/dev/araozu/jerguero/controller/post/PostController.java b/src/main/java/dev/araozu/jerguero/controller/post/PostController.java index 7321212..54be709 100644 --- a/src/main/java/dev/araozu/jerguero/controller/post/PostController.java +++ b/src/main/java/dev/araozu/jerguero/controller/post/PostController.java @@ -1,11 +1,21 @@ package dev.araozu.jerguero.controller.post; +import dev.araozu.jerguero.model.Post; +import dev.araozu.jerguero.model.PostRepository; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; @Controller public class PostController { + + PostRepository postRepository; + + public PostController(PostRepository postRepository) { + this.postRepository = postRepository; + } + @GetMapping("/crear") public String createEntry() { return "post/create"; @@ -22,13 +32,11 @@ public class PostController { @RequestParam("definition-content") String content, Model model ) { + postRepository.save(new Post(title, content)); + model.addAttribute("title", title); model.addAttribute("content", content); return "post/create_result"; } } - -class PostInfo { - -} diff --git a/src/main/resources/frontend/main.css b/src/main/resources/frontend/main.css index 8020105..1e6ec72 100644 --- a/src/main/resources/frontend/main.css +++ b/src/main/resources/frontend/main.css @@ -8,6 +8,7 @@ --chicha-yellow: #ffff00; --chicha-orange: #ffaa00; --chicha-pink: #ff007a; + --gray-1: #9ca3af; } /* Dark theme by default */ @@ -21,6 +22,7 @@ :root { --c-bg: white; --c-on-bg: black; + --c-outline: var(--gray-1); } } diff --git a/src/main/resources/frontend/tailwind.config.js b/src/main/resources/frontend/tailwind.config.js index 24f2604..3df0757 100644 --- a/src/main/resources/frontend/tailwind.config.js +++ b/src/main/resources/frontend/tailwind.config.js @@ -5,11 +5,7 @@ module.exports = { "../static/**/*.{html,js}", ], theme: { - extend: { - fontFamily: { - "mono": ["Iosevka", "monospace"], - } - }, + extend: {}, colors: { "c-bg": "var(--c-bg)", "c-on-bg": "var(--c-on-bg)", @@ -17,10 +13,13 @@ module.exports = { "c-chicha-pink": "var(--chicha-pink)", "c-chicha-yellow": "var(--chicha-yellow)", "c-chicha-orange": "var(--chicha-orange)", + "c-outline": "var(--c-outline)", }, fontFamily: { "chicha": ["Lobster", "serif"], "rubik": ["Rubik", "sans-serif"], + "vina-sans": ["Vina Sans", "sans-serif"], + "mono": ["Iosevka", "monospace"], } }, plugins: [], diff --git a/src/main/resources/templates/fragments/definition.html b/src/main/resources/templates/fragments/definition.html new file mode 100644 index 0000000..cb07b08 --- /dev/null +++ b/src/main/resources/templates/fragments/definition.html @@ -0,0 +1,43 @@ +
+

+ Palta +

+ +
+ + Usado en: + +
+ + 🇵🇪 + + + 🇨🇱 + +
+ +

+ - Problema, dificultad, obstáculo. +
+ Esa ya no es mi palta causita +

+

+ - Otro nombre para "Aguacate" +
+ Corre a la tienda y compra 1 kilo de palta +

+ + +
+ + Creado por: + +
+ + + pablito de los backyardigans + + +
+
diff --git a/src/main/resources/templates/fragments/navbar.html b/src/main/resources/templates/fragments/navbar.html index 419f5d0..38823f8 100644 --- a/src/main/resources/templates/fragments/navbar.html +++ b/src/main/resources/templates/fragments/navbar.html @@ -1,9 +1,23 @@ diff --git a/src/main/resources/templates/greeting.html b/src/main/resources/templates/greeting.html deleted file mode 100644 index a1505af..0000000 --- a/src/main/resources/templates/greeting.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Jerguero - - - - - -
-

-

- still a piece of garbage -

-
- - - - - - diff --git a/src/main/resources/static/index.html b/src/main/resources/templates/views/index.html similarity index 85% rename from src/main/resources/static/index.html rename to src/main/resources/templates/views/index.html index 73e0527..e829d2b 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/templates/views/index.html @@ -8,11 +8,11 @@ Jerguero - + - + @@ -34,6 +34,8 @@ carita feliz :D +
+