<%- include('partial/head') %>

<body class="hold-transition sidebar-mini">
  <div class="wrapper">
    <%- include('partial/navbar') %> <%- include('partial/sidebar') %>
    <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <div class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6">
              <h1 class="m-0">草稿列表</h1>
            </div>
            <!-- /.col -->
            <div class="col-sm-6">
              <ol class="breadcrumb float-sm-right">
                <li class="breadcrumb-item"><a href="/dash">控制台</a></li>
                <li class="breadcrumb-item active">草稿列表</li>
              </ol>
            </div>
            <!-- /.col -->
          </div>
          <!-- /.row -->
        </div>
        <!-- /.container-fluid -->
      </div>
      <!-- /.content-header -->

      <!-- Main content -->
      <div class="content">
        <div class="container-fluid">
          <div class="row">
            <div class="col-lg-12">
              <div class="card">
                <div class="card-body table-responsive">
                  <table class="table table-striped table-valign-middle">
                    <thead>
                      <tr>
                        <th nowrap="">草稿名称</th>
                        <th nowrap="">管理操作</th>
                      </tr>
                    </thead>
                    <tbody>
                      <% for (var draft in drafts) { %>
                      <tr>
                        <td><%= drafts[draft].name %></td>
                        <td>
                          <button
                            type="button"
                            class="btn btn-primary"
                            onclick="javascript:window.location.href='/dash/editor/draft/<%= drafts[draft].name %>'"
                          >
                            编辑
                          </button>
                          <button
                            type="button"
                            class="btn btn-danger"
                            onclick=""
                          >
                            删除
                          </button>
                        </td>
                      </tr>
                      <% } %>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
            <!-- /.col-md-6 -->
          </div>
          <!-- /.row -->
        </div>
        <!-- /.container-fluid -->
      </div>
      <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <%- include('partial/footer') %>
  </div>
</body>
