Changeset cab5859
- Timestamp:
- 01/06/23 21:08:03 (23 months ago)
- Branches:
- main
- Children:
- 89865ae
- Parents:
- 9dcbf44
- Location:
- src/main
- Files:
-
- 11 added
- 1 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/config/WebSecurityConfig.java
r9dcbf44 rcab5859 28 28 http.csrf().disable() 29 29 .authorizeRequests() 30 .antMatchers("/", "/products", "/services", "/filtered", "/login", "/register","/registerWarehouseman","/finishRegister","/test/*","/access_denied" ).permitAll()30 .antMatchers("/", "/products", "/services", "/filtered", "/login", "/register","/registerWarehouseman","/finishRegister","/test/*","/access_denied","/carCategoryReport","/partManufacturersReport","/mostPurchasedPart").permitAll() 31 31 .antMatchers("/orders","/repairs","/reviews","/part/*","/currentOrder","/addCarSampleForUser","/repairs/addReview/*").hasRole("CLIENT") 32 32 .antMatchers("/viewUsers","/approve/*").hasRole("ADMIN") -
src/main/java/com/example/autopartz/controller/AdminController.java
r9dcbf44 rcab5859 37 37 public String getAllUsers(Model model){ 38 38 List<User> pendingList = userService.findAllUsers().stream().filter(u->u.getAuthorities().contains(Role.ROLE_PENDING_DELIVERYMAN) || u.getAuthorities().contains(Role.ROLE_PENDING_WAREHOUSEMAN)).toList(); 39 model.addAttribute("users", pendingList); 39 if(pendingList.size()==0){ 40 model.addAttribute("hasError",true); 41 } 42 else { 43 model.addAttribute("hasError",false); 44 model.addAttribute("users", pendingList); 45 } 40 46 model.addAttribute("bodyContent", "viewUsers"); 41 47 return "master-template"; -
src/main/java/com/example/autopartz/controller/HomeController.java
r9dcbf44 rcab5859 37 37 private final DeliveryService deliveryService; 38 38 private final PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository; 39 private final CarCategoryReportRepository carCategoryReportRepository; 40 private final PartManufacturersReportRepository partManufacturersReportRepository; 41 private final MostPurchasedPartRepository mostPurchasedPartRepository; 39 42 public HomeController(LoginService loginService, PartService partService, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, CarService carService, CategoryService categoryService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository, WarehouseRepository warehouseRepository, 40 OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveriesInProgressRepository deliveriesInProgressRepository, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository ) {43 OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveriesInProgressRepository deliveriesInProgressRepository, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository, CarCategoryReportRepository carCategoryReportRepository, PartManufacturersReportRepository partManufacturersReportRepository, MostPurchasedPartRepository mostPurchasedPartRepository) { 41 44 this.loginService = loginService; 42 45 this.partService = partService; … … 52 55 this.deliveryService = deliveryService; 53 56 this.partIsInStockInWarehouseRepository = partIsInStockInWarehouseRepository; 57 this.carCategoryReportRepository = carCategoryReportRepository; 58 this.partManufacturersReportRepository = partManufacturersReportRepository; 59 this.mostPurchasedPartRepository = mostPurchasedPartRepository; 54 60 } 55 61 … … 231 237 return "master-template"; 232 238 } 239 @GetMapping("/carCategoryReport") 240 public String getCarCategoryInfo(Model model){ 241 model.addAttribute("data",carCategoryReportRepository.findAll()); 242 model.addAttribute("bodyContent","carCategoryReport"); 243 return "master-template"; 244 } 245 @GetMapping("/partManufacturersReport") 246 public String getPartManufacturersReport(Model model){ 247 model.addAttribute("data",partManufacturersReportRepository.findAll()); 248 model.addAttribute("bodyContent","partManufacturersReport"); 249 return "master-template"; 250 251 } 252 @GetMapping("/mostPurchasedPart") 253 public String getMostPurchasedPart(Model model){ 254 model.addAttribute("data",mostPurchasedPartRepository.findAll()); 255 model.addAttribute("bodyContent","mostPurchasedPart"); 256 return "master-template"; 257 } 233 258 } -
src/main/resources/templates/addReviewPage.html
r9dcbf44 rcab5859 1 1 <div> 2 2 <div> 3 4 3 <form class="form-signin mt-xl-5" method="post" th:action="@{'/repairs/addReview/{id}' (id=${repair.getId()}) }"> 5 4 <h2 class="form-signin-heading">Додај критика</h2> -
src/main/resources/templates/chooseRepairShop.html
r9dcbf44 rcab5859 2 2 <h1 th:if="${hasError}" th:text="${error}"></h1> 3 3 <div th:if="${!hasError}"> 4 <h3 >Достава до овластен сервис</h3>4 <h3 class="mt-3 mb-3">Достава до овластен сервис</h3> 5 5 <form class="form-signin mt-xl-5" method="post" action="/part/chooseRepairShop"> 6 6 <p> -
src/main/resources/templates/currentOrder.html
r9dcbf44 rcab5859 2 2 <h1 th:if="${hasError}" th:text="${error}"></h1> 3 3 <div th:if="${!hasError}"> 4 <h3 th:text="${order.getUser().getUsername()}"></h3> 5 <table> 6 <thead> 4 <h3 class="mt-3 mb-3"> 5 Нарачка за корисник : <span th:text="${order.getUser().getUsername()}"></span> 6 </h3> 7 <table class="table table-bordered"> 8 <thead class="thead-dark"> 7 9 <tr> 8 10 <th>Name</th> -
src/main/resources/templates/fragments/header.html
r9dcbf44 rcab5859 10 10 <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault"> 11 11 <ul class="navbar-nav m-auto"> 12 <li class="nav-item m-auto">13 <a class="nav-link active" href="/products">Продукти</a>14 </li>15 <li class="nav-item m-auto">16 <a class="nav-link active" href="/services">Сервиси</a>17 </li>18 12 <th:block sec:authorize="hasAuthority('ROLE_CLIENT')"> 19 13 <li class="nav-item m-auto"> 20 14 <a class="nav-link active" href="/currentOrder">Моја нарачка</a> 21 15 </li> 16 </th:block> 17 <th:block sec:authorize="hasAuthority('ROLE_CLIENT')"> 18 <li class="nav-item m-auto"> 19 <a class="nav-link active" href="/orders">Мои нарачки</a> 20 </li> 21 </th:block> 22 <th:block sec:authorize="hasAuthority('ROLE_CLIENT')"> 23 <li class="nav-item m-auto"> 24 <a class="nav-link active" href="/repairs">Мои поправки</a> 25 </li> 26 </th:block> 27 <th:block sec:authorize="hasAuthority('ROLE_CLIENT')"> 28 <li class="nav-item m-auto"> 29 <a class="nav-link active" href="/reviews">Мои критики</a> 30 </li> 22 31 </th:block> 23 32 <th:block sec:authorize="hasAuthority('ROLE_CLIENT')"> … … 46 55 <th:block th:if="${#request.getRemoteUser() != null}"> 47 56 <li class="nav-item"> 48 <a class="btn btn-success btn-sm ml-3" href="/ register">57 <a class="btn btn-success btn-sm ml-3" href="/"> 49 58 <th:block th:text="${#request.getRemoteUser()}"></th:block> 50 59 </a> -
src/main/resources/templates/home.html
r9dcbf44 rcab5859 1 1 <div> 2 Почетна страница 2 <h1>Авто делови AutoPartz.MK - онлајн продавница</h1> 3 <div class="d-flex"> 4 <div class="d-flex flex-column justify-content-center align-items-center"> 5 <h2>Се за вашиот автомобил</h2> 6 <h4 class="text-center">Избор од голем број на производители</h4> 7 </div> 8 <div class="ml-5"> 9 <img class="img-fluid" src="https://c4.wallpaperflare.com/wallpaper/1022/57/149/sports-car-ferrari-photo-manipulation-engines-wallpaper-preview.jpg" alt="Image"> 10 </div> 3 11 </div> 12 <form class="form-signin mt-xl-5" method="get" action="/products"> 13 <button class="btn btn-danger btn-block btn-lg" type="submit">Пребарувај производи</button> 14 </form> 15 16 </div> -
src/main/resources/templates/master-template.html
r9dcbf44 rcab5859 10 10 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> 11 11 </head> 12 <body >12 <body class="bg-light"> 13 13 <header th:replace="fragments/header"></header> 14 14 … … 16 16 17 17 </section> 18 19 <footer th:replace="fragments/footer"></footer> 18 20 </body> 19 21 </html> -
src/main/resources/templates/myDeliveries.html
r9dcbf44 rcab5859 1 1 <div> 2 <h1 >Мои достави</h1>2 <h1 class="mt-3 mb-3">Мои достави</h1> 3 3 <form class="form-signin mt-xl-5" method="get" action="/myNextDeliveries"> 4 <button id="submit" class="btn btn-lg btn-primary btn-block " type="submit">Мои следни нарачки</button>4 <button id="submit" class="btn btn-lg btn-primary btn-block w-50" type="submit">Мои следни нарачки</button> 5 5 </form> 6 <table >7 <thead >6 <table class="table table-bordered mt-3"> 7 <thead class="thead-dark"> 8 8 <tr> 9 <th >Статус на достава</th>10 <th >Адреса на достава</th>11 <th >Број на нарачка</th>12 <th >Датум на нарачка</th>9 <th scope="col">Статус на достава</th> 10 <th scope="col">Адреса на достава</th> 11 <th scope="col">Број на нарачка</th> 12 <th scope="col">Датум на нарачка</th> 13 13 </tr> 14 14 </thead> -
src/main/resources/templates/myNextDeliveries.html
r9dcbf44 rcab5859 1 1 <div> 2 <h1 >Мои следни нарачки</h1>2 <h1 class="mb-3 mt-3">Мои следни нарачки</h1> 3 3 <h1 th:if="${hasError}" th:text="${error}"></h1> 4 4 <div th:if="${!hasError}"> 5 <table >6 <thead >5 <table class="table table-bordered"> 6 <thead class="thead-dark"> 7 7 <tr> 8 8 <th>Статус на достава</th> -
src/main/resources/templates/myWarehouse.html
r9dcbf44 rcab5859 1 1 <div> 2 <h1 >Мој магацин</h1>3 <table >4 <thead >2 <h1 class="mt-3 mb-3">Мој магацин</h1> 3 <table class="table table-bordered"> 4 <thead class="thead-dark"> 5 5 <tr> 6 6 <th>Магацин</th> -
src/main/resources/templates/orderInfo.html
r9dcbf44 rcab5859 1 1 <div> 2 <h1 >Нарачка број <span th:text="${o.getOrderid()}"></span></h1>3 <table >4 <thead >2 <h1 class="mt-3 mb-3">Нарачка број <span th:text="${o.getOrderid()}"></span></h1> 3 <table class="table table-bordered"> 4 <thead class="thead-dark"> 5 5 <tr> 6 6 <th>Име на делот</th> -
src/main/resources/templates/ordersForUser.html
r9dcbf44 rcab5859 1 1 <div> 2 <h1 >Мои нарачки</h1>3 <table >4 <thead >2 <h1 class="mt-3 mb-3">Мои нарачки</h1> 3 <table class="table table-bordered"> 4 <thead class="thead-dark"> 5 5 <tr> 6 6 <th>Датум на нарачка</th> -
src/main/resources/templates/partinfo.html
r9dcbf44 rcab5859 1 1 <div> 2 <table class="table table-bordered mt-4"> 2 <h1 class="mt-3 mb-3">Детали за делот</h1> 3 <a href="/products">Назад кон сите продукти</a> 4 <table class="table table-bordered mt-3"> 3 5 <thead class="thead-dark"> 4 6 <tr> -
src/main/resources/templates/products.html
r9dcbf44 rcab5859 1 1 <div xmlns:sec="http://www.thymeleaf.org/extras/spring-security" 2 2 > 3 <header>4 <th:block sec:authorize="hasAuthority('ROLE_CLIENT')">5 <a th:href="${'/orders'}">Мои нарачки</a>6 <a th:href="${'/repairs'}">Мои поправки</a>7 <a th:href="${'/reviews'}">Мои критики</a>8 </th:block>9 </header>10 3 <main> 11 4 <h1 class="mt-3 mb-3">Сите производи</h1> -
src/main/resources/templates/repairsForUser.html
r9dcbf44 rcab5859 1 1 <div> 2 <h1 >Мои поправки</h1>3 <table >4 <thead >2 <h1 class="mt-3 mb-3">Мои поправки</h1> 3 <table class="table table-bordered"> 4 <thead class="thead-dark"> 5 5 <tr> 6 6 <th>Број на поправка</th> -
src/main/resources/templates/reviewsForUser.html
r9dcbf44 rcab5859 1 1 <div> 2 <h1 >Мои критики</h1>3 <table >4 <thead >2 <h1 class="mt-3 mb-3">Мои критики</h1> 3 <table class="table table-bordered"> 4 <thead class="thead-dark"> 5 5 <tr> 6 6 <th>Оценка</th> -
src/main/resources/templates/selectWarehouse.html
r9dcbf44 rcab5859 1 1 <div> 2 <h1 class="mt-3 mb-3">Одбери овластен сервис</h1> 2 3 <form class="form-signin mt-xl-5" method="post" action="/finishRegister"> 3 4 <label for="location"></label><select class="form-control" id="location" required name="location"> -
src/main/resources/templates/viewUsers.html
r9dcbf44 rcab5859 1 1 <div> 2 <table> 3 <thead> 2 <div th:if="${hasError}"> 3 <h1>Нема корисници за одобрување</h1> 4 </div> 5 <div th:if="${!hasError}"> 6 <h1 class="mt-3 mb-3">Корисници за одобрување</h1> 7 <table class="table table-bordered"> 8 <thead class="thead-dark"> 4 9 <tr> 5 <th> Name</th>6 <th> Username</th>7 <th> Role</th>8 <th> Approve</th>10 <th>Име</th> 11 <th>Корисничко име</th> 12 <th>Улога</th> 13 <th>Одобри</th> 9 14 </tr> 10 15 </thead> … … 16 21 <td> 17 22 <form method="post" th:action="@{'/approve/{id}' (id=${user.getId()}) }"> 18 <button type="submit"> Approve</button>23 <button type="submit">Одобри</button> 19 24 </form> 20 25 </td> … … 22 27 </tbody> 23 28 </table> 29 </div> 24 30 </div>
Note:
See TracChangeset
for help on using the changeset viewer.