68 lines
3.7 KiB
HTML
68 lines
3.7 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>{{.Title}}</title>
|
|
<link rel="icon" href="/_/favicon.ico" />
|
|
<link rel="stylesheet" href="/_/style.css" />
|
|
<script src="/_/global-shortcuts.js"></script>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<nav class="breadcrumb">
|
|
<a href="/">~</a>
|
|
{{range .Crumbs}}<span class="sep">/</span
|
|
><a href="{{.URL}}">{{.Name}}</a>{{end}}
|
|
</nav>
|
|
{{if .EditMode}}
|
|
<a class="btn-cancel" href="{{.PostURL}}">CANCEL</a>
|
|
<button class="btn-save" type="submit" form="edit-form" data-action="save" data-key="S" title="Save (S)">SAVE</button>
|
|
{{else if .CanEdit}}
|
|
<a class="edit-btn" href="?edit" title="Edit (Alt+Shift+E)">EDIT</a>
|
|
{{end}}
|
|
</header>
|
|
<main>
|
|
{{if .EditMode}}
|
|
<form id="edit-form" class="edit-form" method="POST" action="{{.PostURL}}">
|
|
<div class="editor-toolbar">
|
|
<button type="button" class="btn-tool" data-action="bold" data-key="B" title="Bold (B)">**</button>
|
|
<button type="button" class="btn-tool" data-action="italic" data-key="I" title="Italic (I)">*</button>
|
|
<span class="toolbar-sep"></span>
|
|
<button type="button" class="btn-tool" data-action="h1" data-key="1" title="Heading 1 (1)">#</button>
|
|
<button type="button" class="btn-tool" data-action="h2" data-key="2" title="Heading 2 (2)">##</button>
|
|
<button type="button" class="btn-tool" data-action="h3" data-key="3" title="Heading 3 (3)">###</button>
|
|
<span class="toolbar-sep"></span>
|
|
<button type="button" class="btn-tool" data-action="code" data-key="C" title="Inline code (C)">`</button>
|
|
<button type="button" class="btn-tool" data-action="codeblock" data-key="K" title="Code block (K)">```</button>
|
|
<span class="toolbar-sep"></span>
|
|
<button type="button" class="btn-tool" data-action="link" data-key="L" title="Link (L)">[]</button>
|
|
<button type="button" class="btn-tool" data-action="quote" data-key="Q" title="Blockquote (Q)">></button>
|
|
<button type="button" class="btn-tool" data-action="ul" data-key="U" title="Unordered list (U)">-</button>
|
|
<button type="button" class="btn-tool" data-action="ol" data-key="O" title="Ordered list (O)">1.</button>
|
|
<button type="button" class="btn-tool" data-action="hr" data-key="R" title="Horizontal rule (R)">---</button>
|
|
</div>
|
|
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
|
|
</form>
|
|
<script src="/_/editor.js"></script>
|
|
{{else}} {{if .Content}}
|
|
<div class="content">{{.Content}}</div>
|
|
<script src="/_/content.js"></script>
|
|
{{end}} {{if .Entries}}
|
|
<div class="listing">
|
|
<div class="listing-header">Contents</div>
|
|
{{range .Entries}}
|
|
<div class="listing-item">
|
|
<span class="icon">{{.Icon}}</span>
|
|
<a href="{{.URL}}">{{.Name}}</a>
|
|
<span class="meta">{{.Meta}}</span>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else if not .Content}}
|
|
<p class="empty">Empty folder — <a href="?edit">[CREATE]</a></p>
|
|
{{end}} {{end}}
|
|
</main>
|
|
</body>
|
|
</html>
|