{% extends "fladmin/public/base.html" %}
{% block title %}单页列表{% endblock %}

{% block content %}
<script type="text/javascript" src="{{'CMS_BASEHOST'|sysconfig}}/static/js/jquery-bootstrap-pagination.js"></script>
<h2 class="sub-header">单页管理</h2>[ <a href="{{'CMS_BASEHOST'|sysconfig}}/fladmin/page/add">增加一个页面</a> ]<br><br>

<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead>
<tr>
  <th>编号</th>
  <th>页面名称</th>
  <th>别名</th>
  <th>更新时间</th>
  <th>管理</th>
</tr>
</thead>
<tbody>
{% for row in list %}
<tr>
  <td>{{row.id}}</td>
  <td><a href="{{'CMS_BASEHOST'|sysconfig}}/fladmin/page/edit?id={{row.id}}">{{row.title}}</a></td>
  <td>{{row.filename}}</td>
  <td>{{row.update_time|date}}</td>
  <td><a target="_blank" href="/page/{{row.filename}}.html">预览</a>&nbsp;<a href="{{'CMS_BASEHOST'|sysconfig}}/fladmin/page/edit?id={{row.id}}">修改</a>&nbsp;
    <a onclick="delconfirm('{{"CMS_BASEHOST"|sysconfig}}/fladmin/page/delete?id={{row.id}}')" href="javascript:;">删除</a></td>
</tr>
{% endfor %}
</tbody>
</table></div><!-- 表格结束 --></form><!-- 表单结束 -->

<form id="searcharc" class="navbar-form" action="{{'CMS_BASEHOST'|sysconfig}}/fladmin/page/index" method="get">
<div class="form-group"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
<button type="submit" class="btn btn-info" value="Submit">搜索一下</button></form>

<ul class="pagination" style="margin: 0 20px 0 20px;">
  </ul>
<script>
  //进行查询
  function query(e,page){
      window.location.href= '?page='+page
  }

  //这里回调
  $(".pagination").unbind();
  $(".pagination").pagination({
      total_pages:{{ page.total_page }},
      current_page:{{ page.current_page }},
      callback:query
  });
</script>
{% endblock %}