123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
- <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
- <script>
- function deleteConfirm(){
- alertBox({ type : "confirm",
- txt : "정말로 삭제할까요? (해당 게시글이 삭제되며 복구가 불가능합니다)",
- callBack : function( result ){
- if( result ){
- $( "#sendForm" ).attr( "action", "./content/delete" );
- $( "#sendForm" ).submit();
- }
- }
- });
- return false;
- }
- function answerConfirm(){
- alertBox({ type : "confirm",
- txt : "답변을 등록하시겠습니까?",
- callBack : function( result ){
- console.log( result );
- if( result ){
- var newForm = $( "#sendForm" ).clone();
- newForm.attr("id", "answerForm");
- newForm.attr("method", "post");
- newForm.attr("action", "./content/answer");
- $(document.body).append(newForm);
- newForm.submit();
- $("#answerForm").remove();
- // $( "#sendForm" ).attr( "action", "./content/answer" );
- // $( "#sendForm" ).submit();
- }
- }
- });
- return false;
- }
- var listPage = '<c:out value="${referer}"/>'.replaceAll( "&", "&" );
- if( listPage.includes( '/qna/list' ) ) {
- encodeURIComponent(listPage);
- setCookie( "boardQnalistPage", listPage );
- }
- function goListPage(){
- var referer = getCookie( "boardQnalistPage" );
- if( referer == "" ) {
- referer = "/qna/list";
- }
- location.href = referer;
- }
- </script>
- </head>
- <body>
- <div class="wrapper">
- <jsp:include page="${data._INCLUDE}/sidebar.jsp"></jsp:include>
-
- <div class="main">
- <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
- <main class="content">
- <div class="container-fluid p-0">
- <div class="row">
- <div class="col-12 col-lg-6">
- <h1 class="h3 mb-3">의견 게시판</h1>
- </div>
- <div class="col-12 col-lg-6 text-right">
- <nav aria-label="breadcrumb">
- <ol class="breadcrumb">
- <li class="breadcrumb-item"><a href="javscript:;">Home</a></li>
- <li class="breadcrumb-item">의견 게시판</li>
- </ol>
- </nav>
- </div>
- </div>
- <div class="row">
- <div class="col-12">
- <div class="card">
- <form id="sendForm" action="./qna/content/delete" method="post">
- <input type="hidden" name="postSeq" value="${content.postSeq}" >
- <input type="hidden" name="createBy" value="${content.createBy}" >
- <input type="hidden" name="fileName" value="${content.fileName}" >
- <div class="card-body">
- <table class="table mobile-table">
- <colgroup>
- <col style="width:75%">
- <col style="width:">
- <col style="width:">
- </colgroup>
-
- <tr>
- <td>조회수 : <c:out value="${content.views}"></c:out></td>
- <th class="text-center">작성자</th>
- <td><c:out value="${content.createByName}(${content.createBy})" /></td>
- </tr>
-
- <tr>
- <td class="text-bold text-info"><c:out value="${content.title}" /></td>
- <th class="text-center">작성일</th>
- <td><c:out value="${content.createDate}" /></td>
- </tr>
-
- <tr>
- <td colspan="3" style="white-space: pre-line;"><div style="min-height:200px;"><c:out value="${content.content}" /></div></td>
- </tr>
-
- <tr>
- <td colspan="3">
- <span class="badge bg-primary">첨부파일</span>
- <a href="./content/file?postSeq=${content.postSeq}" class="text-dark" target="_blank"><c:out value="${content.fileOriginalName}" /></a>
- </td>
- </tr>
- </table>
-
- <c:if test="${groupIdx eq 1}">
- <input type="hidden" name="answerId" value="${sesId}">
- <table class="mt-3 table mobile-table">
- <colgroup>
- <col style="width:10%">
- <col style="width:">
- </colgroup>
-
- <tr>
- <th>작성자</th>
- <!-- <td> -->
- <%-- <c:out value="${sesName}(${sesId})" /> --%>
- <!-- </td> -->
- <c:if test="${content.answerId eq ''}">
- <td>
- <c:out value="${sesName}(${sesId})" />
- </td>
- </c:if>
- <c:if test="${content.answerId ne ''}">
- <td>
- <c:out value="${content.answerName}(${content.answerId})" />
- </td>
- </c:if>
- </tr>
- <tr>
- <th>답변</th>
- <c:if test="${content.answerContent eq ''}">
- <td>
- <textarea class="form-control" rows="2" cols="" name="answerContent" placeholder="내용을 입력하세요" maxlength="1000" required><c:out value="${item.content}" /></textarea>
- </td>
- </c:if>
- <c:if test="${content.answerContent ne ''}">
- <td colspan="3" style="white-space: pre-line;"><div style="min-height:100px;"><c:out value="${content.answerContent}" /></div></td>
- </c:if>
- </tr>
- </table>
-
- <c:if test="${content.answerId eq ''}">
- <div class="row mt-3">
- <div class="col-12">
- <div class="text-right">
- <button type="button" onclick="answerConfirm()" class="btn btn-primary w100">답변</button>
- </div>
- </div>
- </div>
- </c:if>
- </c:if>
-
- <table class="mt-3 table mobile-table">
- <colgroup>
- <col style="width:10%">
- <col style="width:">
- </colgroup>
-
- <tr>
- <th>이전글 ▲</th>
- <td>
- <c:if test="${prePostCnt eq 0}">
- 이전 글이 없습니다.
- </c:if>
- <c:if test="${prePostCnt ne 0}">
- <a href="./content?postSeq=${prePost.prePostSeq}"><c:out value="${prePost.prePostTitle}" /></a>
- </c:if>
- </td>
- </tr>
- <tr>
- <th>다음글 ▼</th>
- <td>
- <c:if test="${nextPostCnt eq 0}">
- 다음 글이 없습니다.
- </c:if>
- <c:if test="${nextPostCnt ne 0}">
- <a href="./content?postSeq=${nextPost.nextPostSeq}"><c:out value="${nextPost.nextPostTitle}" /></a>
- </c:if>
- </td>
- </tr>
- </table>
-
- <div class="row mt-3">
- <div class="col-12">
- <div class="text-right">
- <c:if test="${sesId eq content.createBy}">
- <button type="button" onclick="location.href='./edit?postSeq=${content.postSeq}';" class="btn btn-primary w100">수정</button>
- <button type="button" onclick="deleteConfirm();" class="btn btn-danger w100">삭제</button>
- </c:if>
- <button type="button" class="btn btn-outline-primary w100" onclick="goListPage();">목록</button>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </main>
- <jsp:include page="${data._INCLUDE}/footer.jsp"></jsp:include>
- </div>
- </div>
- </body>
- </html>
|