<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>KGCMS企业应用管理平台 - Powered by KGCMS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<!-- <meta http-equiv="cache-control" content="no-siteapp" /> -->
<link rel="stylesheet" href="{{ kg['tpl_url'] }}style/category_manage.css">
<script src="{{ kg['tpl_url'] }}script/jquery.min.js"></script>
<script src="{{ kg['server']['HTTP_HOST'] }}/tools/amazeui/js/amazeui.min.js"></script>
<script src="{{kg['tpl_url']}}script/common.js"></script>
<script src="{{ kg['tpl_url'] }}script/category_manage.js"></script>
</head>
<body data-type="generalComponents">
	{% include 'component_header.tpl' %}
	<div class="tpl-page-container tpl-page-header-fixed">
		<div class="scrollbar-wrap">
		{% include 'component_left.tpl' %}
		<div class="tpl-content-wrapper">
			<div class="tpl-content-page-title">
				栏目及分类管理
			</div>
			<ol class="am-breadcrumb">
				{% if path %}
				<li><a href="./" class="am-icon-home">首页</a></li>
				<li><a href="category_manage">栏目及分类管理</a></li>
				{% for row in path %}
				{% if path|length == loop.index %}
				<li class="am-active">{{row['title']}}</li>
				{% else %}
				<li><a href="category_manage?cid={{row['id']}}">{{row['title']}}</a></li>
				{% endif %}
				{% endfor %}
				{% else %}
				<li><a href="./" class="am-icon-home">首页</a></li>
				<li class="am-active">栏目及分类管理</li>
				{% endif %}
			</ol>
			<div class="tpl-portlet-components">
				<div class="portlet-title">
					<div class="caption font-green bold">
						<span class="am-icon-code"></span>&nbsp;栏目及分类管理
					</div>
					<div class="tpl-portlet-input tpl-fz-ml fulei am-no-margintop">
						<div class="am-form-group am-no-marginbtm ngco-Kshezhi-maginR am-hover">
							<select class="ngca-Ysj-change" data-am-selected="{btnSize: 'sm'}">
								{% for row in category %}
								{% if cid == row['id'] %}
								<option selected="selected" value="category_manage?cid={{row['id']}}">{{row['title']}}</option>
								{% else %}
								<option value="category_manage?cid={{row['id']}}">{{row['title']}}</option>
								{% endif %}
								{% endfor %}
							</select>
							<span class="am-input-group-btn add-span">
								{% if cid > 0 %}
								<a class="add am-btn am-btn-default" href="category_update?add={{cid}}">添加栏目</a>
								{% else %}
								<a class="add am-btn am-btn-default" href="category_update">添加栏目</a>
								{% endif %}
							</span>
						</div>
					</div>
				</div>
				<div class="am-g">
					<div class="am-u-sm-12 ngco-No-paddingR">
						<form action="#" method="post">
							<!-- <div class="am-table am-table-striped am-table-hover table-main ngco-Esz-mgibdr change-table">
								<div class="change-thead">
									<ul class="change-tr-th">
										<li class="table-id">排序</li>
										<li class="table-title">栏目图片</li>
										<li class="table-title">栏目名称</li>
										<li class="table-type">所属模块</li>
										<li class="table-date am-hide-sm-only">栏目级别</li>
										<li class="table-date am-hide-sm-only">是否启用</li>
										<li class="table-set">操作</li>
									</ul>
								</div>
								<div class="change-tbody">
									{% set len = data|length %}
									{% if len > 0 %}
									{% for row in data %}
									<ul class="change-tr-td change-nth js_img">
										<li>
											<div class="ng4_width ng4-width-border">
												<input name="{{loop.index}}" value="{{row['sort']}}" type="text" size="4" class="zty-sort">
												<input type="hidden" name="sort" value="{{row['id']}},{{row['sort']}}">
											</div>
										</li>
										<li><img {% if row['picture'] %} src="{{row['picture']}}" {% else %} src="/" {% endif %} alt="" class="caterory-img" /></li>
										<li><a href="category_manage?cid={{row['id']}}">{{row['title']}}</a></li>
										<li>{{row['module']}}</li>
										<li class="am-hide-sm-only">{{row['level']}}</li>
										<li>
											<div class="tpl-switch">
												{% if row['enable']==1 %}
												<a href="category_manage?action=unenable&id={{row['id']}}"></a>
													<input type="radio" class="ios-switch bigswitch tpl-switch-btn" checked="">
													<div class="tpl-switch-btn-view title2div" title="已经启用，点击取消">
														<div></div>
													</div>
											</div>
											<div class="tpl-switch">
												{% else %}
												<a href="category_manage?action=enable&id={{row['id']}}"></a>
													<input type="radio" class="ios-switch bigswitch tpl-switch-btn">
													<div class="tpl-switch-btn-view title2div" title="还没有启用，点击启用">
														<div></div>
													</div>
												{% endif %}
											</div>
										</li>
										<li>
											<div class="am-btn-toolbar">
												<div class="am-btn-group am-btn-group-xs">
													<a href="category_update?cid={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-edit-bright am-text-secondary title2div" title="编辑栏目"><span class="am-icon-pencil-square-o"></span>&nbsp;编辑</a>
													<a href="category_manage?cid={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-son-bright am-hide-sm-only title2div" title="显示子栏目"><span class="am-icon-list"></span>&nbsp;子栏目</a>
													<a href="category_manage?{{url['button']}}action=del&id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi title2div" title="删除栏目">
														<span class="am-icon-trash-o"></span>&nbsp;删除
													</a>
												</div>
											</div>
										</li>
									</ul>
									{% endfor %}
									{% else %}
									<ul>没有相关数据</ul>
									{% endif %}
								</div>
							</div> -->
							<table class="am-table am-table-striped am-table-hover table-main ngco-Esz-mgibdr">
								<thead>
									<tr>
										<th class="table-id">排序</th>
										<th class="table-title">栏目图片</th>
										<th class="table-title">栏目名称</th>
										<th class="table-type">所属模块</th>
										<th class="table-date am-hide-sm-only">栏目级别</th>
										<th class="table-date am-hide-sm-only">是否启用</th>
										<th class="table-date am-hide-sm-only">是否显示</th>
										<th class="table-set">操作</th>
									</tr>
								</thead>
								<tbody>
									{% set len = data|length %}
									{% for row in data %}
									<tr class="js_img">
										<td>
											<div class="ng4_width ng4-width-border">
												<input name="{{loop.index}}" value="{{row['sort']}}" type="text" size="4" class="zty-sort">
												<input type="hidden" name="sort" value="{{row['id']}},{{row['sort']}}">
											</div>
										</td>
										<td><img {% if row['picture'] %} src="{{row['picture']}}" {% else %} src="/" {% endif %} alt=""
												class="caterory-img" /></td>
										<td><a href="category_manage?cid={{row['id']}}">{{row['title']}}</a></td>
										<td>{{row['module']}}</td>
										<td class="am-hide-sm-only">{{row['level']}}</td>
										<td>
											{% if row['enable']==1 %}
											<a href="category_manage?action=unenable&id={{row['id']}}">
												<div class="tpl-switch">
													<input type="radio" class="ios-switch bigswitch tpl-switch-btn" checked="">
													<div class="tpl-switch-btn-view title2div" title="已经启用，点击取消">
														<div></div>
													</div>
												</div>
											</a>
											{% else %}
											<a href="category_manage?action=enable&id={{row['id']}}">
												<div class="tpl-switch">
													<input type="radio" class="ios-switch bigswitch tpl-switch-btn">
													<div class="tpl-switch-btn-view title2div" title="没有启用，点击启用">
														<div></div>
													</div>
												</div>
											</a>
											{% endif %}
										</td>
										<td>
											{% if row['display']==1 %}
											<a href="category_manage?action=undisplay&id={{row['id']}}">
												<div class="tpl-switch">
													<input type="radio" class="ios-switch bigswitch tpl-switch-btn" checked="">
													<div class="tpl-switch-btn-view title2div" title="已经显示，点击关闭">
														<div></div>
													</div>
												</div>
											</a>
											{% else %}
											<a href="category_manage?action=display&id={{row['id']}}">
												<div class="tpl-switch">
													<input type="radio" class="ios-switch bigswitch tpl-switch-btn">
													<div class="tpl-switch-btn-view title2div" title="没有显示，点击显示">
														<div></div>
													</div>
												</div>
											</a>
											{% endif %}
										</td>
										<td>
											<div class="am-btn-toolbar">
												<div class="am-btn-group am-btn-group-xs">
													<a href="category_update?cid={{row['id']}}"
														class="am-btn am-btn-default am-btn-xs am-edit-bright am-text-secondary title2div"
														title="编辑栏目"><span class="am-icon-pencil-square-o"></span>&nbsp;编辑</a>
													<a href="category_manage?cid={{row['id']}}"
														class="am-btn am-btn-default am-btn-xs am-son-bright am-hide-sm-only title2div"
														title="显示子栏目"><span class="am-icon-list"></span>&nbsp;子栏目</a>
													<a href="category_manage?{{url['button']}}action=del&id={{row['id']}}"
														class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi title2div"
														title="删除栏目">
														<span class="am-icon-trash-o"></span>&nbsp;删除
													</a>
												</div>
											</div>
										</td>
									</tr>
									{% endfor %}
								</tbody>
							</table>
							{% if not data %}<div class="no-data"><ul>没有相关数据</ul></div>{% endif %}
							<div class="tpl-portlet-input tpl-fz-ml tpl-add-fl">
								<div class="am-btn-toolbar">
									<div class="am-btn-group am-btn-group-xs ng4-width-byn">
										<button class="am-btn am-btn-success" id="addList" type="submit"><span class="am-icon-refresh"></span>&nbsp;更新</button>
									</div>
								</div>
							</div>
							<input type="hidden" name="action" value="sort">
						</form>
					</div>
				</div>
			</div>
			{% include 'component_footer.tpl' %}
		</div>
		</div><!-- /.scrollbar-wrap -->
	</div>
	<script>
		 kg.title2div('title2div');	 //调用此方法， 把该元素的title属性替换成div
	</script>
</body>
</html>