<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!--시큐리티 태그 라이브러리 선언-->
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<c:set var="tilesURI" value="${requestScope['javax.servlet.forward.request_uri']}"/>
<c:set var="tilesURIParam" value="${requestScope['javax.servlet.forward.query_string']}"/>

<sec:authorize access="hasRole('ROLE_USER')">
    <nav class="common_nav d-none d-sm-block">
        <div class="header_menu">
            <ul>
                <li class="fs-6 ps-3 ${fn:contains(tilesURI, '/map/request')?"thisOn":""}"
                    onclick="location.href='/map/request'">
                    <i class="bi bi-map fs-5"></i> &nbsp;지도사용 요청
                </li>
                <li class="fs-6 ps-3 ${fn:contains(tilesURI, '/map/userInfo')?"thisOn":""}"
                    onclick="location.href='/map/userInfo'">
                    <i class="bi bi-person-circle"></i> &nbsp;회원정보 수정
                </li>
            </ul>
        </div>
    </nav>
</sec:authorize>
<sec:authorize access="hasRole('ROLE_ADMIN')">
    <nav class="common_nav d-none d-sm-block">
        <div class="header_menu">
            <ul>
                <li class="fs-6 ps-3 ${fn:contains(tilesURI, '/admin/dashBoard')?"thisOn":""}"
                    onclick="location.href='/admin/dashBoard'">
                    <i class="bi bi-grid fs-5"></i> &nbsp;대시보드
                </li>
                <li class="fs-6 ps-3 ${fn:contains(tilesURI, '/admin/request')?"thisOn":""}"
                    onclick="location.href='/admin/request'">
                    <i class="bi bi-map fs-5"></i>&nbsp; 지도사용 요청
                </li>
                <li class="fs-6 ps-3 ${fn:contains(tilesURI, '/admin/history')?"thisOn":""}"
                    onclick="location.href='/admin/history'">
                    <i class="bi bi-signpost-2 fs-5"></i></i>&nbsp; 지도사용 이력
                </li>
                <li class="fs-6 ps-3 ${fn:contains(tilesURI, '/admin/fieldData')?"thisOn":""}"
                    onclick="location.href='/admin/fieldData?status0=1&status1=1&status2=1&status3=1&status4=1'">
                    <i class="bi bi-flag fs-5"></i>&nbsp; 현장수집 데이터
                </li>
                <li class="fs-6 ps-3 ${fn:contains(tilesURI, '/admin/userInfo')?"thisOn":""}"
                    onclick="location.href='/admin/userInfo?auth=99'">
                    <i class="bi bi-person-circle"></i>&nbsp;&nbsp; 회원 관리
                </li>
            </ul>
        </div>
    </nav>
</sec:authorize>