Pick the site icon from the library and crop it, find legal pages by search, list newest first
- The site icon is no longer a select at the end of the company data. It has its own section: a button opens the media library (upload included), then a square is dragged, resized by its corner, a slider or +/-, and previewed at 180 and 32 px. The crop is stored as fractions (faviconCrop) and the PNGs are cut from it; faviconVersion changes the link so browsers pick up a new cut. Icons without a crop keep their old link. - openMedia() takes needsAlt: false, since the icon never appears as content. The dialog styles moved from editor.css to media-dialog.css so the dialog works outside the editor. - Privacy page and imprint are chosen with the content search, like the 404 page. The picker can store the path instead of the id (valueKey/data-value). - The page and post lists in the administration sort newest first; the subpage indentation is gone there, as it would point at the wrong parent. Tests: 581 PHPUnit, 35 node, test:editor green (the consent step now picks the privacy page by search). test:admin --admin-only fails only at the known nested-interactive menu summaries. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6632836580
commit
106f84dfd5
19 files changed
+300
-69
No files matched your search
@@ -1592,6 +1592,19 @@ final class CmsTest extends TestCase
|
||||
self::assertSame([32, 32], [$size[0], $size[1]], 'Quadratisch, nicht gestaucht.');
|
||||
self::assertSame(200, $this->request('/apple-touch-icon.png')->getStatusCode());
|
||||
|
||||
// Der Zuschnitt aus dem Werkzeug: links oben, ein Viertel der kurzen Seite. Der Verweis
|
||||
// bekommt eine neue Version, sonst hielte der Browser am alten Ausschnitt fest.
|
||||
$this->site->save(['country' => 'DE', 'homePath' => 'home', 'faviconMediaId' => $item['id'], 'faviconCrop' => '0,0,0.25']);
|
||||
self::assertSame('0,0,0.25', $this->site->load()['faviconCrop']);
|
||||
self::assertStringContainsString('/favicon.png?v='.substr(md5($item['id'].'|0,0,0.25'), 0, 8), $this->request('/')->getContent());
|
||||
foreach (['2,0,0.5', '0,0,0.01', 'mitte'] as $falsch) {
|
||||
try {
|
||||
$this->site->save(['country' => 'DE', 'homePath' => 'home', 'faviconMediaId' => $item['id'], 'faviconCrop' => $falsch]);
|
||||
self::fail('Ein ungültiger Ausschnitt muss abgelehnt werden: '.$falsch);
|
||||
} catch (InvalidPage) {
|
||||
}
|
||||
}
|
||||
|
||||
// Ein winziges quadratisches Zeichen hat keine einzige der vier Regelbreiten - genau so
|
||||
// sieht ein echtes Favicon aus, und genau daran ist die erste Fassung gescheitert.
|
||||
$klein = tempnam(sys_get_temp_dir(), 'kant-zeichen-');
|
||||
|
||||
Reference in new issue
Block a user