Notes/src/views/share/page.ejs

53 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-10-19 22:48:38 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="../favicon.ico">
2021-12-22 11:43:21 +01:00
<% if (!note.hasLabel("shareOmitDefaultCss")) { %>
2021-12-05 23:10:35 +01:00
<link href="../libraries/normalize.min.css" rel="stylesheet">
2021-10-19 22:48:38 +02:00
<link href="../stylesheets/share.css" rel="stylesheet">
2021-12-22 11:43:21 +01:00
<% } %>
2021-10-19 22:48:38 +02:00
<% if (note.type === 'text' || note.type === 'book') { %>
<link href="../libraries/ckeditor/ckeditor-content.css" rel="stylesheet">
<% } %>
<% for (const cssRelation of note.getRelations("shareCss")) { %>
<link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet">
<% } %>
2021-10-19 22:48:38 +02:00
<title><%= note.title %></title>
</head>
<body>
<div id="layout">
<div id="main">
<br>
<% if (note.parents[0].noteId !== 'share' && note.parents.length != 0) { %>
<nav class="parent-link">
<a href="<%= note.parents[0].noteId %>">&lt; Parent note (<%= note.parents[0].title %>)</a>
</nav>
<% } %>
2021-10-19 22:48:38 +02:00
<h1 id="title"><%= note.title %></h1>
<div id="content" class="note-<%= note.type %><% if (note.type === 'text') { %>ck-content<% } %>">
2021-12-21 22:01:06 +01:00
<%- content %>
2021-10-19 22:48:38 +02:00
</div>
</div>
2021-12-21 22:01:06 +01:00
<% if (subRoot.hasChildren()) { %>
2021-12-22 11:43:21 +01:00
<button id="menuButton"></button>
2021-12-21 22:01:06 +01:00
2021-12-22 11:43:21 +01:00
<nav id="menu">
<%- include('tree_item', {note: subRoot, activeNote: note}) %>
</nav>
2021-12-21 22:01:06 +01:00
<% } %>
2021-10-19 22:48:38 +02:00
</div>
<script>
2021-12-22 11:43:21 +01:00
(function () {
const menuButton = document.getElementById('menuButton');
const layout = document.getElementById('layout');
2021-10-19 22:48:38 +02:00
2021-12-22 11:43:21 +01:00
menuButton.addEventListener('click', () => layout.classList.toggle('navMenu'));
}());
2021-10-19 22:48:38 +02:00
</script>
</body>
</html>