<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{/web/layout/homeLayout}">
<th:block layout:fragment="layout_css">
    <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/web/ContentsBbsReg.css">
    <link rel="stylesheet" href="/css/web/grid.css?v1.1">
</th:block>
<th:block layout:fragment="layout_top_script">
    <script src="/js/web/jquery.twbsPagination.js" type="text/javascript"></script>
    <script>
        let menuClass     = "[[${param.menuClass}]]"==""?"":"[[${param.menuClass}]]";

        let selectUseYn   = "[[${selectUseYn}]]"==""?"N":"[[${selectUseYn}]]";
        let insertUseYn   = "[[${insertUseYn}]]"==""?"N":"[[${insertUseYn}]]";
        let updateUseYn   = "[[${updateUseYn}]]"==""?"N":"[[${updateUseYn}]]";
        let deleteUseYn   = "[[${deleteUseYn}]]"==""?"N":"[[${deleteUseYn}]]";
        let downloadUseYn = "[[${downloadUseYn}]]"==""?"N":"[[${downloadUseYn}]]";
        
        let categoryDivCd = "[[${param.categoryDivCd}]]";
        let categoryNo = "[[${param.categoryNo}]]";
        let postNo = "[[${param.postNo}]]";
        let categorytitle = "[[${title}]]";
        
        const CDN_URL = "[[${@environment.getProperty('url.cdn')}]]";
        
    </script>
</th:block>
<th:block layout:fragment="layout_content">
    <!-- 센터쪽 -->
    <div class="center_box">
        <p class="page_title">[[${title}]]</p>

        <!-- 테이블 -->
        <div class="content_box">
            <div class="content clear">
				<div class="wp60">
					<div class="top">
                        <label>썸네일 첨부파일</label>
                        <label for="file" class="file_btn"><img src="/image/web/add.svg" alt="파일찾기"></label>
                    </div>
                    <div class="btm">
                        <div class="img_box">
                        	<img id="thumbnailImg" src="" width="800px" height="450px" />
                        </div>                        
                        <input type="file" id="file" accept="image/jpeg, image/jpg, image/png" style="display: none;" multiple>
                        <button id="delete_btn">삭제</button>
                    </div>
					<p class="thumbnail-bottom-txt">
						썸네일 하단글
					</p>
					<textarea id="thumbnailBottomTxt" placeholder="썸네일 하단글을 입력해주세요." ></textarea>
					<p class="content-file">
						컨텐츠 첨부파일
						<label for="content_file" class="file_btn"><img src="/image/web/add.svg" alt="파일찾기"></label>
					</p>
					<input type="file" id="content_file" style="display: none;" placeholder="첨부파일을 입력해주세요."/>
					<div class="file_box">
						<img id="contentsImg" src="" width="100%" height="100%" />
					</div>
					<button id="content_delete_btn">삭제</button>
				</div>
				<div class="wp40">
					<div class="consultation-info">
						<p id="main_category">
							카테고리
						</p>
						<select th:name="category" th:disabled="true">
							<option value="">선택하세요</option>
  							<option th:each="item : ${category}" th:value="${item['categoryNo']}" th:text="${item['categoryNm']}" ></option>
						</select>
						<!-- disabled된 select의 값을 전송하기 위한 hidden input -->
						<input type="hidden" id="categoryNo" />
						<p id="main_title">
							제목
						</p>
						<input type="text" id="title" placeholder="제목을 입력해주세요."/>
						<p id="main_content">
							내용
						</p>						
						<textarea id="content" placeholder="내용을 입력해주세요."></textarea>		                
						<p id="main_hashtag">
							해쉬태그
						</p>
						<input type="text" id="hashtag" placeholder="해쉬태그를 입력해주세요."/>
						<div>
							<label for="oldCrmItemId">OLD CRM 연동ID</label>
							<input type="text" id="oldCrmItemId" placeholder="OLD_CRM_ITEM_ID"/>
						</div>
						<div>
							<label for="ordNo">홈페이지 출력순서</label>
							<input type="text" id="ordNo" />
						</div>
						<p id="main_procedure">
							시술선택
							<button class="add_btn ml50" onclick="javascript:listOpen();">
								<img src="/image/web/add.svg" alt="추가">
							</button>  													
							<button class="add_btn" onclick="javascript:fn_removeRow();">
								<img src="/image/web/subtract.svg" alt="삭제">
							</button>	
						</p>
						<div id="treatmentlist">	    
						</div>                 		
					</div>
					<div class="button_box">
		              <button class="registration_btn btnSave">수정</button>
		              <button class="cancel_btn btnCancle">취소</button>
		            </div>
				</div>
					
			</div>
			
        </div>
    </div>
    <form id="excelForm" method="POST" target="_blank"></form>
</th:block>
<th:block layout:fragment="layout_popup">
</th:block>
<th:block layout:fragment="layout_script">
    <script src="/js/web/ag-grid-community-29.3.5.min.js"></script>
    <script src="/js/web/contentsBbs/ContentsBbsUpd.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>
    <script src="/js/web/contentsBbs/ContentsBbsPop.js"></script>
</th:block>
</html>