diff --git a/src/main/java/com/s3ai/controllers/cinemas/CinemaFill.java b/src/main/java/com/s3ai/controllers/cinemas/CinemaFill.java index 8611f436748b4feec77decde1f71a99d3ed5e38c..511956bb2c5f29f5845b40aa2b31481a218c4502 100644 --- a/src/main/java/com/s3ai/controllers/cinemas/CinemaFill.java +++ b/src/main/java/com/s3ai/controllers/cinemas/CinemaFill.java @@ -28,7 +28,7 @@ public class CinemaFill extends HttpServlet { var random = new Random(); for (int i = 0; i < 300; i++) { var cinema = new Cinema(); - cinemaService.fillCinemaFields(cinema, names.get(random.nextInt(names.size())), locations.get(random.nextInt(locations.size())), Math.abs(random.nextInt())); + cinemaService.fillCinemaFields(cinema, names.get(random.nextInt(names.size())), locations.get(random.nextInt(locations.size())), random.nextInt(300) + 50); cinemaService.saveCinema(cinema); writer.println(cinema); } diff --git a/src/main/java/com/s3ai/controllers/tickets/TicketsEdit.java b/src/main/java/com/s3ai/controllers/tickets/TicketsEdit.java index 1adbf19125430048b4f2a5ff80d7742d2a2a21c2..086f3ebe8f0ed589be21af5d8c93de477af44e82 100644 --- a/src/main/java/com/s3ai/controllers/tickets/TicketsEdit.java +++ b/src/main/java/com/s3ai/controllers/tickets/TicketsEdit.java @@ -70,4 +70,19 @@ public class TicketsEdit extends HttpServlet { session.setAttribute("ticket", ticket); dispatcher.forward(req, resp); } + + protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + String id = req.getParameter("id"); + if (null == id) { + resp.sendError(420, "Object cannot be found"); + return; + } + var ticket = ticketService.getTicketById(UUID.fromString(id)); + if (null == ticket) { + resp.sendError(420, "Object cannot be found"); + return; + } + ticketService.deleteTicket(ticket); + resp.setStatus(200); + } } diff --git a/src/main/java/com/s3ai/controllers/users/UsersEdit.java b/src/main/java/com/s3ai/controllers/users/UsersEdit.java index e3dd648ea815c5304e3b9ccf6133a7b62cd823c9..09c136ce1ce8e38bac74f78946e4d4165bd59f2a 100644 --- a/src/main/java/com/s3ai/controllers/users/UsersEdit.java +++ b/src/main/java/com/s3ai/controllers/users/UsersEdit.java @@ -46,4 +46,19 @@ public class UsersEdit extends HttpServlet { session.setAttribute("user", user); dispatcher.forward(req, resp); } + + protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + String id = req.getParameter("id"); + if (null == id) { + resp.sendError(420, "Object cannot be found"); + return; + } + var user = userService.getUserById(UUID.fromString(id)); + if (null == user) { + resp.sendError(420, "Object cannot be found"); + return; + } + userService.deleteUser(user); + resp.setStatus(200); + } } diff --git a/src/main/java/com/s3ai/entities/Ticket.java b/src/main/java/com/s3ai/entities/Ticket.java index 0a189d8ee437230ae67a4a6635fa55cca238b426..45821b6ec9d0e0f9b633b003d2ab52a494b47e7a 100644 --- a/src/main/java/com/s3ai/entities/Ticket.java +++ b/src/main/java/com/s3ai/entities/Ticket.java @@ -1,6 +1,8 @@ package com.s3ai.entities; import lombok.Data; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import javax.persistence.*; import java.util.UUID; @@ -14,9 +16,11 @@ class Ticket { private UUID id; @OneToOne + @OnDelete(action = OnDeleteAction.CASCADE) private User user; @OneToOne + @OnDelete(action = OnDeleteAction.CASCADE) private Cinema cinema; @Column(name = "movie") diff --git a/src/main/webapp/pages/index.jsp b/src/main/webapp/pages/index.jsp index ac9743f88db35fbeb3fb939dfa2ecf899c6ce785..fb1c62fc986499cc0fffcd60e6deeb2a69c92dd4 100644 --- a/src/main/webapp/pages/index.jsp +++ b/src/main/webapp/pages/index.jsp @@ -23,87 +23,97 @@ <div class="container d-flex h-100 align-items-center"> <div class="mx-auto text-center"> <h1 class="mx-auto my-0 text-uppercase white">Cinemas</h1> - <h2 class="text-white-50 mx-auto mt-2 mb-5 white">The best tool to provide you good interface to manage - cinemas in your city.</h2> - <a href="#about" class="btn btn-primary js-scroll-trigger white">Get Started</a> + <!--<h2 class="text-secondary mx-auto mt-2 mb-5 text-uppercase white">The best tool to manage your cinema network</h2>--> + <a href="#about" class="btn btn-interact js-scroll-trigger white">Get Started</a> </div> </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 business. Built with passion for movies.</h2> + <p class="text-white-50"> + We are glad to provide you the best possible instrument to manage your cinema network. + Use it to control your cinemas, track tickets to movies, and gather precious data for your + business. + System is established to be user-friendly and easy to get on. + </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="${pageContext.request.contextPath}/static/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 justify-content-center no-gutters mb-5 mb-lg-0"> + <div class="col-lg-6"> + <img class="img-fluid mb-3 mb-lg-0 landing-info-image pr-3" + src="${pageContext.request.contextPath}/static/images/landing_tickets.jpg" alt=""> + </div> + <div class="col-lg-6"> + <div class="project-text w-100 my-auto text-center text-lg-left"> + <h4 class="text-white">Tickets management</h4> + <p class="text-white-50 mb-0"> + Manage tickets that your customers buy. Get all the information about movies and cinemas, + track popular titles, do whatever you may possibly imagine. + </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="${pageContext.request.contextPath}/static/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="${pageContext.request.contextPath}/static/images/landing_cinemas.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">Cinemas management</h4> + <p class="mb-0 text-white-50"> + Manage your network. See all the theaters that you own in various places, control + business processes, divide and conquer. + </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="${pageContext.request.contextPath}/static/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="${pageContext.request.contextPath}/static/images/landing_users.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">User management</h4> + <p class="mb-0 text-white-50"> + Build up your customers database. Track popularity of certain titles and places + basing + on precious personal data of innocent people, and enjoy the world we live in. + </p> + <hr class="d-none d-lg-block mb-0 mr-0"> + </div> </div> </div> </div> </div> </div> - - </div> -</section> + </section> +</div> <!-- Contact Section --> <section class="contact-section mt-3 bg-black"> diff --git a/src/main/webapp/pages/tickets/list.jsp b/src/main/webapp/pages/tickets/list.jsp index 745e4991510e9c6fb1b4da530f04f2920c4bb93a..713803808cde441f93a7181394b765b75b6c0f5f 100644 --- a/src/main/webapp/pages/tickets/list.jsp +++ b/src/main/webapp/pages/tickets/list.jsp @@ -11,7 +11,7 @@ <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> - <title>Cinemas list</title> + <title>Tickets list</title> <%@include file='../templates/imports.jsp' %> <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/tickets.css"> </head> @@ -50,7 +50,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">Ticket info</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> @@ -62,16 +62,16 @@ <p id="modal_id"></p> </div> <div class="d-flex flex-row justify-content-between"> - <p>Name:</p> - <p id="modal_name"></p> + <p>Movie:</p> + <p id="modal_movie"></p> </div> <div class="d-flex flex-row justify-content-between"> - <p>Location:</p> - <p id="modal_location">value</p> + <p>User:</p> + <p id="modal_user_id">value</p> </div> <div class="d-flex flex-row justify-content-between"> - <p>Seats count:</p> - <p id="modal_seats">value</p> + <p>Cinema:</p> + <p id="modal_cinema_id">value</p> </div> </div> </div> diff --git a/src/main/webapp/pages/users/edit.jsp b/src/main/webapp/pages/users/edit.jsp index 8db564e1e043ae9255e81f1beae96557859370f7..58ef4e5a40c78471f692616602979a446b699a0d 100644 --- a/src/main/webapp/pages/users/edit.jsp +++ b/src/main/webapp/pages/users/edit.jsp @@ -10,7 +10,7 @@ <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> - <title>Edit ticket</title> + <title>Edit user</title> <%@include file='../templates/imports.jsp' %> <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/tickets.css"> <script src="${pageContext.request.contextPath}/static/js/tickets.js"></script> diff --git a/src/main/webapp/pages/users/list.jsp b/src/main/webapp/pages/users/list.jsp index c9b2fa0c06f4df077860d7b9b30864503e19be10..4305a09469be33608b777fdd31fb5b9c089af47e 100644 --- a/src/main/webapp/pages/users/list.jsp +++ b/src/main/webapp/pages/users/list.jsp @@ -10,7 +10,7 @@ <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> - <title>Cinemas list</title> + <title>Users list</title> <%@include file='../templates/imports.jsp' %> <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/users.css"> </head> @@ -47,7 +47,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> diff --git a/src/main/webapp/static/coffee/tickets.coffee b/src/main/webapp/static/coffee/tickets.coffee new file mode 100644 index 0000000000000000000000000000000000000000..f36ee126cff76c5f852126e5855a0c3e59fa0c87 --- /dev/null +++ b/src/main/webapp/static/coffee/tickets.coffee @@ -0,0 +1,35 @@ +fill_modal = (event) -> + target = $(this) + ticket_id = target.attr 'ticket_id' + if undefined != ticket_id and "" != ticket_id + $("#modal_id").text ticket_id + $("#modal_movie").text target.find("[attr_name='movie']").text() + $("#modal_cinema_id").text target.find("[attr_name='cinema_id']").text() + $("#modal_user_id").text target.find("[attr_name='user_id']").text() + $("#ticketModal").modal('toggle') + +hrefToEdit = (event) -> + ticket_id = $("#modal_id").text() + window.location.replace "#{context_url}/ticket/?id=#{ticket_id}" + +removeCinema = (event) -> + ticket_id = $("#modal_id").text() + $.ajax + url: "#{context_url}/ticket/?id=#{ticket_id}", + type: 'DELETE' + error: (jqXHR, textStatus, errorThrown) -> + $.toast + icon: 'error', + hideAfter: 5000, + heading: "Cannot delete ticket", + text: "#{jqXHR.responseText}" + success: (data, textStatus, jqXHR) -> + $("tr[ticket_id='#{ticket_id}").remove() + $("#ticketModal").modal('toggle') + +addListeners = -> + $('tr').on 'click', fill_modal + $('#edit_ticket').on 'click', hrefToEdit + $('#delete_ticket').on 'click', removeCinema + +$(document).ready(addListeners) \ No newline at end of file diff --git a/src/main/webapp/static/css/index.css b/src/main/webapp/static/css/index.css index 0d8791aa278c2eebbf7a3f654016ea9d3fecbd08..2b1e279bc8a5e9ae24160b4489e0a8dcbc12ba5a 100644 --- a/src/main/webapp/static/css/index.css +++ b/src/main/webapp/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;padding-top:1rem;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-interact{background-color:#64a19d}.btn-interact:hover{background-color:#4f837f}.btn-interact:focus{background-color:#4f837f;color:#fff}.btn-interact: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/webapp/static/css/index.css.map b/src/main/webapp/static/css/index.css.map index f94fd252f1eb925e65c4561e0e865d903de7cdd3..9de368993141b11db8c8f0765e5adb8c455ce2b7 100644 --- a/src/main/webapp/static/css/index.css.map +++ b/src/main/webapp/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,iBACA,2BAEA,iCACE,2BAGF,kCACE,MCrJA,KD2JR,KACE,2DACA,qBACA,2BACA,cACA,yBACA,sBACA,SAGF,cACE,iBC1JQ,QD4JR,oBACE,yBAGF,oBACE,yBACA,WAGF,qBACE,oCAIJ,eACE,kBAEA,iBACE","file":"index.css"} \ No newline at end of file diff --git a/src/main/webapp/static/js/cinemas.js b/src/main/webapp/static/js/cinemas.js index 46c7d97974aeef1b8445a536bb46bdca77d3f12c..2570a792aa05c25926a8fcb3cf5b53560b177429 100644 --- a/src/main/webapp/static/js/cinemas.js +++ b/src/main/webapp/static/js/cinemas.js @@ -28,7 +28,12 @@ url: `${context_url}/cinema/?id=${cinema_id}`, type: 'DELETE', error: function(jqXHR, textStatus, errorThrown) { - return console.log(`AJAX Error: ${textStatus}`); + return $.toast({ + icon: 'error', + hideAfter: 5000, + heading: "Cannot delete cinema", + text: `${jqXHR.responseText}` + }); }, success: function(data, textStatus, jqXHR) { $(`tr[cinema_id='${cinema_id}`).remove(); diff --git a/src/main/webapp/static/js/tickets.js b/src/main/webapp/static/js/tickets.js new file mode 100644 index 0000000000000000000000000000000000000000..bad3857f1f8d7c286d5437701aba54a725c0e468 --- /dev/null +++ b/src/main/webapp/static/js/tickets.js @@ -0,0 +1,53 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var addListeners, fill_modal, hrefToEdit, removeCinema; + + fill_modal = function(event) { + var target, ticket_id; + target = $(this); + ticket_id = target.attr('ticket_id'); + if (void 0 !== ticket_id && "" !== ticket_id) { + $("#modal_id").text(ticket_id); + $("#modal_movie").text(target.find("[attr_name='movie']").text()); + $("#modal_cinema_id").text(target.find("[attr_name='cinema_id']").text()); + $("#modal_user_id").text(target.find("[attr_name='user_id']").text()); + return $("#ticketModal").modal('toggle'); + } + }; + + hrefToEdit = function(event) { + var ticket_id; + ticket_id = $("#modal_id").text(); + return window.location.replace(`${context_url}/ticket/?id=${ticket_id}`); + }; + + removeCinema = function(event) { + var ticket_id; + ticket_id = $("#modal_id").text(); + return $.ajax({ + url: `${context_url}/ticket/?id=${ticket_id}`, + type: 'DELETE', + error: function(jqXHR, textStatus, errorThrown) { + return $.toast({ + icon: 'error', + hideAfter: 5000, + heading: "Cannot delete ticket", + text: `${jqXHR.responseText}` + }); + }, + success: function(data, textStatus, jqXHR) { + $(`tr[ticket_id='${ticket_id}`).remove(); + return $("#ticketModal").modal('toggle'); + } + }); + }; + + addListeners = function() { + $('tr').on('click', fill_modal); + $('#edit_ticket').on('click', hrefToEdit); + return $('#delete_ticket').on('click', removeCinema); + }; + + $(document).ready(addListeners); + +}).call(this); diff --git a/src/main/webapp/static/scss/index.scss b/src/main/webapp/static/scss/index.scss index 3e5d20116f7c568be6ec380feb282823fbf17cc8..eca5788b5a44fa6f3c2588a6fe73a32fce11d3e4 100644 --- a/src/main/webapp/static/scss/index.scss +++ b/src/main/webapp/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; @@ -136,6 +139,7 @@ background: fade-out($white, 0.9); border-radius: 100%; line-height: 3rem; + padding-top: 1rem; color: fade-out($white, 0.7); &:hover { @@ -159,7 +163,7 @@ border: 0; } -.btn-primary { +.btn-interact { background-color: $primary; &:hover { @@ -178,7 +182,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;