<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>维护 - 权限设置 - S2M Admin</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<#include "/admin/include/cssjs_up.html" encoding="UTF-8"/>
		<script>
		function checkFormMan(obj){
			$.post("/admin/adminActions/save",$(obj).serialize(),function(result){
				if(result == "success"){
					location.href="/admin/adminActions/list/";
				}else{
					alert("保存失败" + result);
				}
			});
			return false;
		}
		</script>
	</head>

	<body>
		<#assign adminMenuPosFlag="adminActions">
		<#include "/admin/include/head.html" encoding="UTF-8"/>
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>
			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>
				<#include "/admin/include/menu.html" encoding="UTF-8"/>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="/admin/">Home</a>
							</li>
							<li>
								<a href="/admin/adminActions/list/">权限设置</a>
							</li>
							<li class="active">维护</li>
						</ul><!-- .breadcrumb -->
					</div>

					<div class="page-content">
						<div class="page-header">
							<h1>
								信息维护
								<small>
									<i class="icon-double-angle-right"></i>
									权限设置
								</small>
							</h1>
						</div>
<#macro option pid>     
    <#list list as test>
	<#if test.pid == pid>
		<#assign optionName = test.name>
		<#if pid !=0>
			<#assign balankStr = "">
			<#list 1..test.level as bankNum>
			<#assign balankStr = "&#12288;&#12288;" + balankStr>
			</#list>
			<#assign optionName = balankStr + "L___" + test.name>
		</#if>
		<option value="${test.id}" ${(bean.pid==test.id)?string("selected","")}>${optionName}</option>
		<@option test.id />
	</#if>
	</#list>
</#macro>						
						<div class="row">
							<div class="col-xs-12">
								<form role="form" class="form-horizontal" method="post" onsubmit="return checkFormMan(this)">
									<div class="form-group">
										<label for="form-field-2" class="col-sm-3 control-label no-padding-right"> 名称： </label>
										<div class="col-sm-9">
											<input type="text" class="col-xs-10 col-sm-5" name="name" placeholder="name"  value="${bean.name}">
										</div>
									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label for="form-field-2" class="col-sm-3 control-label no-padding-right"> 链接地址： </label>
										<div class="col-sm-9">
											<input type="text" class="col-xs-10 col-sm-5" name="url" placeholder="url"  value="${bean.url}">
										</div>
									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label for="form-field-2" class="col-sm-3 control-label no-padding-right"> 上级编号： </label>
										<div class="col-sm-9">
											<select class="col-xs-10 col-sm-5" name="pid">
												<option value="0">顶级分类</option>
												<@option 0 />
											</select>
										</div>
									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label for="form-field-2" class="col-sm-3 control-label no-padding-right"> 排序： </label>
										<div class="col-sm-9">
											<input type="text" class="col-xs-10 col-sm-5" name="paixu" placeholder="paixu"  value="${bean.paixu!0}">
										</div>
									</div>
									<div class="space-4"></div>
									<div class="clearfix form-actions">
										<div class="col-md-offset-3 col-md-9">
											<button type="submit" class="btn btn-info">
												<i class="icon-ok bigger-110"></i>
												Submit
											</button>
											<input type="hidden" name="id" value="${bean.id}" />
											<input type="hidden" name="token" value="${token}" />
											&nbsp; &nbsp; &nbsp;
											<button type="reset" class="btn">
												<i class="icon-undo bigger-110"></i>
												Reset
											</button>
										</div>
									</div>
								</form>
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->
			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<#include "/admin/include/cssjs_down.html" encoding="UTF-8"/>
	</body>
</html>