<!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="script">
  <script type="text/javascript" th:src="@{/js/organMgt/organMgt.js}"></script>
</th:block>
<div layout:fragment="content">
  <main class="pt-3">
    <h4>관서 설정</h4>
    <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
    <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
    <div class="row mx-0">
      <div class="col-12 card text-center">
        <div class="card-body">
          <div class="row">
            <div class="col-6">
              <div class="row justify-content-end">
                <button class="col-auto btn btn-success mx-3 my-2" id="organSaveBtn">저장</button>
              </div>
            </div>
          </div>
          <div class="row justify-content-start">
            <div class="col-3">
              <div class="card">
                <div class="card-body">
                  <div class="row">
                    <table class="table table-hover">
                      <thead>
                      <tr>
                        <th></th>
                        <th>지방청</th>
                      </tr>
                      </thead>
                      <tbody id="middleTbody">

                      </tbody>
                    </table>
                  </div>
                  <div class="row justify-content-center">
                    <button class="btn btn-sm btn-outline-primary col-auto" id="middleAddBtn"><i class="bi bi-plus-lg"></i></button>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-3">
              <div class="card">
                <div class="card-body">
                  <div class="row">
                    <table class="table table-hover">
                      <thead>
                      <tr>
                        <th></th>
                        <th>관할서</th>
                      </tr>
                      </thead>
                      <tbody id="bottomTbody">

                      </tbody>
                      <tfoot>
                      <tr id="emptyTr"><td colspan="2">지방청을 선택해주세요.</td></tr>
                      </tfoot>
                    </table>
                  </div>
                  <div class="row justify-content-center" id="bottomBtnRow" style="display: none">
                    <button class="btn btn-sm btn-outline-primary col-auto" id="bottomAddBtn"><i class="bi bi-plus-lg"></i></button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>

  <div class="modal fade" id="authEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="authEditModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-scrollable">
      <div class="modal-content" id="authEditModalContent">
        <div class="modal-header">
          <h5 class="modal-title" id="menuEditModalLabel">권한 편집</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">

        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
          <button type="button" class="btn btn-primary" id="saveAuthBtn">저장</button>
        </div>
      </div>
    </div>
  </div>
</div>
</html>