<%- 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">
                  <input
                    type="text"
                    class="form-control"
                    placeholder="文章名称"
                    value="<%= name %>"
                  />
                </div>
                <div class="card-body table-responsive">
                  <link
                    rel="stylesheet"
                    href="https://cdn.jsdelivr.net/npm/easymde@latest/dist/easymde.min.css"
                  />
                  <script src="https://cdn.jsdelivr.net/npm/easymde@latest/dist/easymde.min.js"></script>
                  <textarea class="form-control"><%= content %></textarea>
                  <script>
                    var easyMDE = new EasyMDE({
                      inputStyle: "contenteditable",
                      spellChecker: false,
                      nativeSpellcheck: false,
                      sideBySideFullscreen: false,
                      hideIcons: ["guide", "fullscreen"],
                      autosave: {
                        enabled: true,
                        uniqueId: "hexoanywhere-<%= name %>",
                        delay: 5000,
                        submit_delay: 5000,
                        timeFormat: {
                          locale: "zh-CN",
                          format: {
                            year: "numeric",
                            month: "2-digit",
                            day: "2-digit",
                            hour: "2-digit",
                            minute: "2-digit",
                          },
                        },
                        text: "自动保存：",
                      },
                      forceSync: true,
                      uploadImage: true,
                    });
                  </script>
                </div>
                <div class="card-footer">
                  <button
                    type="button"
                    class="btn btn-primary"
                    onclick=""
                  >
                    保存草稿
                  </button>
                  <button
                    type="button"
                    class="btn btn-danger float-right"
                    onclick=""
                  >
                    正式发布
                  </button>
                </div>
              </div>
            </div>
            <!-- /.col-md-6 -->
          </div>
          <!-- /.row -->
        </div>
        <!-- /.container-fluid -->
      </div>
      <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <%- include('partial/footer') %>
  </div>
</body>
