<!DOCTYPE html>
<html lang="zh_CN">

  <head>
    <meta charset="utf-8">
    <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">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon" href="/favicon.ico">
    <link rel="stylesheet" href="{{ static_url('src/layui/css/layui.css') }}">
    <link rel="stylesheet" href="{{ static_url('src/css/monokai_sublime.css') }}">
    <link rel="stylesheet" href="{{ static_url('src/css/style.css') }}">
    <title>File Server</title>
  </head>

  <body>
    <header id="header">
      <div class="layui-container">
        <a class="logo" href="/"><i class="layui-icon layui-icon-home"></i> Home</a>
        <ul class="layui-nav">
          {% if handler.app.options.auth %}
          <li class="layui-nav-item"><a href="/disk/public"><i class="layui-icon layui-icon-heart"></i>Public</a></li>
          {% end %}
          {% if handler.app.options.tools %}
          <li class="layui-nav-item"><a href="/chart"><i class="layui-icon layui-icon-chart-screen"></i>Chart</span></a></li>
          <li class="layui-nav-item"><a href="/table"><i class="layui-icon layui-icon-table"></i>Table</span></a></li>
          {% end %}
          <li class="layui-nav-item">
            <form class="pc layui-form">
              <input class="layui-input" placeholder="搜索" name="q" {% if handler.args.q %}value="{{ handler.args.q }}"{% end %}>
            </form>
          </li>
        </ul>
        {% if handler.app.options.auth %}
        <ul class="layui-nav nav-right" lay-filter="">
          <li class="layui-nav-item logout layui-hide">
            <a href="javascript:;"><span class="username"></span></a>
            <dl class="layui-nav-child">
              <dd><a href="/admin">用户中心</a></dd>
              <dd><a href="/disk/public">公共文件</a></dd>
              <dd><a href="/share">我的分享</a></dd>
              <dd class="layui-hide user-admin"><a href="/manage">用户管理</a></dd>
              <dd><a class="user-logout" href="/logout">退出</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item login layui-hide"><a href="/signin">登录</a></li>
          <li class="layui-nav-item login layui-hide"><a href="/signup">注册</a></li>
        </ul>
        {% end %}
      </div>
    </header>
    <div id="content">
      {% block page-content %}
      <div class="layui-container">{% block content %}{% end %}</div>
      {% end %}
    </div>

  </body>
  <script src="{{ static_url('src/layui/layui.js') }}"></script>
  <script src="{{ static_url('src/js/jquery.min.js') }}"></script>
  <script src="{{ static_url('src/js/highlight.pack.min.js') }}"></script>
  <script src="{{ static_url('src/js/clipboard.min.js') }}"></script>
  <script src="{{ static_url('src/js/webuploader.nolog.min.js') }}"></script>
  <script src="{{ static_url('src/js/imagesloaded.pkgd.min.js') }}"></script>
  <script src="{{ static_url('src/js/masonry.pkgd.min.js') }}"></script>
  <script src="{{ static_url('src/js/utils.js') }}"></script>
  <script src="{{ static_url('src/js/page.js') }}"></script>

  </script>
  <script>
    layui.use(['laypage', 'util'], function () {
      layui.util.fixbar();
      if(layui.$('#pagination').length >= 1){
        var params = parseUrl().params;
        layui.laypage.render({
          elem: 'pagination',
          limit: {{ handler.args.count }},
          count: {{ handler.args.total }},
          curr: {{ handler.args.page }},
          limits: [50, 100, 200, 300, 500],
          layout: ['page', 'count', 'limit'],
          jump: function(obj, first){
            if(!first){
              params.page = obj.curr;
              params.count = obj.limit;
              location.href = location.pathname + '?' + layui.$.param(params);
            }
          }
        })
      }
    })
  </script>

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