2023-09-30 00:44:10 -04:00
|
|
|
<%
|
|
|
|
|
const isExternalLink = note.hasLabel('shareExternalLink');
|
|
|
|
|
const linkHref = isExternalLink ? note.getLabelValue('shareExternalLink') : `./${note.shareId}`;
|
|
|
|
|
const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : '';
|
|
|
|
|
%>
|
2021-10-19 22:48:38 +02:00
|
|
|
<p>
|
2023-07-17 22:19:03 +02:00
|
|
|
<% const titleWithPrefix = (branch.prefix ? `${branch.prefix} - ` : '') + note.title; %>
|
|
|
|
|
|
2021-10-19 22:48:38 +02:00
|
|
|
<% if (activeNote.noteId === note.noteId) { %>
|
2023-07-17 22:19:03 +02:00
|
|
|
<strong><%= titleWithPrefix %></strong>
|
2021-10-19 22:48:38 +02:00
|
|
|
<% } else { %>
|
2023-09-30 00:44:10 -04:00
|
|
|
<a class="type-<%= note.type %>" href="<%= linkHref %>"<%= target %>><%= titleWithPrefix %></a>
|
2021-10-19 22:48:38 +02:00
|
|
|
<% } %>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<% if (note.hasChildren()) { %>
|
|
|
|
|
<ul>
|
2023-07-17 22:19:03 +02:00
|
|
|
<% note.getVisibleChildBranches().forEach(function (branch) { %>
|
2021-10-19 22:48:38 +02:00
|
|
|
<li>
|
2023-07-17 22:19:03 +02:00
|
|
|
<%- include('tree_item', {branch: branch, note: branch.getNote()}) %>
|
2021-10-19 22:48:38 +02:00
|
|
|
</li>
|
|
|
|
|
<% }) %>
|
|
|
|
|
</ul>
|
|
|
|
|
<% } %>
|