From 9dc42308b311445ad2069f07bcfc167c8bae4213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Wed, 12 Jan 2022 14:20:49 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B7=B8=EB=83=A5=20=EC=9E=90=EC=9E=98?= =?UTF-8?q?=ED=95=9C=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dbnt/kcgfilemanager/service/BoardCategoryService.java | 5 ++++- src/main/resources/static/js/common.js | 2 +- src/main/resources/templates/board/contentList.html | 6 +++++- src/main/resources/templates/fragments/leftMenu.html | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/dbnt/kcgfilemanager/service/BoardCategoryService.java b/src/main/java/com/dbnt/kcgfilemanager/service/BoardCategoryService.java index 0db5aff..709742d 100644 --- a/src/main/java/com/dbnt/kcgfilemanager/service/BoardCategoryService.java +++ b/src/main/java/com/dbnt/kcgfilemanager/service/BoardCategoryService.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.Objects; @@ -41,7 +42,9 @@ public class BoardCategoryService { } public List selectBoardCategoryListToFindAll(){ - return boardCategoryRepository.findAll(); + List categoryList = boardCategoryRepository.findAll(); + categoryList.sort(Comparator.comparing(BoardCategory::getSortCnt).reversed()); + return categoryList; } @Transactional diff --git a/src/main/resources/static/js/common.js b/src/main/resources/static/js/common.js index 6c52137..a59e2ed 100644 --- a/src/main/resources/static/js/common.js +++ b/src/main/resources/static/js/common.js @@ -6,7 +6,7 @@ $(document).on('click', '#moveRightBtn', function (){ $(document).on('click', '#moveLeftBtn', function (){ moveCategorySelectBody(-1); }) -$(document).on('click', '#contentWriteBtn', function (){ +$(document).on('click', '.contentWriteBtn', function (){ location.href="/board/contentWrite"+(categorySeq!==undefined?("?categorySeq="+categorySeq):""); }) function moveCategorySelectBody(direction){ diff --git a/src/main/resources/templates/board/contentList.html b/src/main/resources/templates/board/contentList.html index 65c76fb..ab6b613 100644 --- a/src/main/resources/templates/board/contentList.html +++ b/src/main/resources/templates/board/contentList.html @@ -106,7 +106,8 @@ -
+
+
+
diff --git a/src/main/resources/templates/fragments/leftMenu.html b/src/main/resources/templates/fragments/leftMenu.html index 6efdb94..91364f0 100644 --- a/src/main/resources/templates/fragments/leftMenu.html +++ b/src/main/resources/templates/fragments/leftMenu.html @@ -17,7 +17,7 @@ 통합 검색