게시물 작성, 수정시 메인페이지 노출 여부 선택 추가.
parent
8bd2cc6908
commit
ec6468d64b
|
|
@ -32,18 +32,12 @@ public class BaseController {
|
|||
if(((UserInfo)((UsernamePasswordAuthenticationToken) principal).getPrincipal()).getUserRole().indexOf("ADMIN")>0){
|
||||
mav = new ModelAndView("redirect:/admin/main");
|
||||
}else{
|
||||
mav = new ModelAndView("redirect:/user/main");
|
||||
mav = new ModelAndView("redirect:/board/main");
|
||||
}
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/user/main")
|
||||
public ModelAndView main() {
|
||||
ModelAndView mav = new ModelAndView("main");
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/refreshSession")
|
||||
public void getSession(HttpSession session){
|
||||
session.setAttribute("positionList", commonCodeService.selectCommonCodeValue("POSITION"));
|
||||
|
|
|
|||
|
|
@ -32,6 +32,14 @@ public class BoardController {
|
|||
private final BoardService boardService;
|
||||
private final BoardCategoryService boardCategoryService;
|
||||
|
||||
|
||||
@GetMapping("/main")
|
||||
public ModelAndView main() {
|
||||
ModelAndView mav = new ModelAndView("main");
|
||||
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/contentWrite")
|
||||
public ModelAndView contentWrite(@AuthenticationPrincipal UserInfo loginUser, Board content) {
|
||||
ModelAndView mav = new ModelAndView("board/contentWrite");
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ public class BoardService {
|
|||
Board savedContent = boardRepository.findById(contentSeq).orElse(null);
|
||||
savedContent.setCategorySeq(updateContent.getCategorySeq());
|
||||
savedContent.setTitle(updateContent.getTitle());
|
||||
savedContent.setStatus(updateContent.getStatus());
|
||||
savedContent.setDescription(updateContent.getDescription());
|
||||
saveBoardLog(contentSeq, LogStatus.MODIFY, null, userInfo.getUserId());
|
||||
deleteHashTagLink(contentSeq);
|
||||
|
|
@ -77,7 +78,9 @@ public class BoardService {
|
|||
if(fileSeqList!=null){
|
||||
deleteFileInfo(contentSeq, fileSeqList, userInfo.getUserId());
|
||||
}
|
||||
saveUploadFiles(updateContent, userInfo.getUserId());
|
||||
if(updateContent.getFileList()!=null){
|
||||
saveUploadFiles(updateContent, userInfo.getUserId());
|
||||
}
|
||||
return contentSeq;
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +165,7 @@ public class BoardService {
|
|||
@Transactional
|
||||
public Board selectContentByContentSeqAndViewCntUp(Integer contentSeq) {
|
||||
Board target = selectContent(contentSeq);
|
||||
if(target.getStatus()==null){
|
||||
if(!target.getStatus().equals("D")){
|
||||
target.setViewCnt(target.getViewCnt()+1);
|
||||
}
|
||||
return target;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ function searchParamCheck(){
|
|||
emptyCnt++;
|
||||
}
|
||||
if(emptyCnt>4){
|
||||
alert("분류를 제외한 5가지 조건 중 1가지 이상 입력해주세요.")
|
||||
alert("분류를 제외한 조건 중 1가지 이상 입력해주세요.")
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -66,6 +66,9 @@ $(document).on('click', '#saveBtn', function (){
|
|||
if(confirm("저장하시겠습니까?")){
|
||||
let ajaxUrl = "/board/saveContent";
|
||||
const formData = new FormData($("#contentForm")[0]);
|
||||
const status = $("#status:checked").val()
|
||||
formData.append("status", status===undefined?"B":status);
|
||||
|
||||
for(const file of files) {
|
||||
if(!file.isDelete)
|
||||
formData.append('uploadFiles', file, file.name);
|
||||
|
|
@ -133,7 +136,7 @@ function selectorDisabler(depth){
|
|||
}
|
||||
|
||||
function setParentCategory(depth, parentSeq){
|
||||
$("[data-depth='"+depth+"']").children().each(function (){
|
||||
$(".categorySelector[data-depth='"+depth+"']").children().each(function (){
|
||||
const option = $(this)
|
||||
if(parentSeq === option.attr("data-parentseq")){
|
||||
option.removeAttr("style");
|
||||
|
|
@ -141,7 +144,7 @@ function setParentCategory(depth, parentSeq){
|
|||
option.css("display", "none");
|
||||
}
|
||||
})
|
||||
const nextTarget = $("[value='"+parentSeq+"']");
|
||||
const nextTarget = $("option[value='"+parentSeq+"']");
|
||||
nextTarget.attr("selected", "selected");
|
||||
if(depth!==1){
|
||||
setParentCategory(depth-1, nextTarget.attr("data-parentseq"));
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,14 @@
|
|||
<input type="hidden" id="detailViewContentSeq" th:value="${content.contentSeq}">
|
||||
<input type="hidden" id="contentStatus" th:value="${content.status}">
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto"><h5 class="fw-bold" th:text="${content.title}"></h5></div>
|
||||
<div class="col-auto">
|
||||
<h5 class="fw-bold">
|
||||
<th:block th:if="${content.status =='M'}">
|
||||
<i class="bi bi-star-fill"></i>
|
||||
</th:block>
|
||||
<span th:text="${content.title}"></span>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col-auto" th:text="|조회수: ${content.viewCnt}|"></div>
|
||||
</div>
|
||||
<div class="row justify-content-between border-bottom pb-3">
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@
|
|||
<div class="col-7 card">
|
||||
<div class="card-body">
|
||||
<div class="row mb-3 justify-content-end">
|
||||
<div class="col-auto my-auto pe-0">
|
||||
<input type="checkbox" id="status" name="status" value="M" th:checked="${type=='new'?false:(content.status=='M'?true:false)}">
|
||||
</div>
|
||||
<label for="status" class="col-auto col-form-label">메인페이지 노출</label>
|
||||
<div class="col-auto">
|
||||
<button class="bi bi-save btn btn-primary" id="saveBtn"> 저장</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
<!--bootstrap-->
|
||||
<script type="text/javascript" th:src="@{/vendor/bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js}"></script>
|
||||
<script type="text/javascript" th:src="@{/vendor/bootstrap-5.1.3-dist/js/popper.min.js}"></script>
|
||||
<!--jquery-->
|
||||
<script type="text/javascript" th:src="@{/vendor/jquery-3.6.0/jquery-3.6.0.min.js}"></script>
|
||||
<!--bootstrap-datepicker-->
|
||||
|
|
|
|||
|
|
@ -38,11 +38,11 @@
|
|||
|
||||
<!--<img class="mb-4" th:src="@{/img/}" alt="" width="72" height="57">-->
|
||||
<h1 class="h3 mb-3 fw-normal">로그인</h1>
|
||||
<div class="form-floating">
|
||||
<div class="form-floating py-2">
|
||||
<input type="text" class="form-control" id="username" name="username" placeholder="아이디">
|
||||
<label for="username">아이디</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<div class="form-floating py-2">
|
||||
<input type="password" class="form-control" id="password" name="password" placeholder="비밀번호">
|
||||
<label for="password">비밀번호</label>
|
||||
</div>
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
<input type="checkbox" class="disabled" value="remember-me"> 계정저장(비활성화)
|
||||
</label>
|
||||
</div>-->
|
||||
<button class="w-100 btn btn-lg btn-primary" type="submit">로그인</button>
|
||||
<button class="w-100 py-2 btn btn-lg btn-primary" type="submit">로그인</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue