{{define "base"}}
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" >
    <title>BrainMinder</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="manifest" href="/static/manifest.json" />
    <link rel="stylesheet" href="/static/bootstrap-icons/font/bootstrap-icons.min.css" />
    <link rel="stylesheet" href="/static/easymde/easymde.min.css" />
    <link rel="stylesheet" href="/static/css/slimselect.css" />
    <link rel="stylesheet" href="/static/css/main.css" />
    <link rel="icon" type="image/svg+xml" href="/static/img/brainminder-icon.svg">
    
    {{block "page:meta" . }}
    {{ end }}
  </head>
  <body class="base" hx-headers='{"X-CSRF-TOKEN": "{{ .CSRFToken }}"}'>
  {{template "partial:sidebar" .}}
  <div id="page-main">
    <div id="page-top-bar">
      <div id="page-title-container">
        <a class="hide-large" onclick="bm_toggle_sidebar('main-sidebar'); return false" href="#" style="float: left;">
          <img src="/static/img/brainminder.svg" alt="BrainMinder" class="logo" />
        </a>
        <div id="page-title">{{template "page:title" .}}</div>
        <div id="search-bar" class="show-large">
          <form method="POST" hx-post="/items/search" hx-target="#page-content" hx-push-url="true" style="float: left">
          <input type="text" id="search-text" name="SearchText" class="bar-item" placeholder="Search.." />
          <button type="submit"><i class="bi bi-search"></i></button>
          </form>
          <a class="button" style="position: relative; top: 4px;" onclick="bm_toggle_quickbox();"><i class="bi bi-inbox-fill"></i></a>
        </div>
      </div>
    </div>

    <div id="page-content">
        {{template "page:content" .}}
    </div>
    </div>

    {{template "partial:footer" .}}
    <div id="overlay" onclick="bm_overlay_off('main-sidebar')"></div>

  <dialog class="dialog-confirm" id="dialog-confirm-delete">
    <header>
      <h5></h5>
      <span class="close-dialog-confirm button close"><i class='close-dialog-confirm bi bi-x-circle-fill'></i></span>
    </header>

    <p style="clear: both"></p>

    <div id="footer-navbar">
          <button id="modal-confirm-delete" class="delete">Delete</button>
    </div>
  </dialog>

  <dialog class="dialog-confirm" id="dialog-confirm">
    <header>
      <h5></h5>
      <span class="close-dialog-confirm button close"><i class='close-dialog-confirm bi bi-x-circle-fill'></i></span>
    </header>

    <p style="clear: both"></p>

    <div id="footer-navbar">
      <button id="modal-confirm" class="delete">Confirm</button>
    </div>
  </dialog>

    <div id="quickbox">
      <div class="noswipe" id="quickbox-top-bar">
        <a class="hide-large logo"  onclick="bm_toggle_sidebar('main-sidebar');"><img alt="BrainMinder" src="/static/img/brainminder.svg" class="logo"></a>
        <div id="quickbox-title">
          <div id="quickbox-title-title"><h5>Quickbox</h5></div>
          <div id="quickbox-close"><button onclick="bm_hide_quickbox()"><i class="bi bi-x-circle-fill"></i></button></div>
        </div>
      </div>

      <div id="quickbox-content">
        <div id="quickbox-notes"></div>
      </div>

      <div id="quickbox-footer">
        <form method="POST">
            <div>
              <div id="notetext"><textarea required name="Note" id="quickbox-notetext"></textarea></div>
              <div id="notesend"><button type="button" hx-validate="true" hx-post="/quickbox/add" hx-target="#quickbox-notes" hx-swap="beforeend"><i class='bi bi-caret-right-square-fill'></i></button></div>
            </div>
        </form>
      </div>

    </div><!-- quickbox -->
    <script>{{block "jscode" .}}{{end}}</script>
    <dialog id="message"></dialog>
  </body>
</html>
{{ end }}
