feat(ui): page header actions — Edit (accent) + Revisions menu (view/restore) + Export, top-right
Editor refactored to expose controls; Edit moved into the doc header as the orange primary action; new Revisions dropdown lists page_revisions with a modal preview + Restore. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { markdownEditor } from '../components/markdown_editor.js';
|
||||
import { backButton } from '../components/backbtn.js';
|
||||
import { breadcrumb } from '../components/breadcrumb.js';
|
||||
import { exportMenu } from '../components/export_menu.js';
|
||||
import { revisionsMenu } from '../components/revisions_menu.js';
|
||||
|
||||
export async function render(main, ctx) {
|
||||
const id = ctx.params.id;
|
||||
@@ -33,11 +34,15 @@ export async function render(main, ctx) {
|
||||
mount(main,
|
||||
el('div', { class: 'doc-head' },
|
||||
el('div', { class: 'doc-head-left' }, backButton(), breadcrumb(page)),
|
||||
exportMenu({ filenameBase: page.slug, getContent: async () => ({ title: page.title, md: page.body_md || '' }) })
|
||||
el('div', { class: 'doc-actions' },
|
||||
revisionsMenu(id, (md) => editor.setValue(md)),
|
||||
editor.controls,
|
||||
exportMenu({ filenameBase: page.slug, getContent: async () => ({ title: page.title, md: editor.value() }) })
|
||||
)
|
||||
),
|
||||
el('h1', { class: 'view-h1' }, page.title),
|
||||
el('p', { class: 'view-sub muted' }, '/' + page.slug),
|
||||
editor,
|
||||
editor.pane,
|
||||
backlinksCard
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user