fix authoring service
All checks were successful
Build Org Website / build (push) Successful in 45s

This commit is contained in:
2026-05-09 17:13:59 +01:00
parent e45e05ea40
commit e22dfc5a12
8 changed files with 237 additions and 101 deletions

View File

@@ -743,76 +743,209 @@ APP_HTML = r"""<!doctype html>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Org Site Authoring</title>
<style>
:root { color-scheme: light; --bg: #f4f5f2; --sidebar: #e8ece6; --panel: #fffefa; --panel-2: #f8faf7; --ink: #1e2524; --muted: #67706d; --line: #d7ddd6; --line-strong: #b9c5bd; --accent: #0f6861; --accent-2: #a64f2e; --focus: rgba(15, 104, 97, 0.16); --shadow: 0 16px 36px rgba(31, 42, 39, 0.08); }
:root {
color-scheme: dark;
--bg: #11100d;
--bg-2: #191814;
--sidebar: #1d1a16;
--panel: #f3ead7;
--panel-2: #e7dac0;
--panel-dark: #242019;
--ink: #282016;
--ink-light: #f7ecd5;
--muted: #9d9078;
--muted-dark: #695d4b;
--line: rgba(202, 179, 126, 0.28);
--line-strong: rgba(217, 190, 124, 0.56);
--accent: #b89145;
--accent-2: #7d2f36;
--accent-3: #446a57;
--focus: rgba(184, 145, 69, 0.3);
--shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
--paper-shadow: 0 22px 48px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.52);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
body {
margin: 0;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background:
radial-gradient(circle at 18% 12%, rgba(125, 47, 54, 0.24), transparent 28%),
radial-gradient(circle at 84% 18%, rgba(68, 106, 87, 0.24), transparent 24%),
linear-gradient(135deg, #0f0e0b 0%, #17140f 42%, #211b14 100%);
color: var(--ink-light);
}
body::before {
content: "";
position: fixed;
inset: 0;
pointer-events: none;
opacity: 0.2;
background-image:
linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
background-size: 34px 34px, 34px 34px;
mask-image: linear-gradient(90deg, rgba(0,0,0,0.9), rgba(0,0,0,0.35));
}
button, input, textarea, select { font: inherit; }
button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-height: 38px; padding: 0 12px; border-radius: 7px; cursor: pointer; transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease; }
button:hover { border-color: var(--line-strong); background: #ffffff; }
button {
border: 1px solid var(--line);
background: rgba(243, 234, 215, 0.08);
color: var(--ink-light);
min-height: 38px;
padding: 0 12px;
border-radius: 7px;
cursor: pointer;
transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}
button:hover { transform: translateY(-1px); border-color: var(--line-strong); background: rgba(243, 234, 215, 0.14); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus); border-color: var(--accent); }
button.primary { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 8px 20px rgba(15, 104, 97, 0.18); }
button.primary:hover { background: #0b5953; border-color: #0b5953; }
button.icon { min-width: 38px; padding: 0 10px; font-weight: 700; }
.app { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 420px) 1fr; }
aside { border-right: 1px solid var(--line); background: var(--sidebar); padding: 18px; overflow: auto; max-height: 100vh; }
main { padding: 24px clamp(18px, 3vw, 42px); overflow: auto; max-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 16px; }
h1 { font-size: 20px; margin: 0; font-weight: 760; }
h2 { font-size: 13px; margin: 22px 0 9px; color: var(--muted); font-weight: 760; text-transform: uppercase; }
.status { border: 1px solid var(--line); background: rgba(255, 254, 250, 0.78); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset; }
.status.running { border-color: #d1a15a; background: #fff9ec; }
.status.ok { border-color: #86b9a6; background: #f3fbf7; }
.status.fail { border-color: #d69a92; background: #fff4f2; }
.quick-link { display: inline-block; color: var(--accent); font-size: 13px; margin: -7px 0 14px; text-decoration: none; }
.quick-link:hover { text-decoration: underline; }
.filters { display: grid; gap: 8px; margin-bottom: 14px; }
.page-list { display: grid; gap: 4px; }
.tree-dir { margin: 1px 0; }
.tree-dir summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 36px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; color: var(--ink); }
button.primary { background: linear-gradient(180deg, #c79d4e, #96702f); color: #18130d; border-color: #d6b566; font-weight: 820; box-shadow: 0 12px 28px rgba(184, 145, 69, 0.22); }
button.primary:hover { background: linear-gradient(180deg, #d3ad5b, #a87d35); border-color: #e0c378; }
button.icon { min-width: 38px; padding: 0 10px; font-weight: 800; font-family: Georgia, "Times New Roman", serif; }
.app { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 430px) 1fr; }
aside {
border-right: 1px solid var(--line);
background: linear-gradient(180deg, rgba(29, 26, 22, 0.96), rgba(18, 17, 14, 0.98));
padding: 20px;
overflow: auto;
max-height: 100vh;
box-shadow: 18px 0 42px rgba(0, 0, 0, 0.22);
}
main { padding: 28px clamp(20px, 3vw, 46px); overflow: auto; max-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: 25px; margin: 0; font-weight: 700; letter-spacing: 0; color: #f8edd7; }
main h1 { font-size: 31px; color: var(--panel); text-shadow: 0 2px 24px rgba(0, 0, 0, 0.34); }
h2 { font-size: 12px; margin: 24px 0 10px; color: #c4a766; font-weight: 840; text-transform: uppercase; letter-spacing: 0.08em; }
.status {
border: 1px solid var(--line);
background: rgba(243, 234, 215, 0.08);
padding: 11px 13px;
border-radius: 8px;
font-size: 13px;
margin-bottom: 14px;
color: #dfd0b5;
box-shadow: inset 3px 0 0 rgba(184, 145, 69, 0.68);
}
.status.running { border-color: rgba(214, 181, 102, 0.62); background: rgba(214, 181, 102, 0.12); }
.status.ok { border-color: rgba(88, 139, 111, 0.7); background: rgba(68, 106, 87, 0.16); box-shadow: inset 3px 0 0 #5e9a78; }
.status.fail { border-color: rgba(158, 62, 70, 0.76); background: rgba(125, 47, 54, 0.18); box-shadow: inset 3px 0 0 #9d3d46; }
.quick-link { display: inline-block; color: #cfb36e; font-size: 13px; margin: -10px 0 14px; text-decoration: none; border-bottom: 1px solid rgba(207, 179, 110, 0.35); }
.quick-link:hover { color: #f1d68d; border-bottom-color: currentColor; }
.filters { display: grid; gap: 9px; margin-bottom: 16px; }
.page-list { display: grid; gap: 5px; }
.tree-dir { margin: 2px 0; }
.tree-dir summary {
list-style: none;
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
gap: 8px;
align-items: center;
min-height: 38px;
padding: 7px 9px;
border: 1px solid transparent;
border-radius: 7px;
cursor: pointer;
color: #eee0c4;
}
.tree-dir summary::-webkit-details-marker { display: none; }
.tree-dir summary:hover, .page-item:hover { background: rgba(255, 254, 250, 0.72); border-color: rgba(185, 197, 189, 0.7); }
.tree-dir summary::before { content: ">"; display: inline-block; width: 14px; color: var(--muted); }
.tree-dir summary:hover, .page-item:hover { background: rgba(243, 234, 215, 0.08); border-color: rgba(217, 190, 124, 0.32); }
.tree-dir summary::before { content: ">"; display: inline-block; width: 14px; color: #c8ad69; font-family: "SFMono-Regular", Consolas, monospace; }
.tree-dir[open] > summary::before { content: "v"; }
.tree-label { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.tree-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 720; }
.tree-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 760; }
.tree-label span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tree-children { display: grid; gap: 3px; margin-left: 15px; padding-left: 10px; border-left: 1px solid var(--line); }
.tree-add { min-height: 28px; padding: 0 8px; font-size: 12px; color: var(--accent); background: transparent; opacity: 0.82; }
.tree-add:hover { opacity: 1; background: #ffffff; }
.page-item { width: 100%; text-align: left; min-height: auto; padding: 9px 10px; background: transparent; border-color: transparent; }
.page-item.active { border-color: rgba(15, 104, 97, 0.55); background: var(--panel); box-shadow: 0 8px 18px rgba(31, 42, 39, 0.06); }
.page-item strong { display: block; font-size: 14px; margin-bottom: 2px; overflow-wrap: anywhere; font-weight: 720; }
.tree-children { display: grid; gap: 4px; margin-left: 15px; padding-left: 11px; border-left: 1px solid rgba(217, 190, 124, 0.22); }
.tree-add { min-height: 28px; padding: 0 8px; font-size: 12px; color: #e0c680; background: rgba(184, 145, 69, 0.1); opacity: 0.9; }
.tree-add:hover { opacity: 1; background: rgba(184, 145, 69, 0.18); }
.page-item { width: 100%; text-align: left; min-height: auto; padding: 10px 11px; background: transparent; border-color: transparent; }
.page-item.active { border-color: rgba(214, 181, 102, 0.65); background: rgba(243, 234, 215, 0.13); box-shadow: inset 3px 0 0 var(--accent), 0 12px 24px rgba(0, 0, 0, 0.18); }
.page-item strong { display: block; font-size: 14px; margin-bottom: 3px; overflow-wrap: anywhere; font-weight: 780; color: #f3e7ce; }
.page-item span { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.page-item .filename { color: var(--ink); }
form { display: grid; gap: 14px; }
.page-item .filename { color: #cab68d; }
form {
display: grid;
gap: 16px;
border: 1px solid rgba(217, 190, 124, 0.32);
border-radius: 8px;
background: linear-gradient(180deg, rgba(36, 32, 25, 0.96), rgba(26, 23, 18, 0.96));
padding: clamp(16px, 2.2vw, 26px);
box-shadow: var(--shadow);
}
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 7px; }
.toolbar {
display: flex;
flex-wrap: wrap;
gap: 7px;
align-items: center;
border: 1px solid rgba(217, 190, 124, 0.28);
background: rgba(17, 16, 13, 0.52);
border-radius: 8px;
padding: 8px;
}
.toolbar input[type="file"] { display: none; }
.link-picker { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 8px; align-items: center; border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 8px; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); padding: 10px 11px; transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease; }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
textarea { min-height: 48vh; resize: vertical; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; line-height: 1.5; font-size: 14px; }
.link-picker { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 8px; align-items: center; border: 1px solid rgba(217, 190, 124, 0.28); background: rgba(17, 16, 13, 0.52); border-radius: 8px; padding: 8px; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 820; color: #c7ad74; text-transform: uppercase; letter-spacing: 0.06em; }
label span { text-transform: none; letter-spacing: 0; color: #ddcfb6; }
input, textarea, select {
width: 100%;
border: 1px solid rgba(107, 91, 57, 0.6);
border-radius: 8px;
background: var(--panel);
color: var(--ink);
padding: 11px 12px;
transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
box-shadow: inset 0 1px 5px rgba(55, 36, 16, 0.1);
}
input::placeholder, textarea::placeholder { color: #8a7b61; }
input:hover, textarea:hover, select:hover { border-color: rgba(214, 181, 102, 0.86); }
textarea {
min-height: 49vh;
resize: vertical;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
line-height: 1.58;
font-size: 14px;
background:
linear-gradient(rgba(83, 63, 32, 0.06) 1px, transparent 1px),
linear-gradient(90deg, rgba(125, 47, 54, 0.1) 1px, transparent 1px),
var(--panel);
background-size: 100% 30px, 54px 100%, auto;
box-shadow: var(--paper-shadow);
}
.content-layout { display: grid; gap: 12px; }
.content-layout.previewing { grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr); align-items: start; }
.preview-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 14px 16px; min-height: 48vh; overflow: auto; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.preview-panel h1, .preview-panel h2, .preview-panel h3 { color: var(--ink); margin: 0.8em 0 0.35em; }
.preview-panel h1 { font-size: 24px; }
.preview-panel h2 { font-size: 20px; }
.preview-panel h3 { font-size: 17px; }
.preview-panel {
border: 1px solid rgba(107, 91, 57, 0.6);
border-radius: 8px;
background:
linear-gradient(rgba(83, 63, 32, 0.045) 1px, transparent 1px),
var(--panel);
background-size: 100% 30px, auto;
color: var(--ink);
padding: 18px 20px;
min-height: 49vh;
overflow: auto;
overflow-wrap: anywhere;
text-transform: none;
letter-spacing: 0;
box-shadow: var(--paper-shadow);
}
.preview-panel h1, .preview-panel h2, .preview-panel h3 { color: #3a2416; margin: 0.8em 0 0.35em; font-family: Georgia, "Times New Roman", serif; letter-spacing: 0; text-transform: none; }
.preview-panel h1 { font-size: 27px; }
.preview-panel h2 { font-size: 22px; }
.preview-panel h3 { font-size: 18px; }
.preview-panel p, .preview-panel ul, .preview-panel ol, .preview-panel blockquote { margin: 0 0 0.8em; }
.preview-panel blockquote { border-left: 3px solid var(--line); padding-left: 10px; color: var(--muted); }
.preview-panel img, .preview-panel video { max-width: 100%; height: auto; }
.preview-panel blockquote { border-left: 3px solid #9f7d3d; padding-left: 11px; color: #604f3a; background: rgba(184, 145, 69, 0.08); }
.preview-panel img, .preview-panel video { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid rgba(107, 91, 57, 0.24); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hint { color: var(--muted); font-size: 13px; }
.hint { color: #b3a181; font-size: 13px; overflow-wrap: anywhere; }
.full { grid-column: 1 / -1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: #e3f0ec; color: #134d48; padding: 2px 7px; border-radius: 999px; font-size: 12px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.tag { background: rgba(68, 106, 87, 0.25); color: #d5eadb; border: 1px solid rgba(104, 151, 121, 0.36); padding: 2px 7px; border-radius: 999px; font-size: 12px; }
.queue-list { display: grid; gap: 8px; margin-bottom: 12px; }
.queue-item { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 10px 11px; font-size: 13px; box-shadow: 0 6px 18px rgba(31, 42, 39, 0.04); }
.queue-item strong { display: block; overflow-wrap: anywhere; }
.queue-item span { color: var(--muted); overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow: auto; max-height: 280px; background: #1d2422; color: #edf5ef; padding: 14px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow); }
.queue-item { border: 1px solid rgba(217, 190, 124, 0.26); border-radius: 8px; background: rgba(243, 234, 215, 0.08); color: #e7dac0; padding: 11px 12px; font-size: 13px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16); }
.queue-item strong { display: block; overflow-wrap: anywhere; color: #f3e6c9; }
.queue-item span { color: #b9a789; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow: auto; max-height: 280px; background: #0d0c0a; color: #ecdcbf; border: 1px solid rgba(217, 190, 124, 0.24); padding: 15px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow); }
@media (max-width: 980px) { .content-layout.previewing { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .app { grid-template-columns: 1fr; } aside, main { max-height: none; } aside { border-right: 0; border-bottom: 1px solid var(--line); } .grid { grid-template-columns: 1fr; } .link-picker { grid-template-columns: 1fr; } }
</style>
@@ -1219,6 +1352,7 @@ APP_HTML = r"""<!doctype html>
async function refreshPages() {
try {
state.pages = await api("/api/pages");
populatePageLinkSelect();
renderPages();
} catch (err) {
if (state.pages.length) {
@@ -1465,7 +1599,8 @@ APP_HTML = r"""<!doctype html>
return `[${label || page.title}](${pageUrl(page)})`;
}
function showPageLinkPicker() {
function populatePageLinkSelect() {
const selected = pageLinkSelect.value;
pageLinkSelect.innerHTML = "";
state.pages.forEach((page) => {
const option = document.createElement("option");
@@ -1473,10 +1608,16 @@ APP_HTML = r"""<!doctype html>
option.textContent = `${page.title} - ${page.path}`;
pageLinkSelect.appendChild(option);
});
if (selected && state.pages.some((page) => page.path === selected)) {
pageLinkSelect.value = selected;
}
}
function showPageLinkPicker() {
populatePageLinkSelect();
pageLinkPicker.hidden = false;
pageLinkSelect.focus();
}
showPageLinkPicker();
function insertSelectedPageLink() {
const page = state.pages.find((item) => item.path === pageLinkSelect.value);