<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="<c:url value='/resources/js/admin/auth.js' />"></script>
<!-- 메뉴 관리 -->
<div class="main-wrapper">
	<div class="title-bar">
    	<span class="title">권한 관리</span>
    </div>
	<div id="wrapper" >
		<div class="col-md-3">
			<div class="left-content">
				<div class="form-group col-md-12 pd0 mg0">
		    		<div class="table-wrapper-lg">
			    		<table class="table table-bordered table-hover table-row-click">
							<thead>
								<tr>
									<td class="table-header">권한아이디</td>
									<td class="table-header">이름</td>
								</tr>
							</thead>
							<tbody id="table_authAttr">
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<div class="col-md-9">
			<div class="right-content row">
				<div class="col-md-12" id="authDetailEmpty" style="display: none">
    				<div class="form-group col-md-12 text-right">
				    	<div class="btn-group" role="group" aria-label="...">
						  <button type="button" class="btn btn-default btn-sm" id="btnNewEmpty" title="추가">
						  	<span class="glyphicon glyphicon-plus">&nbsp;추가</span>
						  </button>
						</div>
					</div>
					<div class="form-group col-md-12 pd0">
						<div class="col-md-12 pd0">
							* 권한 정보를 선택해주세요.
						</div>
					</div>
				</div>
				<div id="authDetail">
					<div class="form-group col-md-12 text-right">
				    	<div class="btn-group" role="group" aria-label="...">
				    	  <button type="button" class="btn btn-default btn-sm" id="btnNew" title="추가">
						  	<span class="glyphicon glyphicon-plus">&nbsp;추가</span>
						  </button>
						  <button type="button" class="btn btn-default btn-sm" id="btnRemove" title="삭제">
						  	<span class="glyphicon glyphicon-minus">&nbsp;삭제</span>
						  </button>
						  <button type="button" class="btn btn-default btn-sm" id="btnSave" title="저장">
						  	<span class="glyphicon glyphicon-ok">&nbsp;저장</span>
						  </button>
						</div>
					</div>
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="form-group col-md-12 mgt5">
									<div class="col-md-2 content-title text-right">
										<label class="">아이디</label>
									</div>
									<div class="col-md-4">
										<input type="text" class="form-control input-sm" id="txtAuthId" placeholder="">
									</div>
									<div class="col-md-2 content-title text-right">
										<label>이름</label>
									</div>
									<div class="col-md-4">
										<input type="text" class="form-control input-sm" id="txtAuthName" placeholder="">
									</div>
								</div>
								<div class="form-group col-md-12">
									<div class="col-md-2 content-title text-right">
										<label>설명<br/>(<span id="descLength">0</span>/500bytes)</label>
									</div>
									<div class="col-md-10">
										<textarea class="form-control input-sm" id="txtAuthDesc" rows="3"></textarea>
									</div>
								</div>		
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="col-md-12">
									<div class="form-group content-box-title">
										<label>속성 추가</label>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-2 content-title text-right">
											<label></label>
										</div>
										<div class="col-md-10">
											<div class="text-right">
												<button type="button" class="btn btn-default btn-sm" id="btnEditPlusAttr" title="편집">
													<span class="glyphicon glyphicon-edit">&nbsp;편집</span>
												</button>
											</div>
						    				<div id="container_i18n">
												<table class="table table-bordered table-hover">
							    					<thead>
							    						<tr>
							    							<td class="table-header">속성타입</td>
							    							<td class="table-header">속성</td>
							    						</tr>
							    					</thead>
							    					<tbody id="table_plusAuth_view">
							    					</tbody>
							    				</table>
											</div>	
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="col-md-12">
									<div class="form-group content-box-title">
										<label>속성 제거</label>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-2 content-title text-right">
											<label></label>
										</div>
										<div class="col-md-10">
											<div class="text-right">
												<button type="button" class="btn btn-default btn-sm" id="btnEditMinusAttr" title="편집">
													<span class="glyphicon glyphicon-edit">&nbsp;편집</span>
												</button>
											</div>
						    				<div id="container_i18n">
												<table class="table table-bordered table-hover">
							    					<thead>
							    						<tr>
							    							<td class="table-header">속성타입</td>
							    							<td class="table-header">속성</td>
							    						</tr>
							    					</thead>
							    					<tbody id="table_minusAuth_view">
							    					</tbody>
							    				</table>
											</div>	
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="attrModal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document" style="width: 800px">
    <div class="modal-content">
      <div class="modal-header">
      	<span id="modalHeaderText"></span>
      </div>
      <div class="modal-body">
      	<div class="row">
			<div class="col-md-12">
				<div class="col-md-5">
			    	<div class="col-md-12 pd0 table-wrapper-sm">
						<table class="table table-bordered">
	    					<thead>
	    						<tr>
	    							<td class="table-header">속성타입</td>
	    							<td class="table-header">이름</td>
	    							<td class="table-header">
									<button type="button" class="btn btn-primary btn-xs" id="btnNewItem_attr">
										<span class="glyphicon glyphicon-plus">&nbsp;추가</span>
									</button>
								</td>
	    						</tr>
	    					</thead>
	    					<tbody id="table_attr">
	    					</tbody>
	    				</table>
    				</div>
				</div>
				<div class="col-md-7">
					<div class="col-md-12 pd0">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="col-md-12" id="modalAttrDetailEmpty">
									<div class="form-group col-md-12 pd0">
										<div class="col-md-12 pd0">
											* 속성 정보를 선택해주세요.
										</div>
									</div>
								</div>
								<div id="modalAttrDetail">
									<div class="col-md-12">
										<div class="row content-box-title">
											<div class="col-md-12 detail-content-title">
												<label>속성 정보</label>
											</div>
										</div>
										<div class="form-group col-md-12 pd0">
											<div class="col-md-3 text-right content-title pdl0 pdr0">
												<label>속성타입</label>
											</div>
											<div class="col-md-9 pdr0">
												<select class="form-control input-sm" id="sltAttrType">
													<option value="">선택</option>
												</select>
											</div>
										</div>
										<div class="form-group col-md-12 pd0">
											<div class="col-md-3 text-right content-title pdl0 pdr0">
												<label>속성</label>
											</div>
											<div class="col-md-9 pdr0">
												<select class="form-control input-sm" id="sltAttr">
													<option value="">선택</option>
												</select>
											</div>
										</div>
										<div class="form-group col-md-12 pd0">
											<div class="col-md-12 pd0 text-center">
												<button type="button" class="btn btn-default btn-sm" id="btnSaveAttr">
	   												<span class="glyphicon glyphicon-ok">&nbsp;저장</span>
												</button>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
      </div>
      <div class="modal-footer text-center">
        <button type="button" class="btn btn-default btn-sm" id="btnConfirmAttr">
        	<span class="glyphicon glyphicon-ok-circle">&nbsp;적용</span>     
        </button>
        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
        	<span class="glyphicon glyphicon-remove-circle">&nbsp;취소</span>
        </button>
      </div>
    </div>
  </div>
</div>

<script type="text/javascript">
$(document).ready(function() { 
    var auth = new mplus_admin_auth( "${defaultLanguage}" );
    auth.init();
});
</script>
