Runway 1.0.1
This commit is contained in:
1 parent
dcf819146b
commit
ce217fc952
259 files changed
+22226
-206
No files matched your search
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><title>Blog entry</title></head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div class="page-header d-print-none mb-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle" id="be-pretitle">Site</div>
|
||||
<h2 class="page-title" id="be-heading">Edit entry</h2>
|
||||
</div>
|
||||
<div class="col-auto"><a class="btn" id="be-back" href="/__admin/blog">Back to blog</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- The reverse advisory: a real PAGE owns this entry's URL — the
|
||||
page wins, so the entry is unreachable there. Rendered only when it applies. -->
|
||||
<div class="alert alert-warning" id="be-shadowed" role="alert">
|
||||
<span id="be-shadowed-text">A page owns this entry's address.</span>
|
||||
<span id="be-shadowed-by" class="font-monospace">page</span>
|
||||
</div>
|
||||
|
||||
<form id="be-form" method="post" action="/__admin/blog/x">
|
||||
<input id="be-csrf" type="hidden" name="_csrf" value="">
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header"><h3 class="card-title" id="be-l-entry">Entry</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4" id="be-id-wrap">
|
||||
<label class="form-label" id="be-l-id" for="be-id">Id</label>
|
||||
<input id="be-id" class="form-control font-monospace" type="text" name="id" value=""
|
||||
placeholder="my-first-post">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" id="be-l-date" for="be-date">Publication date</label>
|
||||
<input id="be-date" class="form-control" type="date" name="publishedOn" value="">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" id="be-l-author" for="be-author">Author</label>
|
||||
<input id="be-author" class="form-control" type="text" name="author" value=""
|
||||
placeholder="Jane Doe">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" id="be-l-custom" for="be-custom">Custom path</label>
|
||||
<input id="be-custom" class="form-control font-monospace" type="text" name="customPath"
|
||||
value="" placeholder="/announcing-v2">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-check form-switch">
|
||||
<input id="be-published" class="form-check-input" type="checkbox" name="published">
|
||||
<span class="form-check-label" id="be-l-published">Published</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- One card per site language: title, description, slug, body (Markdown). -->
|
||||
<div class="card mb-3" id="be-lang-card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><span id="be-lang-name">en</span></h3>
|
||||
<div class="card-actions">
|
||||
<label class="form-check mb-0">
|
||||
<input id="be-lang-on" class="form-check-input" type="checkbox" name="locales_en">
|
||||
<span class="form-check-label" id="be-l-langon">Published in this language</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-8">
|
||||
<label class="form-label be-l-title">Title</label>
|
||||
<input class="form-control be-title" type="text" name="title_en" value="">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label be-l-slug">Slug</label>
|
||||
<input class="form-control font-monospace be-slug" type="text" name="slug_en" value="">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label be-l-desc">Description</label>
|
||||
<input class="form-control be-desc" type="text" name="description_en" value="">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label be-l-body">Body (Markdown)</label>
|
||||
<textarea class="form-control font-monospace be-body" name="body_en" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" id="be-save">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Blog entry editor. One language card per SITE locale (th:each over siteLocaleTags); the default
|
||||
language's slug field doubles as the base slug. On CREATE the form posts to /create with an editable id;
|
||||
on EDIT the id is readonly and the form posts to /__admin/blog/<id>. `//` reaches nested elements
|
||||
(`/` matches direct children only); the published/keep ternaries stay at the Thymeleaf level (a message
|
||||
expression cannot nest inside a SpEL expression). -->
|
||||
<thlogic>
|
||||
<attr sel="#be-pretitle" th:text="#{blog.admin.pretitle}"/>
|
||||
<attr sel="#be-heading" th:text="${creating} ? #{blog.edit.headingNew} : #{blog.edit.heading}"/>
|
||||
<attr sel="#be-back" th:text="#{blog.edit.back}"/>
|
||||
|
||||
<attr sel="#be-shadowed" th:if="${!shadowedBy.isEmpty()}"/>
|
||||
<attr sel="#be-shadowed-text" th:text="#{blog.edit.shadowed}"/>
|
||||
<attr sel="#be-shadowed-by" th:text="${#strings.listJoin(shadowedBy, ', ')}"/>
|
||||
|
||||
<!-- The action is model-computed (two '/__admin' literals in one expression would trip Thymeleaf's
|
||||
__…__ preprocessing). -->
|
||||
<attr sel="#be-form" th:attr="action=${formAction}"/>
|
||||
<attr sel="#be-csrf"
|
||||
th:attr="name=${_csrf != null ? _csrf.parameterName : '_csrf'},value=${_csrf != null ? _csrf.token : ''}"/>
|
||||
|
||||
<attr sel="#be-l-entry" th:text="#{blog.edit.entry}"/>
|
||||
<attr sel="#be-l-id" th:text="#{blog.edit.id}"/>
|
||||
<attr sel="#be-id" th:attr="value=${creating ? '' : entry.id()},readonly=${creating ? null : 'readonly'},
|
||||
title=#{blog.edit.id.tip}"/>
|
||||
<attr sel="#be-l-date" th:text="#{blog.edit.date}"/>
|
||||
<attr sel="#be-date" th:attr="value=${entry.publishedOn()}"/>
|
||||
<attr sel="#be-l-author" th:text="#{blog.edit.author}"/>
|
||||
<attr sel="#be-author" th:attr="value=${entry.author()},title=#{blog.edit.author.tip}"/>
|
||||
<attr sel="#be-l-custom" th:text="#{blog.edit.customPath}"/>
|
||||
<attr sel="#be-custom" th:attr="value=${entry.customPath()},title=#{blog.edit.customPath.tip}"/>
|
||||
<attr sel="#be-l-published" th:text="#{blog.edit.published}"/>
|
||||
<attr sel="#be-published" th:attr="checked=${entry.published() ? 'checked' : null}"/>
|
||||
|
||||
<!-- One card per site language; every inner field is renamed to its <field>_<lang> form name. -->
|
||||
<attr sel="#be-lang-card" th:each="lang : ${siteLocaleTags}"/>
|
||||
<attr sel="#be-lang-card//#be-lang-name"
|
||||
th:text="${lang == defaultLocaleTag} ? (${lang} + ' · ' + #{blog.edit.defaultLang}) : ${lang}"/>
|
||||
<attr sel="#be-lang-card//#be-lang-on"
|
||||
th:attr="name='locales_' + ${lang},checked=${entry.locales().contains(lang) ? 'checked' : null}"/>
|
||||
<attr sel="#be-lang-card//#be-l-langon" th:text="#{blog.edit.langOn}"/>
|
||||
<attr sel="#be-lang-card//.be-l-title" th:text="#{blog.edit.title}"/>
|
||||
<attr sel="#be-lang-card//.be-title"
|
||||
th:attr="name='title_' + ${lang},value=${entry.title().get(lang)}"/>
|
||||
<attr sel="#be-lang-card//.be-l-slug" th:text="#{blog.edit.slug}"/>
|
||||
<attr sel="#be-lang-card//.be-slug"
|
||||
th:attr="name='slug_' + ${lang},title=#{blog.edit.slug.tip},
|
||||
value=${lang == defaultLocaleTag ? entry.effectiveSlug() : entry.localizedSlugs().get(lang)}"/>
|
||||
<attr sel="#be-lang-card//.be-l-desc" th:text="#{blog.edit.description}"/>
|
||||
<attr sel="#be-lang-card//.be-desc"
|
||||
th:attr="name='description_' + ${lang},value=${entry.description().get(lang)}"/>
|
||||
<attr sel="#be-lang-card//.be-l-body" th:text="#{blog.edit.body}"/>
|
||||
<attr sel="#be-lang-card//.be-body"
|
||||
th:attr="name='body_' + ${lang}" th:text="${bodies.get(lang)}"/>
|
||||
|
||||
<attr sel="#be-save" th:text="#{blog.edit.save}"/>
|
||||
</thlogic>
|
||||
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><title>Blog</title></head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div class="page-header d-print-none mb-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle" id="bl-pretitle">Site</div>
|
||||
<h2 class="page-title" id="bl-heading">Blog</h2>
|
||||
</div>
|
||||
<div class="col-auto"><a class="btn btn-primary" id="bl-new" href="/__admin/blog/new">New entry</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning" id="bl-disabled" role="alert">
|
||||
<span id="bl-disabled-text">The blog is disabled for this site (see the plugin's settings) — entries are
|
||||
kept but none serves.</span>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-vcenter card-table" data-listing-table="runway.admin.blog">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col-key="id" id="bl-h-id">Entry</th>
|
||||
<th data-col-key="path" id="bl-h-path">Path</th>
|
||||
<th data-col-key="langs" id="bl-h-langs">Languages</th>
|
||||
<th data-col-key="date" id="bl-h-date">Date</th>
|
||||
<th data-col-key="status" id="bl-h-status">Status</th>
|
||||
<th data-nosort data-col-key="actions" id="bl-h-actions" class="w-1">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="bl-empty"><td colspan="6" class="text-secondary text-center" id="bl-empty-text">No entries yet.</td></tr>
|
||||
<tr id="bl-row">
|
||||
<td class="b-id font-monospace">id</td>
|
||||
<td class="b-path text-secondary">—</td>
|
||||
<td class="b-langs text-secondary">—</td>
|
||||
<td class="b-date text-secondary">—</td>
|
||||
<td><span class="badge b-badge">status</span></td>
|
||||
<td>
|
||||
<div class="btn-list flex-nowrap">
|
||||
<a class="btn btn-sm b-edit" href="#">Edit</a>
|
||||
<form class="b-publish-form d-inline" method="post" action="#">
|
||||
<input class="b-csrf" type="hidden" name="_csrf" value="">
|
||||
<button type="submit" class="btn btn-sm b-publish">Publish</button>
|
||||
</form>
|
||||
<form class="b-delete-form d-inline" method="post" action="#">
|
||||
<input class="b-csrf" type="hidden" name="_csrf" value="">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger b-delete"
|
||||
data-confirm="Delete this entry and all its languages?">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Blog console list. One row per entry; the publish/delete forms are real POSTs (CSRF hidden input injected
|
||||
per form — the per-site token from ${_csrf}). `//` reaches nested elements (`/` matches direct children only). -->
|
||||
<thlogic>
|
||||
<attr sel="#bl-pretitle" th:text="#{blog.admin.pretitle}"/>
|
||||
<attr sel="#bl-heading" th:text="#{blog.admin.heading}"/>
|
||||
<attr sel="#bl-new" th:text="#{blog.admin.new}" th:attr="title=#{blog.admin.new.tip}"/>
|
||||
|
||||
<attr sel="#bl-disabled" th:if="${!blogEnabled}"/>
|
||||
<attr sel="#bl-disabled-text" th:text="#{blog.admin.disabled}"/>
|
||||
|
||||
<attr sel="#bl-h-id" th:text="#{blog.admin.col.entry}"/>
|
||||
<attr sel="#bl-h-path" th:text="#{blog.admin.col.path}"/>
|
||||
<attr sel="#bl-h-langs" th:text="#{blog.admin.col.langs}"/>
|
||||
<attr sel="#bl-h-date" th:text="#{blog.admin.col.date}"/>
|
||||
<attr sel="#bl-h-status" th:text="#{blog.admin.col.status}"/>
|
||||
<attr sel="#bl-h-actions" th:text="#{blog.admin.col.actions}"/>
|
||||
|
||||
<attr sel="#bl-empty" th:if="${rows.isEmpty()}"/>
|
||||
<attr sel="#bl-empty-text" th:text="#{blog.admin.empty}"/>
|
||||
|
||||
<attr sel="#bl-row" th:each="row : ${rows}"/>
|
||||
<attr sel="#bl-row//.b-id" th:text="${row.entry().id()}"/>
|
||||
<attr sel="#bl-row//.b-path" th:text="${row.publicPath()}"/>
|
||||
<attr sel="#bl-row//.b-langs"
|
||||
th:text="${row.entry().locales().isEmpty() ? '—' : #strings.listJoin(row.entry().locales(), ', ')}"/>
|
||||
<attr sel="#bl-row//.b-date" th:text="${row.entry().publishedOn() != null ? row.entry().publishedOn() : '—'}"/>
|
||||
<attr sel="#bl-row//.b-badge" th:text="${row.entry().published()} ? #{blog.admin.published} : #{blog.admin.draft}"
|
||||
th:classappend="${row.entry().published() ? 'bg-green-lt' : 'bg-yellow-lt'}"/>
|
||||
<attr sel="#bl-row//.b-edit" th:text="#{blog.admin.edit}"
|
||||
th:attr="href='/__admin/blog/' + ${row.entry().id()} + '/edit'"/>
|
||||
<attr sel="#bl-row//.b-publish-form"
|
||||
th:attr="action='/__admin/blog/' + ${row.entry().id()} + '/publish'"/>
|
||||
<attr sel="#bl-row//.b-publish"
|
||||
th:text="${row.entry().published()} ? #{blog.admin.unpublish} : #{blog.admin.publish}"/>
|
||||
<attr sel="#bl-row//.b-delete-form"
|
||||
th:attr="action='/__admin/blog/' + ${row.entry().id()} + '/delete'"/>
|
||||
<attr sel="#bl-row//.b-delete" th:text="#{blog.admin.delete}"
|
||||
th:attr="data-confirm=#{blog.admin.delete.confirm}"/>
|
||||
<!-- The per-site CSRF token on every mutating form (the messages-editor idiom). -->
|
||||
<attr sel="#bl-row//.b-csrf"
|
||||
th:attr="name=${_csrf != null ? _csrf.parameterName : '_csrf'},value=${_csrf != null ? _csrf.token : ''}"/>
|
||||
</thlogic>
|
||||
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blog entry</title>
|
||||
<!-- Static preview head only — replaced at render by the TENANT's master head (the seam contract). -->
|
||||
</head>
|
||||
<body>
|
||||
<header id="site-header">Site header (from the master at render)</header>
|
||||
|
||||
<main id="content">
|
||||
<article class="blog-entry">
|
||||
<header class="blog-entry-header">
|
||||
<h1 id="entry-title">Entry title</h1>
|
||||
<p id="entry-meta" class="blog-entry-meta">
|
||||
<time id="entry-date">2026-01-01</time>
|
||||
<span id="entry-author">By Someone</span>
|
||||
</p>
|
||||
</header>
|
||||
<div id="entry-body" class="blog-entry-body">
|
||||
<p>The entry body renders here.</p>
|
||||
</div>
|
||||
<footer class="blog-entry-footer">
|
||||
<a id="entry-back" href="/">Back</a>
|
||||
</footer>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<footer id="site-footer">Site footer (from the master at render)</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Blog entry (classic): the tenant's OWN master supplies head/header/footer (this file is byte-identical across
|
||||
tenants; ALL variance flows through the model). It reads ONLY the body-template render model the
|
||||
SPI documents on ContentSource/ContentRef.bodyTemplate: ${master}, ${content.*} (id, sourceKey,
|
||||
title, description, bodyHtml, attributes, updatedAt), ${locale} and ${urls[...]} — BlogEntryTemplateContractTest
|
||||
fails the build if anything else creeps in. Labels resolve via #{} from THIS plugin's bundles (appended last —
|
||||
a site that defines the same key wins). `//` reaches nested elements (`/` matches direct children only). -->
|
||||
<thlogic>
|
||||
<attr sel="head" th:replace="~{${master} :: head}"/>
|
||||
<attr sel="#site-header" th:replace="~{${master} :: #site-header}"/>
|
||||
<attr sel="#site-footer" th:replace="~{${master} :: #site-footer}"/>
|
||||
|
||||
<attr sel="#entry-title" th:text="${content.title}"/>
|
||||
<!-- Editorial byline. The meta line renders when the entry has a date OR an author, and each part renders
|
||||
independently — an entry with an author but no date (or the reverse) is a normal state, and gating the
|
||||
whole line on the date alone would silently swallow the byline. Each is absent from
|
||||
content.attributes when unset, so nothing renders as an empty element. -->
|
||||
<attr sel="#entry-meta"
|
||||
th:if="${content.attributes['publishedOn'] != null or content.attributes['author'] != null}"/>
|
||||
<attr sel="#entry-meta//#entry-date"
|
||||
th:if="${content.attributes['publishedOn'] != null}"
|
||||
th:text="#{blog.publishedOn} + ' ' + ${content.attributes['publishedOn']}"
|
||||
th:attr="datetime=${content.attributes['publishedOn']}"/>
|
||||
<attr sel="#entry-meta//#entry-author"
|
||||
th:if="${content.attributes['author'] != null}"
|
||||
th:text="#{blog.by} + ' ' + ${content.attributes['author']}"/>
|
||||
<attr sel="#entry-body" th:utext="${content.bodyHtml}"/>
|
||||
<!-- Back to the site home in the CURRENT locale (the home page's locale-correct URL when it exists). -->
|
||||
<attr sel="#entry-back" th:text="#{blog.back}"
|
||||
th:attr="href=${urls['index'] != null ? urls['index'] : '/'}"/>
|
||||
</thlogic>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blog entry</title>
|
||||
<!-- Static preview head only — replaced at render by the TENANT's master head (the seam contract). -->
|
||||
</head>
|
||||
<body>
|
||||
<header id="site-header">Site header (from the master at render)</header>
|
||||
|
||||
<main id="content">
|
||||
<article class="blog-entry blog-entry-minimal">
|
||||
<h1 id="entry-title">Entry title</h1>
|
||||
<div id="entry-body" class="blog-entry-body">
|
||||
<p>The entry body renders here.</p>
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<footer id="site-footer">Site footer (from the master at render)</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Blog entry (minimal): title + body only — no date line, no back link. Same contract as classic: the tenant's
|
||||
master chrome, only the documented render model (${master}, ${content.*}), tenant-invariant file. -->
|
||||
<thlogic>
|
||||
<attr sel="head" th:replace="~{${master} :: head}"/>
|
||||
<attr sel="#site-header" th:replace="~{${master} :: #site-header}"/>
|
||||
<attr sel="#site-footer" th:replace="~{${master} :: #site-footer}"/>
|
||||
|
||||
<attr sel="#entry-title" th:text="${content.title}"/>
|
||||
<attr sel="#entry-body" th:utext="${content.bodyHtml}"/>
|
||||
</thlogic>
|
||||
Reference in new issue
Block a user