<!DOCTYPE html>
<html lang="zh_CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta name="renderer" content="webkit">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-orientation" content="portrait">
    <meta name="browsermode" content="application">
    <meta name="x5-page-mode" content="app">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="email=no">
    <meta name="robots" content="all, index">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon" href="/favicon.ico">
    <link href="{{ static_url('layui/css/layui.css') }}" rel="stylesheet">
    <link href="{{ static_url('css/style.css') }}" rel="stylesheet">
    {% block css %}{% end %}
    {% block title %}{% end %}
  </head>
  <body>
    <header id="header">
      <div class="layui-container">
        <ul class="layui-nav">
          <li class="layui-nav-item"><a href="/">Home</a></li>
          <li class="layui-nav-item">
            <a href="javascript:;">Table</a>
            <dl class="layui-nav-child">
              <dd><a href="/table">upload</a></dd>
              {% for k in handler.tables %}
              <dd><a href="/table/{{ k }}">{{ k }}</a></dd>
              {% end %}
            </dl>
          </li>
          <li class="layui-nav-item">
            <a href="javascript:;">Chart</a>
            <dl class="layui-nav-child">
              <dd><a href="/chart">upload</a></dd>
              {% for k in handler.charts %}
              <dd><a href="/chart/{{ k }}">{{ k }}</a></dd>
              {% end %}
            </dl>
          </li>
            <form class="layui-form" action="/">
              <input class="layui-input" placeholder="搜索" name="q" {% if handler.args.q %}value="{{ handler.args.q }}"{% end %}>
            </form>
        </ul>
      </div>
    </header>

    <div id="content" class="layui-container">
      {% block content %}{% end %}
    </div>

  </body>

  <script src="{{ static_url('js/jquery.min.js') }}"></script>
  <script src="{{ static_url('layui/layui.js') }}"></script>
  <script src="{{ static_url('js/clipboard.min.js') }}"></script>
  <script src="{{ static_url('js/page.js') }}"></script>
  <script>
    layui.use(['element', 'laypage', 'form'], function(){
      var element = layui.element;
      {% if handler.args.total and handler.args.total > 0 %}
      var laypage = layui.laypage;
      var param = parseUrl().param;
      laypage.render({
        elem: 'pagination',
        limit: {{ handler.args.count }},
        count: {{ handler.args.total }},
        curr: param.page || 1,
        layout: ['page', 'count'],
        jump: function(obj, first){
          if(!first){
            param.page = obj.curr
            location.href = location.pathname + '?' + $.param(param)
          }
        }
      });
      {% end %}
    })
  </script>

  {% block js %}{% end %}
</html>
