Address LaySite 1.4.5 editor and release review suggestions
This commit is contained in:
@@ -324,6 +324,7 @@ class AdminController
|
||||
$layoutKind = $page['layout_kind'];
|
||||
$layout = $layoutKind === null ? null : DesignLibrary::find($page['layout_id'], $layoutKind);
|
||||
$default = $layout && ($site[$layoutKind . '_id'] ?? null) === $layout['id'];
|
||||
$headEditor = !$layout && array_key_exists('head_html', $page);
|
||||
$error = '';
|
||||
if ($request->method() === 'POST') {
|
||||
$data = [];
|
||||
@@ -348,6 +349,9 @@ class AdminController
|
||||
}
|
||||
try {
|
||||
if ($head !== null) {
|
||||
if (!$headEditor) {
|
||||
throw new RuntimeException(Database::MIGRATION_REQUIRED);
|
||||
}
|
||||
$data['head_html'] = PageHead::normalize($head);
|
||||
}
|
||||
$data['actions'] = $request->post('hero_actions') === null ? $page['actions']
|
||||
@@ -426,7 +430,7 @@ class AdminController
|
||||
|
||||
return $this->render($request, 'admin-page', [
|
||||
'title' => '编辑 ' . $page['name'], 'page' => $page, 'categories' => $repo->categories(), 'wideAdmin' => true, 'canvasSourceEditor' => true, 'error' => $error, 'saved' => $request->get('saved') === '1',
|
||||
'pageTemplateDrawer' => !$layout, 'headEditor' => !$layout, 'designs' => DesignLibrary::all(), 'layout' => $layout, 'layoutDefault' => $default,
|
||||
'pageTemplateDrawer' => !$layout, 'headEditor' => $headEditor, 'designs' => DesignLibrary::all(), 'layout' => $layout, 'layoutDefault' => $default,
|
||||
'layoutBase' => $layout && ($site['layout_defaults'][$layoutKind] ?? null) === $layout['id'],
|
||||
'siteName' => $site['name'], 'layoutHasMember' => $layoutKind === 'header' && LayoutPage::hasMember($page['sections']),
|
||||
'layoutDefaults' => array_intersect_key($site, ['header_id' => true, 'footer_id' => true]),
|
||||
|
||||
@@ -34,7 +34,7 @@ final class McpController
|
||||
return new Response(503, ['Cache-Control' => 'no-store']);
|
||||
}
|
||||
$secret = $settings['token'];
|
||||
if ($settings['enabled'] && $secret === null) {
|
||||
if ($settings['migrationRequired'] || ($settings['enabled'] && $secret === null)) {
|
||||
return new Response(503, ['Cache-Control' => 'no-store']);
|
||||
}
|
||||
$header = $request->header('authorization', '');
|
||||
|
||||
Reference in New Issue
Block a user