Files
datascape/assets/page.html
2026-04-17 10:54:06 +02:00

120 lines
6.4 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="/_/pico.min.css" />
<link rel="stylesheet" href="/_/style.css" />
<script src="/_/global-shortcuts.js"></script>
</head>
<body>
<header>
<div class="container-fluid">
<nav>
<nav aria-label="breadcrumb">
<ul>
<li>
<a href="/"><svg style="height: 1rem; width: 1rem; vertical-align: center;" viewBox="0 0 26.052269 26.052269" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linejoin="miter" transform="matrix(0.05463483,8.1519706e-6,-8.1519706e-6,0.05463483,-64.560546,-24.6949)"><rect x="1188.537" y="457.92056" width="461.87488" height="462.15189" stroke-width="20.2288"/><path d="m1348.9955 456.59572.046 309.36839" stroke-width="19.6849"/><path d="m1200.3996 765.80237 441.8362-.0659" stroke-width="19.6849"/><path d="m1648.2897 620.244-299.2012.0446" stroke-width="20.5676"/><path d="m1491.6148 909.24806-.021-136.93117" stroke-width="19.6849"/><rect x="1191.6504" y="461.66092" width="457.09634" height="457.09634" stroke-width="19.6761"/></g></svg></a>
</li>
{{range .Crumbs}}
<li><a href="{{.URL}}">{{.Name}}</a></li>
{{end}}
</ul>
</nav>
<ul>
{{if .EditMode}}
<li><a href="{{.PostURL}}" class="secondary">Cancel</a></li>
<li><a href="#" onclick="document.getElementById('edit-form').submit()" data-action="save" data-key="S" title="Save (S)">Save</a></li>
{{else if .CanEdit}}
<li><a href="#" onclick="newPage()" class="secondary" title="New page (N)">New</a></li>
<li><a href="?edit" title="Edit page (E)">Edit</a></li>
{{end}}
</ul>
</nav>
</div>
</header>
<main class="container">
{{if .EditMode}}
<form id="edit-form" class="edit-form" method="POST" action="{{.PostURL}}">
{{if ge .SectionIndex 0}}<input type="hidden" name="section" value="{{.SectionIndex}}">{{end}}
<div class="editor-toolbar">
<div role="group">
<button type="button" data-action="bold" data-key="B" title="Bold (B)">B</button>
<button type="button" data-action="italic" data-key="I" title="Italic (I)"><i>I</i></button>
</div>
<div role="group">
<button type="button" data-action="h1" data-key="1" title="Heading 1 (1)">H1</button>
<button type="button" data-action="h2" data-key="2" title="Heading 2 (2)">H2</button>
<button type="button" data-action="h3" data-key="3" title="Heading 3 (3)">H3</button>
</div>
<div role="group">
<button type="button" data-action="code" data-key="C" title="Inline code (C)">`</button>
<button type="button" data-action="codeblock" data-key="K" title="Code block (K)">```</button>
</div>
<div role="group">
<button type="button" data-action="link" data-key="L" title="Link (L)">[ ]</button>
<button type="button" data-action="quote" data-key="Q" title="Blockquote (Q)">&gt;</button>
<button type="button" data-action="ul" data-key="U" title="Unordered list (U)">&bull;</button>
<button type="button" data-action="ol" data-key="O" title="Ordered list (O)">1.</button>
<button type="button" data-action="hr" data-key="R" title="Horizontal rule (R)"></button>
</div>
<div role="group">
<button type="button" class="toolbar-dropdown" data-action="tbldrop" title="Table (T)">T&#9662;</button>
<button type="button" class="toolbar-dropdown" data-action="datedrop" title="Insert date (D/W)">D&#9662;</button>
</div>
</div>
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
</form>
<script src="/_/editor/lists.js"></script>
<script src="/_/editor/tables.js"></script>
<script src="/_/editor/dates.js"></script>
<script src="/_/editor.js"></script>
{{else}}
{{if .Content}}
<section class="content">{{.Content}}</section>
{{end}}
{{if .SpecialContent}}
<div class="diary">{{.SpecialContent}}</div>
{{end}}
{{if or .Content .SpecialContent}}
<script src="/_/content.js"></script>
{{end}}
{{if .Content}}
<script src="/_/sections.js"></script>
{{end}}
{{if .Entries}}
<section class="listing">
<header>Contents</header>
<table>
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Name</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{{range .Entries}}
<tr>
<td>{{.Icon}}</td>
<td><a href="{{.URL}}">{{.Name}}</a></td>
<td>{{.Meta}}</td>
</tr>
{{end}}
</tbody>
</table>
</section>
{{else if not .Content}}
{{if not .SpecialContent}}
<p class="empty">Empty folder — <a href="?edit">create</a></p>
{{end}}
{{end}}
{{end}}
</main>
</body>
</html>