{% extends "layout.html" %}
{% block main %}
<div class="ui segment">
  <div class="ui two column very relaxed grid">
    <!-- <div class="column column__edit"> -->
    <div class="container col-sm-12 col-md-8">
      <button id='submit_button' class="btn__submit mb-3" onclick="editorSave()"><b>編輯完成</b></button>
      <h3 style='display: none;' class="h3 column__h3"><i class="fas fa-user-edit mr-1 mb-2"></i> 作品編輯</h3>
      <table class="table table-bordered">
        <tbody>
          <tr style='display: none;'>
            <td>
              <h4>標題</h4>
            </td>
            <td><input class="form-control" id="ctitle" type="text" />
              <div class="mt-1 text-danger">（建議字數：15 字內）</div>
            </td>
          </tr>
          <tr style='display: none;'>
            <td>
              <h4>描述</h4>
            </td>
            <td><textarea class="form-control" rows="3" id="cdescription"></textarea>
              <div class="mt-1 text-danger">（建議字數：50 字內）</div>
            </td>
          </tr>
        </tbody>
      </table>


      <div class="d-none">
        <input id="cdate" type="text" /><br />
        <input id="cdraft" type="text" /><br />
        <input id="cdisplay" type="text" /><br />
        <input id="ctype" type="text" /><br />
        <input id="curl" type="text" /><br />
        <input id="cimage" type="text" /><br />
        <input id="cnewcoverimg" type="text" /><br />
        <input id="cweight" type="text" /><br />
        <input id="ctag" type="text" /><br />
        <input id="ctags" type="text" /><br />
        <input id="ccategories" type="text" /><br />
        <input id="ccaturl" type="text" /><br />
        <input id="ccol1" type="text" /><br />
        <input id="ccol2" type="text" /><br />
        <input id="cblogtags" type="text" />
      </div>

      <!-- <div class="mb-2"> -->
      <!-- title:<input id="ctitle" type="text" /><br />
        date:<input id="cdate" type="text" /><br />
        draft:<input id="cdraft" type="text" /><br />
        type:<input id="ctype" type="text" /><br />
        url:<input id="curl" type="text" /><br />
        image:<input id="cimage" type="text" /><br />
        description:<input id="cdescription" type="text" /><br />
        weight:<input id="cweight" type="text" /><br />
        tag:<input id="ctag" type="text" /><br /> -->
      <!-- <button class="btn__arTitle mb-2" id="title_button">標題修改</button> -->
      <!-- </div> -->

      <h3 class="h3 column__h3"><i class="fa fa-file-text mr-2 mb-2"></i> 內容編輯</h3>
      <!--<p class="card">
        <div class="card-body">
          標題 <span class="mt-1 text-danger">（建議字數：15 字內）</span>
          <div><input class="form-control" id="ctitle" type="text" /></div>
        </div>
      </p>
      <p class="card">
        <div class="card-body">
          說明
          <div><textarea class="form-control" id="cdescription" rows=2 type="paragraph"></textarea></div>
        </div>
      </p>-->
      <p class="card">
      <div class="card-body">
        Meta 標題
        <div><input class="form-control" id="cmetattl" type="text" /></div>
      </div>
      </p>
      <p class="card">
      <div class="card-body">
        Meta 說明
        <div><input class="form-control" id="cmetadsc" type="text" /></div>
      </div>
      </p>
      {% block extras %}{% endblock %}
      <p class="card">
      <div class="card-body">
        文章內容
        <div id="editorjs"></div>
      </div>
      </p>
      <div id="editor_block"><span><button class="btn__arTitle mb-2"
            id="add_title_button">+標題</button></span><span><button class="btn__arTitle mb-2"
            id="add_img_button">+圖</button></span><span><button class="btn__arTitle mb-2"
            id="add_para_button">+段落</button></span></span><span><button class="btn__arTitle mb-2"
            id="add_hr_button">+換行</button></span><span><button class="btn__arTitle mb-2"
            id="add_mt5_button">+mt5</button></span>
      </div>
      <br />
      {% block extratwo %}{% endblock %}
      <div>
        <button id='submit_button' class="btn__submit mb-3" onclick="editorSave()"><b>編輯完成</b></button>
      </div>
    </div>
    <!-- <div class="column column__preview">
      <h3 class="h3 column__h3"><i class="fas fa-eye mr-2"></i>預覽頁面</h3>
      <iframe src='{{ bhouse_server }}{{ url }}/' width="100%" height="100%"></iframe>
    </div> -->
  </div>
</div>
<script type="text/json" id="url">{"url": "{{ url }}"}</script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="{{url_for('static', filename='config.js')}}"></script>
<!-- <script type="text/javascript" src="{{url_for('static', filename='js/utils.js')}}"></script>
<script type="text/javascript" src="{{url_for('static', filename='js/blockElements.js')}}"></script>
<script type="text/javascript" src="{{url_for('static', filename='js/blockHandler.js')}}"></script> -->

<!-- Load Editor.js's Core -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>

<script src="https://cdn.jsdelivr.net/npm/@editorjs/header@latest"></script><!-- Header -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/image@latest"></script><!-- Image -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/delimiter@latest"></script><!-- Delimiter -->
<!-- <script src="https://cdn.jsdelivr.net/npm/@editorjs/simple-image@latest"></script> -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/code@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/embed@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/warning@latest"></script>

<script type="text/javascript" src="{{url_for('static', filename='js/yo.js')}}"></script>
<script type="text/javascript" src="{{url_for('static', filename='js/editor.js')}}"></script>
<script type="text/javascript" src="{{url_for('static', filename='js/table.js')}}"></script>
<script>//alert('yo');</script>
</div>
{% endblock main %}