<!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/article_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/article_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">
				<li><a href="./" class="am-icon-home">首页</a></li>
				{% if trash == 1 %}
				<li><a href="article_manage">文章列表</a></li>
				<li class="am-active">回收站</li>
				{% else %}
				<li class="am-active">文章内容管理</li>
				{% endif %}
			</ol>
			<div class="tpl-portlet-components">
				<div class="portlet-title clearfix">
					<div class="caption font-green bold">
						<span class="am-icon-code"></span>&nbsp;文章内容管理
					</div>
					<ul class="list-inline ngsty-boxR">
								<li>
									<!-- 所有栏目 -->
									<div class="ng-width-box am-no-marginbtm am-no-outline">
										<select onchange="window.open(this.options[this.selectedIndex].value,'_self')" data-am-selected="{searchBox: 1}" name="menu" class="" style="display: none;" id="selected-search2">
											{% set cate = category|length %}
											{% if cate > 1 %}
											{% for row in category %}
											{% if row['id'] == cid %}
											<option selected="selected" value="article_manage?{{url['category']}}cid={{row['id']}}">
												{%- if row['level'] > 1 -%}
												├
												{%- for i in range(row['level']-1) -%}
												───
												{%- endfor -%}
												{%- endif -%}
												{{row['title']}}</option>
											{% else %}
											<option value="article_manage?{{url['category']}}cid={{row['id']}}">
												{%- if row['level'] > 1 -%}
												├
												{%- for i in range(row['level']-1) -%}
												───
												{%- endfor -%}
												{%- endif -%}
												{{row['title']}}</option>
											{% endif %}
											{% endfor %}
											{% endif %}
										</select>
									</div>
								</li>
								<li>
									<!-- 内容ID降序 -->
									<div class=" am-select-hover am-no-marginbtm am-no-outline" >
										<select onchange="window.open(this.options[this.selectedIndex].value,'_self')" data-am-selected="{sbtnSize: 'sm'}">
											<option {% if sort==0 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=0">内容ID降序</option>
											<option {% if sort==1 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=1">内容ID升序</option>
											<option {% if sort==2 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=2">发布时间降序</option>
											<option {% if sort==3 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=3">发布时间升序</option>
											<option {% if sort==4 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=4">点击次数降序</option>
											<option {% if sort==5 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=5">点击次数升序</option>
											<option {% if sort==6 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=6">评论人数降序</option>
											<option {% if sort==7 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=7">评论人数升序</option>
											<option {% if sort==8 %} selected="selected" {% endif %} value="article_manage?{{url['sort']}}sort=8">自定义排序值</option>
										</select>
									</div>
								</li>
								<li>
									<!-- 数据筛选 -->
									<div class=" am-select-hover am-no-marginbtm am-no-outline" >
										<select onchange="window.open(this.options[this.selectedIndex].value,'_self')" data-am-selected="{btnSize: 'sm'}">
											<option {% if filter==0 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=0">数据筛选</option>
											<option {% if filter==1 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=1">推荐的内容</option>
											<option {% if filter==2 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=2">不推荐的内容</option>
											<option {% if filter==3 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=3">已发布的内容</option>
											<option {% if filter==4 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=4">草稿</option>
											<option {% if filter==5 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=5">已审核的内容</option>
											<option {% if filter==6 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=6">未审核的内容</option>
											<option {% if filter==7 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=7">允许评论的内容</option>
											<option {% if filter==8 %} selected="selected" {% endif %} value="article_manage?{{url['filter']}}filter=8">不允许评论的内容</option>
										</select>
									</div>
								</li>
								<li>
									<!-- 搜索...-->
									<div class="portlet-input input-small input-inline ">
										<form action="#" method="get" id="search">
											<div class="input-icon right">
												<i class="am-icon-search log-search"></i>
												<input type="text" class="ngar-Vxiugai-radius form-control am-hover form-control-solid ngco-Alo-Noborder" placeholder="搜索..." name="word" value="{{word}}" id="word">
											</div>
										</form>
									</div>
							
						</li>
						<li>
							<!-- 按钮 -->
							<div class="am-btn-group am-btn-group-xs">
								<a href="article_manage?{{ kg['run_start_time'][1] }}" class="am-btn am-btn-secondary ng-add-hightB"><span class="am-icon-search"></span>&nbsp;刷新</a>
								<a class="am-btn am-btn-default am-btn-warning" href="article_update"><span class="am-icon-plus"></span>&nbsp;添加文章</a>
								<a class="am-btn am-btn-default am-btn-success" href="article_manage?trash=1"><span class="am-icon-recycle"></span>&nbsp;回收站</a>
							</div>
						</li>
					</ul>
				</div>
				<div class="tpl-block ngALL-AFenyeFu-marginT">
					<div class="am-g">
						<div class="am-u-sm-12 ngco-No-paddingR">
							<form class="am-form" action="#" method="get" id="am-form">
								<!-- <div class="ngco-Kfubox 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-check">
												<div class="ngjs-ziLi1 ngco-inbl-display"><input type="checkbox" id="all" onclick="kg.select_all(this.form);" class="tpl-table-fz-check"></div>
											</li>
											<li class="table-id">
												<div class="ngjs-ziLi2 ngco-inbl-display">ID</div>
											</li>
											<li class="table-title">
												<div class="ngjs-ziLi3 ngco-inbl-display">标题</div>
											</li>
											<li class="table-type">
												<div class="ngjs-ziLi4 ngco-inbl-display">类别</div>
											</li>
											<li class="table-date am-hide-sm-only">
												<div class="ngjs-ziLi6 ngco-inbl-display">发布时间</div>
											</li>
											<li class="table-date am-hide-sm-only">
												<div class="ngjs-ziLi7 ngco-inbl-display">创建时间</div>
											</li>
											<li class="table-set">
												<div class="ngjs-ziLi8 ngco-inbl-display">操作</div>
											</li>
										</ul>
									</div>
									{% if not data %}<div class="no-data">
										<ul>没有相关数据</ul>
									</div>{% endif %}
									<div class="change-tbody">
										{% for row in data %}
										<ul class="change-tr-td change-nth ngjs-Hul ngjs-fu">
											<li>
												<div class="ngjs-ziLi1 ngco-inbl-display li-div1"><input type="checkbox" name='id' value="{{row['id']}}"></div>
											</li>
											<li>
												<div class="ngjs-ziLi2 ngco-inbl-display li-div2">{{row['id']}}</div>
											</li>
											{% if word %}
											<li>
												<div class="ngjs-ziLi3 ngco-inbl-display li-div3"><a href="/{{row['url']}}" target="_blank">{{ row['title']|replace(word,'<b style="color:red">'+word+'</b>') }}</a></div>
											</li>
											{% else %}
											<li>
												<div class="ngjs-ziLi3 ngco-inbl-display li-div3"><a href="/{{row['url']}}" target="_blank">{{ row['title'] }}</a></div>
											</li>
											{% endif %}
											<li>
												<div class="ngjs-ziLi4 ngco-inbl-display li-div4">{{row['category_title']}}</div>
											</li>
											<li class="am-hide-sm-only">
												<div class="ngjs-ziLi6 ngco-inbl-display li-div5">{{row['pushtime']}}</div>
											</li>
											<li class="am-hide-sm-only">
												<div class="ngjs-ziLi7 ngco-inbl-display li-div6">{{row['addtime']}}</div>
											</li>
											<li>
												{% if trash == 1 %}
												<div class="ngjs-ziLi8 ngco-inbl-display li-div7">
													<a href="article_manage?{{url['button']}}action=recovery&id={{row['id']}}" title="修改文章内容" class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span>&nbsp;还原 </a>
													<a href="article_manage?action=del_true&id={{row['id']}}" title="删除文章内容" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi"><span class="am-icon-trash-o"></span>&nbsp;删除</a>
												 </div>
												{% else %}
												<div class="ngjs-ziLi8 ngco-inbl-display li-div7">
													<div class="am-btn-toolbar ngco-TNo-paddingLR">
														<div class="am-btn-group am-btn-group-xs ngco-TNo-paddingLR">
															<a href="article_update?id={{row['id']}}" title="修改文章内容" class="am-btn am-btn-default am-btn-xs am-text-secondary title2div"><span class="am-icon-pencil-square-o"></span>&nbsp;编辑
															</a>
															{% if row['published'] ==1 %}
															<a href="article_manage?{{url['button']}}action=unpublished&id={{row['id']}}" title="已发布，点击设置为草稿" class="am-btn am-btn-default am-btn-xs am-publish-bright title2div"><span class="am-icon-archive"></span>&nbsp;草稿</a>
															{% else %}
															<a href="article_manage?{{url['button']}}action=published&id={{row['id']}}" title="还没有发布，点击发布" class="am-btn am-btn-default am-btn-xs am-button-dark title2div"><span class="am-icon-archive"></span>&nbsp;发布</a>
															{% endif %}
															{% if row['recom'] == 1 %}
															<a href="article_manage?{{url['button']}}action=unrecom&id={{row['id']}}" title="已经推荐，点击取消推荐" class="am-btn am-btn-default am-btn-xs am-hide-sm-only am-text-warning am-recom-bright title2div"><span class="am-icon-star-o "></span>&nbsp;取消</a>
															{% else %}
															<a href="article_manage?{{url['button']}}action=recom&id={{row['id']}}" title="还没有推荐，点击设置为推荐" class="am-btn am-btn-default am-btn-xs am-hide-sm-only am-text-warning am-button-dark title2div"><span class="am-icon-star-o "></span>&nbsp;推荐</a>
															{% endif %}
															{% if row['audit'] == 1 %}
															<a href="article_manage?{{url['button']}}action=unaudit&id={{row['id']}}" title="已经审核，点击取消审核" class="am-btn am-btn-default am-btn-xs am-hide-sm-only am-text-warning am-audit-bright title2div"><span class="am-icon-pencil "></span>&nbsp;取消</a>
															{% else %}
															<a href="article_manage?{{url['button']}}action=audit&id={{row['id']}}" title="未通过审核，点击设置为审核" class="am-btn am-btn-default am-btn-xs am-hide-sm-only am-text-warning am-button-dark title2div"><span class="am-icon-pencil "></span>&nbsp;审核</a>
															{% endif %}
															<a href="article_manage?action=del&id={{row['id']}}" title="删除文章内容" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi title2div"><span class="am-icon-trash-o"></span>&nbsp;删除</a>
														</div>
													</div>
												</div>
												{% endif %}
											</li>
										</ul>
										{% endfor %}
										<input type="hidden" name="action" id="action" value="">
									</div>
								</div> -->
								<table class="ngco-Kfubox am-table am-table-striped am-table-hover table-main ngco-Esz-mgibdr">
									<thead>
										<tr>
											<!-- 1 -->
											<th class="table-check">
												<div class="ngjs-ziLi1 ngco-inbl-display"><input type="checkbox" id="all" onclick="kg.select_all(this.form);" class="tpl-table-fz-check" style="margin-top: 0;vertical-align: middle;"></div>
											</th>
											<!-- 2 -->
											<th class="table-id">
												<div class="ngjs-ziLi2 ngco-inbl-display">ID</div>
											</th>
											<!-- 3 -->
											<th class="table-title">
												<div class="ngjs-ziLi3 ngco-inbl-display">标题</div>
											</th>
											<!-- 4 -->
											<th class="table-type">
												<div class="ngjs-ziLi4 ngco-inbl-display">类别</div>
											</th>
											<!-- 6 -->
											<th class="table-date am-hide-sm-only">
												<div class="ngjs-ziLi6 ngco-inbl-display">发布时间</div>
											</th>
											<!-- 7 -->
											<th class="table-date am-hide-sm-only">
												<div class="ngjs-ziLi7 ngco-inbl-display">创建时间</div>
											</th>
											<!-- 8 -->
											<th class="table-set">
												<div class="ngjs-ziLi8 ngco-inbl-display">操作</div>
											</th>
										</tr>
									</thead>
									<tbody>
										{% for row in data %}
										<tr class="ngjs-Hul ngjs-fu">
											<!-- 1 -->
											<td>
												<div class="ngjs-ziLi1 ngco-inbl-display li-div1"><input type="checkbox" name='id' value="{{row['id']}}" style="vertical-align: middle;"></div>
											</td>
											<!-- 2 -->
											<td>
												<div class="ngjs-ziLi2 ngco-inbl-display li-div2">{{row['id']}}</div>
											</td>
											<!-- 3 -->
											{% if word %}
											<td>
												<div class="ngjs-ziLi3 ngco-inbl-display li-div3"><a href="/{{row['url']}}" target="_blank">{{ row['cut_title']|replace(word,'<b style="color:red">'+word+'</b>') }}</a></div>
											</td>
											{% else %}
											<td>
												<div class="ngjs-ziLi3 ngco-inbl-display li-div3"><a href="/{{row['url']}}" target="_blank">{{ row['cut_title'] }}</a></div>
											</td>
											{% endif %}
											<!-- 4 -->
											<td>
												<div class="ngjs-ziLi4 ngco-inbl-display li-div4">{{row['category_title']}}</div>
											</td>
											<!-- 6 -->
											<td class="am-hide-sm-only">
												<div class="ngjs-ziLi6 ngco-inbl-display li-div5">{{row['pushtime']}}</div>
											</td>
											<!-- 7 -->
											<td class="am-hide-sm-only">
												<div class="ngjs-ziLi7 ngco-inbl-display li-div6">{{row['addtime']}}</div>
											</td>
											<!-- 8 -->
											<td>
												{% if trash == 1 %}
												<div class="ngjs-ziLi8 ngco-inbl-display li-div7">
													<a href="article_manage?{{url['button']}}action=recovery&id={{row['id']}}" title="修改文章内容" class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span>&nbsp;还原 </a>
													<a href="article_manage?action=del_true&id={{row['id']}}" title="删除文章内容" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi"><span class="am-icon-trash-o"></span>&nbsp;删除</a>
												</div>
												{% else %}
												<div class="am-btn-toolbar li-div7">
													<div class="am-btn-group am-btn-group-xs">
														<div class="am-btn-group am-btn-group-xs ngco-TNo-paddingLR">
															<a href="article_update?id={{row['id']}}" title="修改文章内容" class="am-btn am-btn-default am-btn-xs am-text-secondary title2div"><span class="am-icon-pencil-square-o"></span>&nbsp;编辑</a>
															{% if row['published'] ==1 %}
															<a href="article_manage?{{url['button']}}action=unpublished&id={{row['id']}}" title="已发布，点击设置为草稿" class="am-btn am-btn-default am-btn-xs am-publish-bright title2div"><span class="am-icon-archive"></span>&nbsp;草稿</a>
															{% else %}
															<a href="article_manage?{{url['button']}}action=published&id={{row['id']}}" title="还没有发布，点击发布" class="am-btn am-btn-default am-btn-xs am-button-dark title2div"><span class="am-icon-archive"></span>&nbsp;发布</a>
															{% endif %}
															{% if row['recom'] == 1 %}
															<a href="article_manage?{{url['button']}}action=unrecom&id={{row['id']}}" title="已经推荐，点击取消推荐" class="am-btn am-btn-default am-btn-xs am-hide-sm-only am-text-warning am-recom-bright title2div"><span class="am-icon-star-o "></span>&nbsp;取消</a>
															{% else %}
															<a href="article_manage?{{url['button']}}action=recom&id={{row['id']}}" title="还没有推荐，点击设置为推荐" class="am-btn am-btn-default am-btn-xs am-hide-sm-only am-text-warning am-button-dark title2div"><span class="am-icon-star-o "></span>&nbsp;推荐</a>
															{% endif %}
															{% if row['audit'] == 1 %}
															<a href="article_manage?{{url['button']}}action=unaudit&id={{row['id']}}" title="已经审核，点击取消审核" class="am-btn am-btn-default am-btn-xs am-hide-sm-only am-text-warning am-audit-bright title2div"><span class="am-icon-pencil "></span>&nbsp;取消</a>
															{% else %}
															<a href="article_manage?{{url['button']}}action=audit&id={{row['id']}}" title="未通过审核，点击设置为审核" class="am-btn am-btn-default am-btn-xs am-hide-sm-only am-text-warning am-button-dark title2div"><span class="am-icon-pencil "></span>&nbsp;审核</a>
															{% endif %}
															<a href="article_manage?action=del&id={{row['id']}}" title="删除文章内容" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi title2div"><span class="am-icon-trash-o"></span>&nbsp;删除</a>
														</div>
													</div>
												</div>
												{% endif %}
											</td>
										</tr>
										{% endfor %}
										<input type="hidden" name="action" id="action" value="">
									</tbody>
								</table>
								{% if not data %}<div class="no-data">
										<ul>没有相关数据</ul>
									</div>{% endif %}
								{% if page_data['total_rows'] %}
								<div class="am-u-sm-12 am-u-md-6">
									<div class="am-btn-toolbar ng-xno-borderL" id="select-handle">
										<span class="am-input-group-btn add-span">
											<a class="add am-btn am-btn-default am-select am-back ngco-Ono-radiusR" href="javascript:; ">全选</a>
										</span>
										<select class="am-select-hover" data-am-selected="{btnSize: 'sm'}" style="display: none;">
											<option selected="selected" value='0'>将选中项：</option>
											{% if trash == 1 %}
											<option value="recovery">还原</option>
											<option value="del_true">彻底删除</option>
											{% else %}
											<option value="audit">审核</option>
											<option value="unaudit">取消审核</option>
											<option value="del">删除</option>
											<option value="del_true">彻底删除</option>
											<option value="published">发布内容</option>
											<option value="unpublished">设为草稿</option>
											<option value="recom">推荐</option>
											<option value="unrecom">取消推荐</option>
											{% endif %}
										</select>
									</div>
								</div>
								{% endif %}
							</form>
							{% if page_data['total_page'] > 1 %}
							{{branch}}
							{% endif %}
						</div>
					</div>
				</div>
			</div>
			{% include 'component_footer.tpl' %}
		</div>
		</div><!-- /.scrollbar-wrap -->
	</div>
	<script>
	kg.title2div('title2div'); //调用此方法， 把该元素的title属性替换成div
	</script>
</body>
</html>