<!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/material_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/material_manage.js"></script>
</head>
	<body data-type="generalComponents">
		{% include 'component_header.tpl' %}
		<div class="tpl-page-container tpl-page-header-fixed">
			{% include 'component_left.tpl' %}
			<div class="tpl-content-wrapper ngco-Osz-marginT">
				<div class="tpl-content-page-title">
					 本地素材库管理
				</div>
				<ol class="am-breadcrumb">
					<li><a href="./" class="am-icon-home">首页</a></li>
					<li class="am-active">
					  本地素材库管理</li>
				</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 am-no-margintop">
							<div class="am-form-group am-fl am-no-marginbtm am-select-hover  am-no-outline" style="margin-right:10px;">
								<select onchange="window.open(this.options[this.selectedIndex].value,'_self')" data-am-selected="{btnSize: 'sm'}"
								 style="display: none;">
									<option {% if type==4 %} selected="selected" {% endif %} value="material_manage?{{url['type']}}type=4">数据筛选</option>
									<option {% if type==0 %} selected="selected" {% endif %} value="material_manage?{{url['type']}}type=0">单图</option>
									<option {% if type==1 %} selected="selected" {% endif %} value="material_manage?{{url['type']}}type=1">多图</option>
									<option {% if type==2 %} selected="selected" {% endif %} value="material_manage?{{url['type']}}type=2">文本</option>
									<!--<option {% if type==3 %} selected="selected" {% endif %} value="material_manage?{{url['type']}}type=3">图文</option>-->
								</select>
							</div>
							<div class="am-form-group am-fl am-no-marginbtm am-select-hover  am-no-outline" style="margin-right:10px;">
								<select onchange="window.open(this.options[this.selectedIndex].value,'_self')" data-am-selected="{btnSize: 'sm'}"
								 style="display: none;">
									<!--<option selected="selected" value="/kgcms_admin/log?type=0">排序</option>-->
									<option {% if sort==0 %} selected="selected" {% endif %} value="material_manage?{{url['sort']}}sort=0">添加时间升序</option>
									<option {% if sort==1 %} selected="selected" {% endif %} value="material_manage?{{url['sort']}}sort=1">添加时间降序</option>
									<!--<option {% if sort==2 %} selected="selected" {% endif %} value="material_manage?{{url['sort']}}sort=2">更新时间降序</option>-->
									<!--<option {% if sort==3 %} selected="selected" {% endif %} value="material_manage?{{url['sort']}}sort=3">更新时间升序</option>n>-->
								</select>
							</div>
							<div class="portlet-input input-small input-inline am-fl">
								<form action="#" method="get" id="search">
									<div class="input-icon right">
										<i class="am-icon-search log-search"></i>
										<input type="text" class="form-control form-control-solid" placeholder="搜索..." name="word" value="{{word}}" id="word">
									</div>
								</form>
							</div>
							  <div class="input-icon right am-fr" style="margin-left: 10px">
								<div class="am-btn-group am-btn-group-xs">
									<a  class="am-btn am-btn-default am-btn-success" href="material_manage"><span class="am-icon-plus"></span>&nbsp;刷新</a>
								</div>
							 </div>

							 <!-- <div class="tpl-portlet-input tpl-fz-ml"> -->
						 <div class="portlet-input input-small input-inline">
							<div class="input-icon right am-fr" style="margin-left: 10px">
								<div class="am-btn-group am-btn-group-xs">
									<a  class="am-btn am-btn-default am-btn-success" href="material_update"><span class="am-icon-plus"></span>&nbsp;添加素材</a>
								</div>
							</div>
						</div>
					</div>

					 <!-- 主体部分 -->
						  <div class="am-g">
							<div class="am-u-sm-12">
								<form class="am-form" action="#" method="post">
									<table class="am-table am-table-striped am-table-hover table-main">
										<thead>
											<tr>
												<!-- <th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th> -->
												<th class="table-check"><input type="checkbox"  id="all" onclick="kg.select_all(this.form);" class="tpl-table-fz-check"></th>
												<th class="table-title">ID</th>
												<th class="table-type">类型</th>
												<th class="table-author 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>
										{% for row in data %}
											<tr>

												<td><input type="checkbox" value="{{row['id']}}" name="id[]"></td>
												<!--<td><input type="checkbox"></td>-->
												<td>{{row['id']}}</td>
												{% if row['type'] == 0 %}<td>单图</td>{% endif %}
												{% if row['type'] == 1 %}<td>多图</td>{% endif %}
												{% if row['type'] == 2 %}<td>文本</td>{% endif %}
												<td><a href="material_update?action=edit&id={{row['id']}}">{{row['name']}}</a></td>
												{% if row['type'] != 2 %}
												<td class="am-hide-sm-only">
													<ul data-am-widget="gallery" class="am-gallery sm-block-grid-2 md-block-grid-3 lg-block-grid-4 am-gallery-default am-no-layout" data-am-gallery="{ pureview: true }">
														{% for pic in row['picture'] %}
														<li style="width: 30px; display: inline-block">
															<img src="{{pic}}" alt="" style="width: 30px;" >
														</li>
														{% endfor %}
													</ul>
												</td>
												{% else %}
												<td class="am-hide-sm-only"></td>
												{% endif %}
												<td class="am-hide-sm-only">{{row['addtime']}}</td>
												<td class="am-hide-sm-only">
													<!-- <img src="/upload/set_web/logo/201909/pencil.png">
													<img src="/upload/set_web/logo/201909/disabled.png"> -->
													<div class="am-btn-toolbar ngre-Hdadd-paddidngT">
														<div class="am-btn-group am-btn-group-xs">
															<a href="material_update?id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-default am-hide-sm-only">
																<span class="am-icon-pencil-square-o"></span>&nbsp;编辑
															</a>
															{% if row['id'] != 1 %}
															 <a href="material_manage?action=del&id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi">
																<span class="am-icon-trash-o"></span>&nbsp;删除
															</a>
															{% endif %}
														</div>
													</div>
												</td>

											</tr>
										{% endfor %}
										</tbody>

									</table>
									{% if not data %}<div class="no-data"><ul>没有相关数据</ul></div>{% endif %}
									<hr>
									{% 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="recom">推荐</option>-->
												<!--<option value="unrecom">取消推荐</option>-->
												{% endif %}
											</select>
										</div>
									</div>
									{% endif %}
									{% if page_data['total_page'] > 1 %}
									{{ page_html }}
									{% endif %}
									<input type="hidden" id="action" name="action" value="">
								</form>
							</div>

						</div>
					</div>



					  <!-- 主体部分结束 -->

				  </div>
					{% include 'component_footer.tpl' %}
				</div>
			</div>
		</div>
	</body>
</html>
