diff --git a/src/main/kotlin/com/s3ai/corporate_app2/controllers/CinemasController.kt b/src/main/kotlin/com/s3ai/corporate_app2/controllers/CinemasController.kt index 50729cb63a01863a8ccd6f022be263f506a9dcb8..7d6f4a938ff4621c66f54926ffab3b310bb9d2b4 100644 --- a/src/main/kotlin/com/s3ai/corporate_app2/controllers/CinemasController.kt +++ b/src/main/kotlin/com/s3ai/corporate_app2/controllers/CinemasController.kt @@ -5,9 +5,8 @@ import com.s3ai.corporate_app2.CinemaService import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Controller import org.springframework.ui.Model -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.* +import org.springframework.web.servlet.view.RedirectView import java.util.UUID.fromString import java.util.UUID.randomUUID @@ -29,10 +28,18 @@ class CinemasController { if (id.isEmpty()) { cinema = Cinema() cinema.id = randomUUID() + model.addAttribute("action", "Create") } else { cinema = cinemaService.findById(fromString(id)) + model.addAttribute("action", "Edit") } model.addAttribute("cinema", cinema) return "cinemas/edit" } + + @PostMapping("/update") + fun updateCinema(@ModelAttribute cinema: Cinema): RedirectView { + cinemaService.save(cinema) + return RedirectView("/cinemas/list") + } } \ No newline at end of file diff --git a/src/main/kotlin/com/s3ai/corporate_app2/controllers/TicketsController.kt b/src/main/kotlin/com/s3ai/corporate_app2/controllers/TicketsController.kt index 01c85f0bbfdd87d58aa9c465c7c0390ac82add9b..9949bd55a40a9262bffd97a70370ad11a327606d 100644 --- a/src/main/kotlin/com/s3ai/corporate_app2/controllers/TicketsController.kt +++ b/src/main/kotlin/com/s3ai/corporate_app2/controllers/TicketsController.kt @@ -1,13 +1,14 @@ package com.s3ai.corporate_app2.controllers; +import com.s3ai.corporate_app2.CinemaService import com.s3ai.corporate_app2.Ticket import com.s3ai.corporate_app2.TicketService +import com.s3ai.corporate_app2.UserService import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Controller import org.springframework.ui.Model -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.* +import org.springframework.web.servlet.view.RedirectView import java.util.* @Controller @@ -15,6 +16,10 @@ import java.util.* class TicketsController { @Autowired lateinit var ticketService: TicketService + @Autowired + lateinit var userService: UserService + @Autowired + lateinit var cinemaService: CinemaService @GetMapping("/list") fun getTicketsBrowsePage(model: Model): String? { @@ -28,10 +33,21 @@ class TicketsController { if (id.isEmpty()) { ticket = Ticket() ticket.id = UUID.randomUUID() + model.addAttribute("action", "Create") } else { ticket = ticketService.findById(UUID.fromString(id)) + model.addAttribute("action", "Edit") } model.addAttribute("ticket", ticket) + model.addAttribute("users", userService.findAll()) + model.addAttribute("cinemas", cinemaService.findAll()) return "tickets/edit" } + + @PostMapping("/update") + fun updateCinema(@ModelAttribute ticket: Ticket): RedirectView { + ticketService.save(ticket) + return RedirectView("/tickets/list") + } + } diff --git a/src/main/kotlin/com/s3ai/corporate_app2/controllers/UsersController.kt b/src/main/kotlin/com/s3ai/corporate_app2/controllers/UsersController.kt index e77ba34422e483847f9cfe08c378e8585d0248ad..7a86adc52a63ad1dfa3221a80ffc5acf72c50dec 100644 --- a/src/main/kotlin/com/s3ai/corporate_app2/controllers/UsersController.kt +++ b/src/main/kotlin/com/s3ai/corporate_app2/controllers/UsersController.kt @@ -5,9 +5,8 @@ import com.s3ai.corporate_app2.UserService import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Controller import org.springframework.ui.Model -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.* +import org.springframework.web.servlet.view.RedirectView import java.util.* @Controller @@ -28,10 +27,18 @@ class UsersController { if (id.isEmpty()) { user = User() user.id = UUID.randomUUID() + model.addAttribute("action", "Create") } else { user = userService.findById(UUID.fromString(id)) + model.addAttribute("action", "Edit") } model.addAttribute("user", user) return "users/edit" } + + @PostMapping("/update") + fun updateCinema(@ModelAttribute user: User): RedirectView { + userService.save(user) + return RedirectView("/users/list") + } } \ No newline at end of file diff --git a/src/main/resources/static/coffee/cinemas.coffee b/src/main/resources/static/coffee/cinemas.coffee index 0d9d412e0f37c3527e8a03bacb17f85aca004fdb..1bfc976f7858b3c65534856153b83e817b6c6dab 100644 --- a/src/main/resources/static/coffee/cinemas.coffee +++ b/src/main/resources/static/coffee/cinemas.coffee @@ -10,7 +10,7 @@ fill_modal = (event) -> hrefToEdit = (event) -> cinema_id = $("#modal_id").text() - window.location.replace "#{context_url}/cinema/?id=#{cinema_id}" + window.location.replace "/cinemas/edit?id=#{cinema_id}" removeCinema = (event) -> cinema_id = $("#modal_id").text() diff --git a/src/main/resources/static/css/index.css b/src/main/resources/static/css/index.css index 0d8791aa278c2eebbf7a3f654016ea9d3fecbd08..79b008c550bff37ac8c7db2abae76b27120068cc 100644 --- a/src/main/resources/static/css/index.css +++ b/src/main/resources/static/css/index.css @@ -1 +1 @@ -.projects-section{padding:10rem 0;background:linear-gradient(to top, #161616 0%, rgba(22, 22, 22, 0.9) 75%, rgba(22, 22, 22, 0.8) 100%)}.projects-section .featured-text{padding:2rem}@media(min-width: 992px){.projects-section .featured-text{padding:0 0 0 2rem;border-left:.5rem solid #64a19d}}.projects-section .project-text{padding:3rem;font-size:90%}@media(min-width: 992px){.projects-section .project-text{padding:5rem}.projects-section .project-text hr{border-color:#64a19d;border-width:.25rem;width:30%}}.masthead{object-fit:cover !important;text-align:center !important;background-repeat:no-repeat !important;background-attachment:fixed !important;background-position:center !important}.masthead .white{color:#fff}.hide-y{overflow-y:hidden}.landing-info-row{height:100px}.landing-info-row .landing-info-image{height:100px;object-fit:cover;width:100%;text-align:center;background-repeat:no-repeat;background-attachment:fixed;background-position:center}.masthead{position:relative;width:100%;height:auto;min-height:35rem;padding:15rem 0;background-position:center;background-repeat:no-repeat;background-attachment:scroll;background-size:cover}.masthead h1{font-family:"Varela Round";font-size:2.5rem;line-height:2.5rem;letter-spacing:.8rem;background:-webkit-linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));-webkit-text-fill-color:transparent;-webkit-background-clip:text}.masthead h2{max-width:20rem;font-size:1rem}@media(min-width: 768px){.masthead h1{font-size:4rem;line-height:4rem}}@media(min-width: 992px){.masthead{height:100vh;padding:0}.masthead h1{font-size:6.5rem;line-height:6.5rem;letter-spacing:.8rem}.masthead h2{max-width:30rem;font-size:1.25rem}}.contact-section{padding:5rem 0 0}.contact-section .card{border:0;border-bottom:.25rem solid #64a19d}.contact-section .card h4{font-size:.8rem;font-family:"Varela Round";text-transform:uppercase;letter-spacing:.15rem}.contact-section .card hr{border-color:#64a19d;border-width:.25rem;width:3rem}.contact-section .social{margin-top:5rem}.contact-section .social a{text-align:center;height:3rem;width:3rem;background:rgba(255,255,255,.1);border-radius:100%;line-height:3rem;color:rgba(255,255,255,.3)}.contact-section .social a:hover{color:rgba(255,255,255,.5)}.contact-section .social a:active{color:#fff}.btn{box-shadow:0 .1875rem .1875rem 0 rgba(0,0,0,.1) !important;padding:1.25rem 2rem;font-family:"Varela Round";font-size:80%;text-transform:uppercase;letter-spacing:.15rem;border:0}.btn-primary{background-color:#64a19d}.btn-primary:hover{background-color:#4f837f}.btn-primary:focus{background-color:#4f837f;color:#fff}.btn-primary:active{background-color:#467370 !important}.about-section{padding-top:10rem;background:linear-gradient(to bottom, #161616 0%, rgba(22, 22, 22, 0.9) 75%, rgba(22, 22, 22, 0.8) 100%)}.about-section p{margin-bottom:5rem}/*# sourceMappingURL=index.css.map */ +.index-gradient{background:linear-gradient(to bottom, #283048 0%, #859398 100%)}.projects-section{padding:10rem 0}.projects-section .featured-text{padding:2rem}@media(min-width: 992px){.projects-section .featured-text{padding:0 0 0 2rem;border-left:.5rem solid #64a19d}}.projects-section .project-text{padding:3rem;font-size:90%}@media(min-width: 992px){.projects-section .project-text{padding:5rem}.projects-section .project-text hr{border-color:#64a19d;border-width:.25rem;width:30%}}.masthead{object-fit:cover !important;text-align:center !important;background-repeat:no-repeat !important;background-attachment:fixed !important;background-position:center !important}.masthead .white{color:#fff}.hide-y{overflow-y:hidden}.landing-info-row{height:100px}.landing-info-row .landing-info-image{height:100px;object-fit:cover;width:100%;text-align:center;background-repeat:no-repeat;background-attachment:fixed;background-position:center}.masthead{position:relative;width:100%;height:auto;min-height:35rem;padding:15rem 0;background-position:center;background-repeat:no-repeat;background-attachment:scroll;background-size:cover}.masthead h1{font-family:"Varela Round";font-size:2.5rem;line-height:2.5rem;letter-spacing:.8rem;background:-webkit-linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));-webkit-text-fill-color:transparent;-webkit-background-clip:text}.masthead h2{max-width:20rem;font-size:1rem}@media(min-width: 768px){.masthead h1{font-size:4rem;line-height:4rem}}@media(min-width: 992px){.masthead{height:100vh;padding:0}.masthead h1{font-size:6.5rem;line-height:6.5rem;letter-spacing:.8rem}.masthead h2{max-width:30rem;font-size:1.25rem}}.contact-section{padding:5rem 0 0}.contact-section .card{border:0;border-bottom:.25rem solid #64a19d}.contact-section .card h4{font-size:.8rem;font-family:"Varela Round";text-transform:uppercase;letter-spacing:.15rem}.contact-section .card hr{border-color:#64a19d;border-width:.25rem;width:3rem}.contact-section .social{margin-top:5rem}.contact-section .social a{text-align:center;height:3rem;width:3rem;background:rgba(255,255,255,.1);border-radius:100%;line-height:3rem;color:rgba(255,255,255,.3)}.contact-section .social a:hover{color:rgba(255,255,255,.5)}.contact-section .social a:active{color:#fff}.btn{box-shadow:0 .1875rem .1875rem 0 rgba(0,0,0,.1) !important;padding:1.25rem 2rem;font-family:"Varela Round";font-size:80%;text-transform:uppercase;letter-spacing:.15rem;border:0}.btn-primary{background-color:#64a19d}.btn-primary:hover{background-color:#4f837f}.btn-primary:focus{background-color:#4f837f;color:#fff}.btn-primary:active{background-color:#467370 !important}.about-section{padding-top:10rem}.about-section p{margin-bottom:5rem}/*# sourceMappingURL=index.css.map */ diff --git a/src/main/resources/static/css/index.css.map b/src/main/resources/static/css/index.css.map index f94fd252f1eb925e65c4561e0e865d903de7cdd3..9ac3852f1b4d1977e141e9a81bcddcabe1af39ee 100644 --- a/src/main/resources/static/css/index.css.map +++ b/src/main/resources/static/css/index.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../scss/index.scss","../scss/_variables.scss"],"names":[],"mappings":"AAEA,kBACE,gBACA,sGAEA,iCACE,aACA,yBAFF,iCAGI,mBACA,iCAIJ,gCACE,aACA,cACA,yBAHF,gCAII,aACA,mCACE,aCRE,QDSF,oBACA,WAOR,UACE,4BACA,6BACA,uCACA,uCACA,sCAEA,iBACE,WAKJ,QACE,kBAGF,kBACE,aAEA,sCACE,aACA,iBACA,WACA,kBACA,4BACA,4BACA,2BAIJ,UACE,kBACA,WACA,YACA,iBACA,gBACA,2BACA,4BACA,6BACA,sBAEA,aACE,2BACA,iBACA,mBACA,qBACA,qFACA,oCACA,6BAGF,aACE,gBACA,eAGF,yBACE,aACE,eACA,kBAGJ,yBAhCF,UAiCI,aACA,UACA,aACE,iBACA,mBACA,qBAEF,aACE,gBACA,mBAKN,iBACE,iBAEA,uBACE,SACA,mCAEA,0BACE,gBACA,2BACA,yBACA,sBAGF,0BACE,aC9GI,QD+GJ,oBACA,WAIJ,yBACE,gBAEA,2BACE,kBACA,YACA,WACA,gCACA,mBACA,iBACA,2BAEA,iCACE,2BAGF,kCACE,MCjJA,KDuJR,KACE,2DACA,qBACA,2BACA,cACA,yBACA,sBACA,SAGF,aACE,iBCtJQ,QDwJR,mBACE,yBAGF,mBACE,yBACA,WAGF,oBACE,oCAIJ,eACE,kBACA,yGAEA,iBACE","file":"index.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../scss/index.scss","../scss/_variables.scss"],"names":[],"mappings":"AAEA,gBACE,gEAGF,kBACE,gBAEA,iCACE,aACA,yBAFF,iCAGI,mBACA,iCAIJ,gCACE,aACA,cACA,yBAHF,gCAII,aACA,mCACE,aCXE,QDYF,oBACA,WAOR,UACE,4BACA,6BACA,uCACA,uCACA,sCAEA,iBACE,WAKJ,QACE,kBAGF,kBACE,aAEA,sCACE,aACA,iBACA,WACA,kBACA,4BACA,4BACA,2BAIJ,UACE,kBACA,WACA,YACA,iBACA,gBACA,2BACA,4BACA,6BACA,sBAEA,aACE,2BACA,iBACA,mBACA,qBACA,qFACA,oCACA,6BAGF,aACE,gBACA,eAGF,yBACE,aACE,eACA,kBAGJ,yBAhCF,UAiCI,aACA,UACA,aACE,iBACA,mBACA,qBAEF,aACE,gBACA,mBAKN,iBACE,iBAEA,uBACE,SACA,mCAEA,0BACE,gBACA,2BACA,yBACA,sBAGF,0BACE,aCjHI,QDkHJ,oBACA,WAIJ,yBACE,gBAEA,2BACE,kBACA,YACA,WACA,gCACA,mBACA,iBACA,2BAEA,iCACE,2BAGF,kCACE,MCpJA,KD0JR,KACE,2DACA,qBACA,2BACA,cACA,yBACA,sBACA,SAGF,aACE,iBCzJQ,QD2JR,mBACE,yBAGF,mBACE,yBACA,WAGF,oBACE,oCAIJ,eACE,kBAEA,iBACE","file":"index.css"} \ No newline at end of file diff --git a/src/main/resources/static/js/cinemas.js b/src/main/resources/static/js/cinemas.js index 127a899270bf962fbb6094c26fd6ea959b2ef400..09e31cbaae521b51fd8b75ed26f92a466660cf81 100644 --- a/src/main/resources/static/js/cinemas.js +++ b/src/main/resources/static/js/cinemas.js @@ -18,7 +18,7 @@ hrefToEdit = function(event) { var cinema_id; cinema_id = $("#modal_id").text(); - return window.location.replace(`${context_url}/cinema/?id=${cinema_id}`); + return window.location.replace(`/cinemas/edit?id=${cinema_id}`); }; removeCinema = function(event) { diff --git a/src/main/resources/static/scss/index.scss b/src/main/resources/static/scss/index.scss index 3e5d20116f7c568be6ec380feb282823fbf17cc8..df6e51780e4d1801df654d68371a509334e2e200 100644 --- a/src/main/resources/static/scss/index.scss +++ b/src/main/resources/static/scss/index.scss @@ -1,8 +1,11 @@ @import "variables"; +.index-gradient { + background: linear-gradient(to bottom, #283048 0%, #859398 100%); +} + .projects-section { padding: 10rem 0; - background: linear-gradient(to top, $black 0%, #{fade-out($black, .1)} 75%, #{fade-out($black, .2)} 100%); .featured-text { padding: 2rem; @@ -178,7 +181,6 @@ .about-section { padding-top: 10rem; - background: linear-gradient(to bottom, $black 0%, #{fade-out($black, .1)} 75%, #{fade-out($black, .2)} 100%); p { margin-bottom: 5rem; diff --git a/src/main/resources/templates/cinemas/edit.html b/src/main/resources/templates/cinemas/edit.html index 3ed52e3b8424d5298e876982c6d502e87da45db6..2607fe439dfa7c354ebc5cc51d43ca6057fb616c 100644 --- a/src/main/resources/templates/cinemas/edit.html +++ b/src/main/resources/templates/cinemas/edit.html @@ -1,10 +1,77 @@ -<!DOCTYPE html> -<html lang="en"> +<html xmlns:th="http://www.thymeleaf.org"> <head> - <meta charset="UTF-8"> - <title>Cinema edit</title> + <title>Edit cinema</title> + <head th:include="commons/imports"></head> + <link rel="stylesheet" href="/css/cinemas.css"> + <script src="/js/cinemas.js"></script> </head> -<body> -Editing +<body class="themed-gradient"> + +<!-- Navigation --> +<body th:include="commons/header"></body> + +<div class="editing"> + <div class="container justify-content-center"> + + <form id="cinemaForm" class="d-flex justify-content-center" th:object="${cinema}" method="post" action="/cinemas/update"> + <fieldset> + + <legend> + <div class="text-center"><h2><b class="white" th:text="${action} + ' cinema'"></b></h2></div> + </legend> + <br> + <input type="hidden" name="id" th:field="*{id}"> + + <div class="form-group"> + <div class="inputGroupContainer"> + <div class="input-group"> + <div class="input-group-prepend"> + <div class="input-group-text"><i class="fas fa-align-left"></i></div> + </div> + <input type="text" + class="form-control validate" + id="cinemaName" + name="name" + placeholder="Cinema's name" th:field="*{name}" required> + </div> + </div> + </div> + <div class="form-group"> + <div class="inputGroupContainer"> + <div class="input-group"> + <div class="input-group-prepend"> + <div class="input-group-text"><i class="fas fa-chair"></i></div> + </div> + <input type="number" + class="form-control validate" + id="cinemaSeats" + name="seatsCount" + placeholder="Cinema's seats count" + th:field="*{seatsCount}" required> + </div> + </div> + </div> + <div class="form-group"> + <div class="inputGroupContainer"> + <div class="input-group"> + <div class="input-group-prepend"> + <div class="input-group-text"><i class="fas fa-globe-americas"></i></div> + </div> + <input type="text" + class="form-control validate" + id="cinemaLocation" + name="location" + placeholder="Cinema's location" + th:field="*{location}" required> + </div> + </div> + </div> + <div class="justify-content-center"> + <button type="submit" class="btn btn-primary w-100"><i class="fas fa-check"></i>Submit</button> + </div> + </fieldset> + </form> + </div> +</div> </body> -</html> \ No newline at end of file +</html> diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 9a98bb81fdee4961596fcdd4a5bea82985653feb..119d32b32265537faec8f5577c97b2e52edad740 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -21,80 +21,85 @@ </div> </header> -<!-- About Section --> -<section id="about" class="about-section text-center"> - <div class="container"> - <div class="row"> - <div class="col-lg-8 mx-auto"> - <h2 class="text-white mb-4">Built for Cinema lovers from Cinema lovers</h2> - <p class="text-white-50">Grayscale is a free Bootstrap theme created by Start Bootstrap. It can be yours - right now, simply download the template on - <a href="http://startbootstrap.com/template-overviews/grayscale/">the preview page</a>. The theme is - open source, and you can use it for any purpose, personal or commercial.</p> +<div class="index-gradient"> + <!-- About Section --> + <section id="about" class="about-section text-center"> + <div class="container"> + <div class="row"> + <div class="col-lg-8 mx-auto"> + <h2 class="text-white mb-4">Built for Cinema lovers from Cinema lovers</h2> + <p class="text-white-50">Grayscale is a free Bootstrap theme created by Start Bootstrap. It can be + yours + right now, simply download the template on + <a href="http://startbootstrap.com/template-overviews/grayscale/">the preview page</a>. The + theme is + open source, and you can use it for any purpose, personal or commercial.</p> + </div> </div> </div> - </div> -</section> + </section> -<!-- Projects Section --> -<section id="projects" class="projects-section pt-3 pb-3"> - <div class="container"> + <!-- Projects Section --> + <section id="projects" class="projects-section pt-3 pb-3"> + <div class="container"> - <!-- Featured Project Row --> - <div class="row align-items-center no-gutters mb-4 mb-lg-5 landing-info-row"> - <div class="col-xl-8 col-lg-7"> - <img class="img-fluid mb-3 mb-lg-0 landing-info-image pr-3" - src="/images/landing_tickets.jpg" alt=""> - </div> - <div class="col-xl-4 col-lg-5"> - <div class="featured-text text-center text-lg-left"> - <h4 class="text-white">Tickets management</h4> - <p class="text-white-50 mb-0">Manage your tickets with our self-hosted solution and make your - business profitable.</p> + <!-- Featured Project Row --> + <div class="row align-items-center no-gutters mb-4 mb-lg-5 landing-info-row"> + <div class="col-xl-8 col-lg-7"> + <img class="img-fluid mb-3 mb-lg-0 landing-info-image pr-3" + src="/images/landing_tickets.jpg" alt=""> + </div> + <div class="col-xl-4 col-lg-5"> + <div class="featured-text text-center text-lg-left"> + <h4 class="text-white">Tickets management</h4> + <p class="text-white-50 mb-0">Manage your tickets with our self-hosted solution and make your + business profitable.</p> + </div> </div> </div> - </div> - <!-- Project One Row --> - <div class="row justify-content-center no-gutters mb-5 mb-lg-0"> - <div class="col-lg-6"> - <img class="img-fluid landing-info-image pr-3" - src="/images/landing_cinemas.jpg" alt=""> - </div> - <div class="col-lg-6"> - <div class="bg-black text-center h-100 project"> - <div class="d-flex h-100"> - <div class="project-text w-100 my-auto text-center text-lg-left"> - <h4 class="text-white">Cinemas management</h4> - <p class="mb-0 text-white-50">Manage your remotely</p> + <!-- Project One Row --> + <div class="row justify-content-center no-gutters mb-5 mb-lg-0"> + <div class="col-lg-6"> + <img class="img-fluid landing-info-image pr-3" + src="/images/landing_cinemas.jpg" alt=""> + </div> + <div class="col-lg-6"> + <div class="bg-black text-center h-100 project"> + <div class="d-flex h-100"> + <div class="project-text w-100 my-auto text-center text-lg-left"> + <h4 class="text-white">Cinemas management</h4> + <p class="mb-0 text-white-50">Manage your remotely</p> + </div> </div> </div> </div> </div> - </div> - <!-- Project Two Row --> - <div class="row justify-content-center hide-y no-gutters"> - <div class="col-lg-6"> - <img class="pl-3 img-fluid landing-info-image" - src="/images/landing_users.jpg" alt=""> - </div> - <div class="col-lg-6 order-lg-first"> - <div class="bg-black text-center h-100 project"> - <div class="d-flex h-100"> - <div class="project-text w-100 my-auto text-center text-lg-right"> - <h4 class="text-white">User management</h4> - <p class="mb-0 text-white-50">Another example of a project usage its user management. Our - tool provides you the best interface to add and delete and edit your customers.</p> - <hr class="d-none d-lg-block mb-0 mr-0"> + <!-- Project Two Row --> + <div class="row justify-content-center hide-y no-gutters"> + <div class="col-lg-6"> + <img class="pl-3 img-fluid landing-info-image" + src="/images/landing_users.jpg" alt=""> + </div> + <div class="col-lg-6 order-lg-first"> + <div class="bg-black text-center h-100 project"> + <div class="d-flex h-100"> + <div class="project-text w-100 my-auto text-center text-lg-right"> + <h4 class="text-white">User management</h4> + <p class="mb-0 text-white-50">Another example of a project usage its user management. + Our + tool provides you the best interface to add and delete and edit your customers.</p> + <hr class="d-none d-lg-block mb-0 mr-0"> + </div> </div> </div> </div> </div> - </div> - </div> -</section> + </div> + </section> +</div> <!-- Contact Section --> <section class="contact-section mt-3 bg-black"> diff --git a/src/main/resources/templates/tickets/edit.html b/src/main/resources/templates/tickets/edit.html index 566549bdf8fae810809c1a81066000687cb338f6..45cda4f1407218695b1f0f9bc8a46952f66d7561 100644 --- a/src/main/resources/templates/tickets/edit.html +++ b/src/main/resources/templates/tickets/edit.html @@ -1,10 +1,78 @@ -<!DOCTYPE html> -<html lang="en"> +<html xmlns:th="http://www.thymeleaf.org"> <head> - <meta charset="UTF-8"> - <title>Title</title> + <title>Edit ticket</title> + <link rel="stylesheet" href="/css/tickets.css"> + <head th:include="commons/imports"></head> + <script src="/js/tickets.js"></script> </head> -<body> +<body class="themed-gradient"> +<!-- Navigation --> +<body th:include="commons/header"></body> + +<div class="editing"> + <div class="container justify-content-center"> + + <form id="ticketForm" class="d-flex justify-content-center" method="post" th:object="${ticket}" + action="/tickets/update"> + <fieldset> + + <legend> + <div class="text-center"><h2><b class="white" th:text="${action} + ' ticket'"></b></h2></div> + </legend> + <br> + <input type="hidden" name="id" th:field="*{id}"> + + <div class="form-group"> + <div class="inputGroupContainer"> + <div class="input-group"> + <div class="input-group-prepend"> + <div class="input-group-text"><i class="fas fa-film"></i></div> + </div> + <input type="text" + class="form-control validate" + id="ticketMovie" + name="movie" + placeholder="Movie" th:field="*{movie}" required> + </div> + </div> + </div> + <div class="form-group"> + <div class="inputGroupContainer"> + <div class="input-group"> + <div class="input-group-prepend"> + <div class="input-group-text"><i class="fas fa-kaaba"></i></div> + </div> + <select class="form-control" id="exampleFormControlSelect2" name="cinemaId" + th:field="*{cinema}" required> + <option value="">Cinema</option> + <option th:each="cinemaItem: ${cinemas}" th:value="${cinemaItem.getId()}" + th:text="${cinemaItem.getName()} + ' in ' + ${cinemaItem.getLocation()}"></option> + </select> + </div> + </div> + </div> + <div class="form-group"> + <div class="inputGroupContainer"> + <div class="input-group"> + <div class="input-group-prepend"> + <div class="input-group-text"><i class="fas fa-user-circle"></i></div> + </div> + <select class="form-control" id="userSelect" name="userId" th:field="*{user}" required> + <option value="">User</option> + <option th:each="userItem: ${users}" th:value="${userItem.getId()}" + th:text="${userItem.getName()} + ' aged ' + ${userItem.getAge()}"></option> + </select> + </div> + </div> + </div> + + <div class="justify-content-center"> + <button type="submit" class="btn btn-primary w-100"><i class="fas fa-check"></i>Submit</button> + </div> + </fieldset> + </form> + </div> +</div> </body> -</html> \ No newline at end of file +</html> diff --git a/src/main/resources/templates/users/edit.html b/src/main/resources/templates/users/edit.html index 566549bdf8fae810809c1a81066000687cb338f6..d3e506b081e84fcf5211e49b5c75c6e4a96afc77 100644 --- a/src/main/resources/templates/users/edit.html +++ b/src/main/resources/templates/users/edit.html @@ -1,10 +1,62 @@ -<!DOCTYPE html> -<html lang="en"> +<html xmlns:th="http://www.thymeleaf.org"> <head> - <meta charset="UTF-8"> - <title>Title</title> + <title>Edit ticket</title> + <head th:include="commons/imports"></head> + <link rel="stylesheet" href="/css/tickets.css"> + <script src="/js/tickets.js"></script> </head> -<body> +<body class="themed-gradient"> +<!-- Navigation --> +<body th:include="commons/header"></body> +<div class="editing"> + <div class="container justify-content-center"> + + <form id="ticketForm" class="d-flex justify-content-center" method="post" th:object="${user}" + action="/users/update"> + <fieldset> + + <legend> + <div class="text-center"><h2><b class="white" th:text="${action} + ' user'"></b></h2></div> + </legend> + <br> + <input type="hidden" name="id" th:field="*{id}"> + + <div class="form-group"> + <div class="inputGroupContainer"> + <div class="input-group"> + <div class="input-group-prepend"> + <div class="input-group-text"><i class="fas fa-user-circle"></i></div> + </div> + <input type="text" + class="form-control validate" + id="userName" + name="name" + placeholder="Users's name" th:field="*{name}" required> + </div> + </div> + </div> + <div class="form-group"> + <div class="inputGroupContainer"> + <div class="input-group"> + <div class="input-group-prepend"> + <div class="input-group-text"><i class="far fa-calendar"></i></div> + </div> + <input type="number" + class="form-control validate" + id="userAge" + name="age" + placeholder="User's age" + th:field="*{age}" required> + </div> + </div> + </div> + <div class="justify-content-center"> + <button type="submit" class="btn btn-primary w-100"><i class="fas fa-check"></i>Submit</button> + </div> + </fieldset> + </form> + </div> +</div> </body> -</html> \ No newline at end of file +</html> diff --git a/src/main/resources/templates/users/list.html b/src/main/resources/templates/users/list.html index 2fe35931c2706537c335082a70dbcc04bbff98cd..9bf337062c95ecae4100894dea94ec75cc9bb405 100644 --- a/src/main/resources/templates/users/list.html +++ b/src/main/resources/templates/users/list.html @@ -31,7 +31,7 @@ <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> - <h5 class="modal-title" id="exampleModalLongTitle">Cinema info</h5> + <h5 class="modal-title" id="exampleModalLongTitle">User info</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button>