Files
plainpages/views/index.ejs
T
2026-08-23 13:17:03 +02:00

39 lines
1.7 KiB
Plaintext

<%#
Dashboard: the gated post-login app home. The built-in default is a short instructional
starter — what /dashboard is and how to replace it from a plugin. Composes the app shell (the one
global menu via model.nav) around the prose. A plugin owns the real dashboard via a `dashboard`
handler; this renders until then. Data: model { nav, shell }.
%><%
const nav = include("partials/nav-tree", { nodes: model.nav });
// These four messages carry markup (<code> spans), so they render raw — the documented
// markup-carrying case. They interpolate nothing, so there is no untrusted data to escape.
const body = `
<div class="form-page">
<section class="form-card">
<h2 class="card-title">${t("dashboard.starter.title")}</h2>
<p>${t("dashboard.starter.intro")}</p>
<p>${t("dashboard.starter.replace")}</p>
<pre class="code-block"><code>export default definePlugin({
apiVersion: "0.2.0",
// view names plugins/&lt;id&gt;/views/&lt;view&gt;.ejs, rendered in this same shell
dashboard: (ctx) =&gt; ({ view: "dashboard", data: { /* … */ } }),
});</code></pre>
<p>${t("dashboard.starter.reference")}</p>
<div class="form-actions">
<a class="btn btn-primary" href="${localeHref("/scheduling")}"><svg class="ico ico-sm" aria-hidden="true"><use href="#i-grid"/></svg>${t("dashboard.starter.browse")}</a>
</div>
</section>
</div>`;
-%>
<%- include("partials/shell", {
body,
brand: model.shell.brand,
breadcrumbs: model.shell.breadcrumbs,
csrfToken: model.shell.csrfToken,
nav,
signInHref: model.shell.signInHref,
theme: model.shell.theme,
title: model.shell.title,
user: model.shell.user,
}) %>