<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/layout}">
<th:block layout:fragment="css">
  <style>
    .categoryName{
      width: 130px;
    }
    .sortCnt{
      width: 60px;
    }
  </style>
</th:block>
<th:block layout:fragment="script">
  <script type="text/javascript" th:src="@{/js/admin/categoryMgt2.js}"></script>
</th:block>
<div layout:fragment="content">
  <main class="pt-3">
    <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
    <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
    <h4>게시판 분류 관리</h4>
    <div class="row mx-0">
      <div class="col-auto card text-center">
        <div class="card-body">
          <div class="row justify-content-end">
            <input type="button" class="col-auto btn btn-primary mx-3" id="saveCategoryBtn" value="저장">
          </div>
          <div class="row justify-content-start">
            <div class="col-auto m-3 p-3 border">
              <div class="row-cols-6" id="depth1Div">
                <table class="table table-hover">
                  <thead data-depth="1">
                  <tr>
                    <th></th>
                    <th class="categoryName">대분류</th>
                    <th class="sortCnt">순서</th>
                    <th></th>
                    <th></th>
                  </tr>
                  </thead>
                  <tbody id="depth1Tbody">
                  </tbody>
                </table>
              </div>
              <div class="row justify-content-end">
                <div class="col-auto">
                  <input type="button" class="btn btn-success addCategoryBtn" value="추가" data-depth="1">
                </div>
              </div>
            </div>
            <div class="col-auto m-3 p-3 border">
              <div class="row-cols-6" id="depth2Div">
                <table class="table table-hover">
                  <thead>
                  <tr>
                    <th></th>
                    <th class="categoryName">연도</th>
                    <th class="sortCnt">순서</th>
                    <th></th>
                    <th></th>
                  </tr>
                  </thead>
                  <tbody id="depth2Tbody">
                  </tbody>
                </table>
              </div>
              <div class="row justify-content-end">
                <div class="col-auto">
                  <input type="button" class="btn btn-success addCategoryBtn" value="추가" data-depth="2">
                </div>
              </div>
            </div>
            <div class="col-auto m-3 p-3 border">
              <div class="row-cols-6" id="depth3Div">
                <table class="table table-hover">
                  <thead>
                  <tr>
                    <th></th>
                    <th class="categoryName">중분류</th>
                    <th class="sortCnt">순서</th>
                    <th></th>
                    <th></th>
                  </tr>
                  </thead>
                  <tbody id="depth3Tbody">
                  </tbody>
                </table>
              </div>
              <div class="row justify-content-end">
                <div class="col-auto">
                  <input type="button" class="btn btn-success addCategoryBtn" value="추가" data-depth="3">
                </div>
              </div>
            </div>
            <div class="col-auto m-3 p-3 border">
              <div class="row-cols-6" id="depth4Div">
                <table class="table table-hover">
                  <thead>
                  <tr>
                    <th></th>
                    <th class="categoryName">소분류</th>
                    <th class="sortCnt">순서</th>
                    <th></th>
                    <th></th>
                  </tr>
                  </thead>
                  <tbody id="depth4Tbody">
                  </tbody>
                </table>
              </div>
              <div class="row justify-content-end">
                <div class="col-auto">
                  <input type="button" class="btn btn-success addCategoryBtn" value="추가" data-depth="4">
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>
</div>
</html>