<!DOCTYPE html>
<html lang="zh">
<head>
	<@meta/>
	<title>部门管理</title>
	<#include "admin/common/include_hplus.ftl">
	<#include "admin/common/include_table.ftl">
    <link href="<@contextPath/>/static/common/plugins/zoomify/css/zoomify.min.css" rel="stylesheet">
    <script src="<@contextPath/>/static/common/plugins/zoomify/zoomify.min.js"></script>
    <script src="<@contextPath/>/static/common/plugins/nestable/jquery.nestable.js"></script>
	<script src="<@contextPath/>/templates/admin/framework/system/dept/js/list.js" type="text/javascript"></script>
</head>
<body class="gray-bg">
<input type="hidden" id="moduleId" value="${module.oid}"/>
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox ">
				<div class="ibox-title">
					<h3>${module.name}</h3>
				</div>
				<div class="ibox-content">
					<@shiro.hasPermission name="SysDept_Add">
					<a href="javascript:AppDept.add();" class="btn btn-link"><i class="fa fa-plus"></i> 添加</a>
					</@shiro.hasPermission>
					<div class="dd" id="nestable">
						<ol class="dd-list">
							<#list nodes as node>
								<li class="dd-item" data-id="${node.id}">
									<div class="dd-handle">
										<span class="pull-right">
											<@shiro.hasPermission name="SysDept_Add">
											<button type="button" class="btn btn-xs" onclick="AppDept.add(${node.id})"><i class="fa fa-plus"></i></button>
											</@shiro.hasPermission>
											<@shiro.hasPermission name="SysDept_Edit">
											<button type="button" class="btn btn-xs" onclick="AppDept.edit(${node.id})"><i class="fa fa-pencil"></i></button>
											</@shiro.hasPermission>
											<!--<button type="button" class="btn btn-xs" onclick="AppDept.del(${node.id})"><i class="fa fa-trash-o"></i></button>-->
										</span>
										<#if node.iconCls??><img width="22" height="22" src="${node.iconCls}"/></#if> ${node.name}
									</div>
									<#if node.children??>
										<ol class="dd-list">
											<#list node.children as cnode>
												<li class="dd-item" data-id="${cnode.id}">
													<div class="dd-handle">
														<span class="pull-right">
															<@shiro.hasPermission name="SysDept_Add">
															<button type="button" class="btn btn-xs" onclick="AppDept.add(${cnode.id})"><i class="fa fa-plus"></i></button>
															</@shiro.hasPermission>
															<@shiro.hasPermission name="SysDept_Edit">
															<button type="button" class="btn btn-xs" onclick="AppDept.edit(${cnode.id})"><i class="fa fa-pencil"></i></button>
															</@shiro.hasPermission>
															<@shiro.hasPermission name="SysDept_Del">
															<button type="button" class="btn btn-xs" onclick="AppDept.del(${cnode.id})"><i class="fa fa-trash-o"></i></button>
															</@shiro.hasPermission>
														</span>
														<#if cnode.iconCls??><img width="22" height="22" src="${cnode.iconCls}"/></#if> ${cnode.name}
													</div>
													<#if cnode.children??>
														<ol class="dd-list">
															<#list cnode.children as ccnode>
																<li class="dd-item" data-id="${ccnode.id}">
																	<div class="dd-handle">
																		<span class="pull-right">
																			<@shiro.hasPermission name="SysDept_Edit">
																			<button type="button" class="btn btn-xs" onclick="AppDept.edit(${ccnode.id})"><i class="fa fa-pencil"></i></button>
																			</@shiro.hasPermission>
																			<@shiro.hasPermission name="SysDept_Del">
																			<button type="button" class="btn btn-xs" onclick="AppDept.del(${ccnode.id})"><i class="fa fa-trash-o"></i></button>
																			</@shiro.hasPermission>
																		</span>
																		<#if ccnode.iconCls??><img width="22" height="22" src="${ccnode.iconCls}"/></#if> ${ccnode.name}
																	</div>
																</li>
															</#list>
														</ol>
													</#if>
												</li>
											</#list>
										</ol>
									</#if>
								</li>
							</#list>
						</ol>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 状态字段publish模板 -->
<script type="text/html" id="tpl_content_publish">
	{{if publish == 1}}
	<span class="label label-primary">已发布</span>
	{{else}}
	<span class="label label-default">未发布</span>
	{{/if}}
</script>
</body>
</html>
