<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", -10);
%>
<%@include file="/WEB-INF/views/base.jsp"%>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>添加角色</title>

<link href="${cssPath }/bootstrap.min.css" rel="stylesheet">
<link href="${fontAwsPath }/css/font-awesome.css" rel="stylesheet">

<!-- Data Tables -->
<link href="${cssPath }/plugins/dataTables/dataTables.bootstrap.css"
	rel="stylesheet">
<link href="${cssPath }/plugins/dataTables/dataTables.responsive.css"
	rel="stylesheet">
<link
	href="${cssPath }/plugins/dataTables/dataTables.tableTools.min.css"
	rel="stylesheet">

<link href="${cssPath }/animate.css" rel="stylesheet">
<link href="${cssPath }/style.css" rel="stylesheet">

<style>
body.DTTT_Print {
	background: #fff;
}

.DTTT_Print #page-wrapper {
	margin: 0;
	background: #fff;
}

button.DTTT_button, div.DTTT_button, a.DTTT_button {
	border: 1px solid #e7eaec;
	background: #fff;
	color: #676a6c;
	box-shadow: none;
	padding: 6px 8px;
}

button.DTTT_button:hover, div.DTTT_button:hover, a.DTTT_button:hover {
	border: 1px solid #d2d2d2;
	background: #fff;
	color: #676a6c;
	box-shadow: none;
	padding: 6px 8px;
}

.dataTables_filter label {
	margin-right: 5px;
}
</style>
</head>

<body>

	<div id="wrapper">

		<jsp:include page="../menu.jsp"></jsp:include>
	
		<div id="page-wrapper" class="gray-bg">
			<jsp:include page="../head.jsp"></jsp:include>
			<jsp:include page="../pageNav.jsp"></jsp:include>
			<div class="wrapper wrapper-content animated fadeInRight">
				<div class="row">
					<div class="col-lg-12">
							<div class="row">
								<div class="ibox-title">AddRole</div>
								<div class="ibox-content m-b-sm border-bottom">

									<div class="row">
										<form:form action="createRole" modelAttribute="sysRole" class="form-horizontal" id="form"
											method="post" role="form" novalidate="novalidate">
											<div class="form-group">
												<label class="col-sm-2 control-label">角色名</label>
												<div class="col-sm-10">
													<form:input class="form-control" autocomplete="off" required="" id="RoleName" path="RoleName" />
													<form:errors path="RoleName" class="field-has-error"></form:errors> 
												</div>
											</div>
											<div class="hr-line-dashed"></div>
											<div class="form-group">
												<label class="col-sm-2 control-label">角色描述</label>
												<div class="col-sm-10">
													<form:input class="form-control" autocomplete="off"  required=""
														id="RoleDesc" path="RoleDesc" /> 
													<form:errors path="RoleDesc" class="field-has-error"></form:errors> 
												</div>
											</div>
											<div class="hr-line-dashed"></div>
											<div class="form-group">
												<div class="col-lg-12">
													<div class="tabs-container" style="text-align: right;">
														<button type="button" class="btn btn-warning" id="btnback"
															style="width: 120px">
															<i class="fa fa-mail-forward"></i>&nbsp;&nbsp;返回
														</button>
														<button type="submit" class="btn btn-primary" id="btnSave"
															style="width: 120px">
															<i class="fa fa-save"></i>&nbsp;&nbsp;保存
														</button>
													</div>
												</div>
											</div>
										</form:form>
									</div>
								</div>
							</div>
					</div>
				</div>
			</div>
		</div>
	</div>


	<!-- Mainly scripts -->
	 <%@include file="/WEB-INF/views/common_base_script.jsp"%>
	<script>
		 $(function(){
	      	//前台js验证
	      	var ruleObj = {RoleName:{required:true}, RoleDesc:{required:true}};
	      	var messageObj = {RoleName:{required:"请输入角色名称"}, RoleDesc:{required:"请输入角色描述"}};
	      	CommonUtils.formValidate("form", ruleObj, messageObj);
	      })
	</script>
	
	<script type="text/javascript">
		$("#btnback").on("click",function(){
			window.location.href = "roleInfo";
		});
	</script>	
	
</body>

</html>
