<%@page trimDirectiveWhitespaces="true"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="gen" uri="http://help.jspgen.com/taglib/jstl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<title>模板</title>
<!-- 当前页面 -->
<link type="text/css" href="${config.statie}ui/admin/images/admin.css" rel="stylesheet">
<style type="text/css">
.dir {margin:1px; padding:0; display:inline-block; width:16px; height:16px; background:url(${config.statie}ui/cms/admin/images/ico/16x16/dir.png) no-repeat bottom center;}
.jsp {margin:1px; padding:0; display:inline-block; width:16px; height:16px; background:url(${config.statie}ui/cms/admin/images/ico/16x16/jsp.png) no-repeat bottom center;}
.unknown {margin:1px; padding:0; display:inline-block; width:16px; height:16px; background:url(${config.statie}ui/cms/admin/images/ico/16x16/unknown.png) no-repeat bottom center;}
</style>
</head>
<body>
<div id="wrapper">
  <div class="push">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left"><span class="orange">友情提示：</span>点击模板文件名称即可完成选取操作。</td>
        <td align="right"><gen:if test="${not empty param.parent}"><a href="javascript:void(0);" class="button green tiny prev" uri="${param.parent}"><i></i>上一级</a></gen:if></td>
      </tr>
    </table>
  </div>
  <div class="area">
    <div class="area-content">
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
        <tr>
          <th width="5%">ICO</th>
          <th width="40%" class="border-left">名称</th>
          <th width="15%" class="border-left">大小</th>
          <th width="15%" class="border-left">扩展名</th>
          <th width="25%" class="border-left">最后修改时间</th>
        </tr>
        <gen:if test="${not empty pager.results}">
        <c:forEach items="${pager.results}" var="map">
        <tr class="border-top">
          <td align="center"><span class="<gen:if test="${map.exte == 'dir'}">dir<gen:elseif test="${map.exte == 'jsp'}" />jsp<gen:else />unknown</gen:if>"></span></td>
          <td class="border-left">&nbsp;<gen:if test="${map.exte == 'dir'}"><a href="javascript:void(0);" class="view" uri="${param.parent}${map.name}/">${map.name}</a><gen:else /><a href="javascript:void(0);" class="choose" uri="${param.parent}${map.name}">${map.name}</a><gen:if test="${not empty map.comment}">&nbsp;【${map.comment}】</gen:if></gen:if></td>
          <td align="center" class="border-left">&nbsp;<gen:if test="${map.exte != 'dir'}">${map.size}</gen:if></td>
          <td align="center" class="border-left" title="${map.type}">&nbsp;<gen:if test="${map.exte == 'dir'}">目录<gen:else />${map.exte}</gen:if></td>
          <td align="center" class="border-left">${gen:dateTime(map.lastTime, 'yyyy-MM-dd HH:mm:ss', config.timezoneid)}</td>
        </tr>
        </c:forEach>
        <gen:else />
        <tr class="border-top">
        	<td colspan="5" align="center" class="ignore">暂无数据</td>
        </tr>
        </gen:if>
        <tr class="border-top">
          <th colspan="5"><div class="pages">${pager.pageBar}</div></th>
        </tr>
      </table>
    </div>
  </div>
  <form name="search" method="post"><input name="to" type="hidden" value="${param.to}" /><input name="mobile" type="hidden" value="${param.mobile}" /><input name="parent" type="hidden" value="${param.parent}" /><input name="" type="submit" value="" style="display:none;" /></form>
</div>
<!-- 必备插件 -->
<script type="text/javascript" src="${config.statie}js/jquery.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.form.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.grapes.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.timers.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.tablecolor.js"></script>
<!-- 日期插件 -->
<script type="text/javascript" src="${config.statie}js/datePicker/WdatePicker.js"></script>
<!-- 弹窗插件 -->
<script type="text/javascript" src="${config.statie}js/dialog/jquery.dialog.js?self=true"></script>
<script type="text/javascript" src="${config.statie}js/dialog/jquery.dialog.plugins.js"></script>
<!-- UI界面必备 -->
<script type="text/javascript" src="${config.statie}ui/js/jspgen.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ajax.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ready.js"></script>
<!-- 当前页面 -->

<script type="text/javascript">
// document.domain = "jspgen.com";// 调用
$(document).ready(function(){
	// 变量
	var $prev = $('.push a.prev');
	var $view = $('.table a.view');
	var $choose = $('.table a.choose');
		
	// 目录上一级
	$prev.bind('click', function () {
		var uri = $(this).attr('uri');
		uri = uri.substring(0, uri.lastIndexOf('/', uri.lastIndexOf('/')-1)+1);
		window.location = '?to=${param.to}&parent='+uri;
	});
	
	// 目录进入
	$view.bind('click', function () {
		var uri = $(this).attr('uri');
		window.location = '?to=${param.to}&parent='+uri;
	});
	
	// 选择
	$choose.bind('click', function () {
		$dialogApi.callback({to:'${param.to}', uri:$(this).attr('uri')});
		$dialogApi.close();
	});
});
</script>
</body>
</html>
