<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/admin/include/taglib.jsp"%>
<html>
<head>
	<title>栏目管理</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/admin/include/treetable.jsp" %>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#treeTable").treeTable({expandLevel : 3});
		});
    	function updateSort() {
			loading('正在提交，请稍等...');
	    	$("#listForm").attr("action", "${ctx}/cms/category/updateSort");
	    	$("#listForm").submit();
    	}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/cms/category/list">栏目列表</a></li>
	</ul>
	<sys:message content="${message}"/>
	<form id="listForm" method="post">
		<table id="treeTable" class="table table-striped table-bordered table-condensed">
			<tr><th>栏目名称</th><th style="text-align:center;">排序</th><th>操作</th></tr>
			<c:forEach items="${list}" var="tpl">
				<tr id="${tpl.id}" pId="${not empty tpl.parent.id?tpl.parent.id:'0'}">
					<td><a href="${ctx}/cms/category/form?id=${tpl.id}">${tpl.name}</a></td>
					<td style="text-align:center;">
						<input type="hidden" name="ids" value="${tpl.id}"/>
						<input name="sorts" type="text" value="${tpl.sort}" disabled="true" style="width:50px;margin:0;padding:0;text-align:center;">
					</td>
					<td>
						<%-- <a href="${pageContext.request.contextPath}/front/list-${tpl.id}${fns:getUrlSuffix()}" target="_blank">访问</a> --%>
						<a href="${pageContext.request.contextPath}/main?sign=zixun" target="_blank">访问</a>
						<a href="${ctx}/cms/category/form?id=${tpl.id}">修改</a>
						<%-- <a href="${ctx}/cms/category/delete?id=${tpl.id}" onclick="return confirmx('要删除该栏目吗？', this.href)">删除</a> --%>
					</td>
				</tr>
			</c:forEach>
		</table>
	</form>
</body>
</html>