<!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 rel="stylesheet" href="/css/web/webMainBannerSelectList.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 webMainBannerSearchKeywordParam = "[[${param.webMainBannerSearchKeywordParam}]]";
        let webMainBannerSearchType = "[[${param.webMainBannerSearchType}]]";
        let webMainBannerSort = "[[${param.webMainBannerSort}]]";
        let webMainBannerDir = "[[${param.webMainBannerDir}]]";
        let webMainBannerStart = "[[${param.webMainBannerStart}]]" == "" ? 0 : "[[${param.webMainBannerStart}]]";
        let webMainBannerLimit = "[[${param.webMainBannerLimit}]]" == "" ? 500 : "[[${param.webMainBannerLimit}]]";

        let webMainBannerSearchStartDate = "[[${param.webMainBannerSearchStartDate}]]";
        let webMainBannerSearchEndDate = "[[${param.webMainBannerSearchEndDate}]]";
        let webMainBannerSearchDateType = "[[${param.webMainBannerSearchDateType}]]" == "" ? "A" : "[[${param.webMainBannerSearchDateType}]]";

        // CDN_URL 전역 정의
        const CDN_URL = "[(${@environment.getProperty('url.cdn')})]";
    </script>
</th:block>
<th:block layout:fragment="layout_content">
    <!-- 센터쪽 -->
    <div class="center_box">
        <p class="page_title">메인 배너</p>

        <div class="filter_box">
            <div class="form_box">


                <div class="select_box dropdown">
                    <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true"
                        aria-expanded="false">카테고리 전체</button>
                    <input type="hidden" id="webMainBannerSearchType">
                    <ul class="select_option_list dropdown-menu">
                        <li class="option_list_item" id="li_ALL">구분 전체</li>
                        <li class="option_list_item" id="li_DT">다이어트 상단</li>
                        <li class="option_list_item" id="li_DB">다이어트 하단</li>
                        <li class="option_list_item" id="li_PT">쁘띠 상단</li>
                        <li class="option_list_item" id="li_PB">쁘띠 하단</li>
                    </ul>
                </div>

                <!-- 이름input -->
                <div class="search_list">
                    <div class="search_box">
                        <img src="/image/web/search_G.svg" alt="search" />
                        <input type="text" id="webMainBannerSearchKeyword" required placeholder="제목">

                        <div class="search_list"></div><!-- 검색내역 나오는곳 -->
                    </div>
                    <button id="btnSearchWebMainBanner" class="search_btn">조회</button>
                </div>

                <div class="right_btn_box">
                    <button id="btnInsertWebMainBanner" class="content_btn">
                        <img src="/image/web/notice_btn_icon.svg" alt="등록">등록
                    </button>
                    <button id="btnDeleteWebMainBanner" class="delete_btn">
                        <img src="/image/web/delete_btn_icon.svg" alt="삭제">삭제
                    </button>
                </div>
            </div>
        </div>

        <div id="webMainBannerGrid" class="table_box ag-theme-balham"></div>

        <!-- 페이지게이션 -->
        <div class="page_box">
            <nav aria-label="Page navigation" class="navigation">
                <ul class="pagination" id="webMainBannerPagination"></ul>
            </nav>
        </div>
    </div>
    <form id="webMainBannerSelectListForm" 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/webmainbanner/webMainBannerSelectList.js"></script>
</th:block>

</html>