image_list.html 4.95 KB
<% 
	var headContent = {
	include("/pages/template/head.html"){}
%>

<script type="text/javascript">
		
	var oper;
	jQuery(function($) {
		// 页面方法
		oper = {
			width : 800,
			height : 500,
			form : document.form1,
			list : function() {
				var url = 'admin/image/list';
				this.form.action = url;
				this.form.submit();
			},
			view : function(id) {
				var url = 'admin/image/view/'+id;
				var title = '查看图片';
				Iframe(url, this.width, this.height, title, false, false, false, EmptyFunc);
			},
			add : function() {
				var url = 'admin/image/add?model.album_id='+$('#album_id').val();
				var title = '添加图片';
				Iframe(url, this.width, this.height, title);
			},
			edit : function(id) {
				var url = 'admin/image/edit/'+id;
				var title = '修改图片';
				Iframe(url, this.width, this.height, title);
			},
			del : function(id) {
				var url = 'admin/image/delete/'+id;
				var title = '确认要删除该图片信息?';
				Confirm(title, function() {
					form1.action = url;
					form1.submit();
				});
			}
		};
		//显示Menu索引
		showMenu('page_image');
	});
	
	//分页
	var paginator = function(page) {
		oper.list();
	};
</script>

<%
};

var bodyContent = {
%>
	<form name="form1" action="" method="post"  class="form-inline" role="form">
		<input type="hidden" name="form.orderColumn" value="${form.orderColumn!''}" />
		<input type="hidden" name="form.orderAsc" value="${form.orderAsc!''}" />
		<!-- 菜单 -->
		<% include("/pages/template/menu.html"){} %>

		<div class="tableSearch">
			<%  //查询列表 %>
			<div class="form-group">
				<select id="album_id" name="attr.album_id" class="form-control" >
				<option value="-1">--请选择--</option>
				${selectAlbum }
				</select>
			</div>
			<div class="form-group">
					<input class="form-control" type="text" name="attr.name" value="${attr.name!''}" 
						placeholder="请输入名称" required='required' />
			</div>
			<div class="form-group">
					<select name="attr.status" class="form-control" >
					<option value="-1">--请选择--</option>
					<option value="1" ${attr.status==1?'selected':''}>显示</option>
					<option value="2" ${attr.status==2?'selected':''}>隐藏</option>
					</select>
			</div>
			
			<button type="button" class="btn btn-default" onclick="oper.list();" name="search">
			 		<span class="glyphicon glyphicon-search"></span> 查 询
			</button>
			<button type="button" class="btn btn-default" onclick="resetForm();">
			 		<span class="glyphicon glyphicon-refresh"></span> 重 置
			</button>
			<button type="button" class="btn btn-default" onclick="oper.add();">
			 		<span class="glyphicon glyphicon-plus"></span> 新 增
			</button>
		</div>
		
		<!-- 数据列表 -->
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>序号</th>
					<%  // 列表头部 %>
					<th name="album_name" class="sorting">相册名称</th> 
					<th name="name" class="sorting">图片名称</th> 
					<th>图片</th> 
					<th name="status" class="sorting">状态</th> 
					<th name="is_comment" class="sorting">是否评论</th> 
					<th name="is_recommend" class="sorting">是否推荐</th> 
					<th name="sort" class="sorting">排序</th> 
					<th name="publish_time" class="sorting">发布时间</th> 
					<th name="publish_user" class="sorting">发布者</th> 
					<th name="create_time" class="sorting">创建时间</th> 
 					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			<% for(item in page.list){ %>
				<tr>
				<td>${itemLP.index }</td>
					<%  // 列表内容 %>
					<td>${item.album_name}</td> 
					<td>${item.name}</td> 
					<td>
					<% if(!strutil.isEmpty(item.image_url)||!strutil.isEmpty(item.image_net_url)){ %>
						<a href="${flyfox.getImage(item)}" target="_blank" style="text-decoration:none;">
							<img alt="图片" title="点击浏览" src="${flyfox.getImage(item)}" width="40" height="40">
						</a>
					<% } %>
					</td> 
					<td>
					<% if(item.status==2) { %>
					隐藏
					<%	} %>
					<% if(item.status==1) { %>
					显示
					<%	} %>
					</td>  
					<td>
					<% if(item.is_comment==2) { %>
					否
					<%	} %>
					<% if(item.is_comment==1) { %>
					是
					<%	} %>
					</td>  
					<td>
					<% if(item.is_recommend==2) { %>
					否
					<%	} %>
					<% if(item.is_recommend==1) { %>
					是
					<%	} %>
					</td> 
					<td>${item.sort}</td> 
					<td>${item.publish_time}</td> 
					<td>${item.publish_user}</td> 
					<td>${item.create_time}</td> 
				<td>
				<a href="javascript:void(0);" class="btn btn-sm btn-success" onclick="oper.view(${item.id});">查看</a> 
				<a href="javascript:void(0);" class="btn btn-sm btn-primary" onclick="oper.edit(${item.id});">修改</a> 
				<a href="javascript:void(0);" class="btn btn-sm btn-danger" onclick="oper.del(${item.id});">删除</a>
				</td>
				</tr>
			<% } %>
			</tbody>
		</table>
		<%include("/pages/includes/paginator.html"){} %>
	</form>
<%}; %>


<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>