add legal page editor integration and media library polish
Some checks failed
deploy / deploy (push) Has been cancelled

Legal pages (privacy, delivery, terms) now auto-populate content from
shop settings on mount, show auto-generated vs customised badges, and
have a regenerate button. Theme editor gains alt text fields for logo,
header, and icon images. Image picker in page builder now has an upload
button and alt text warning badges. Clearing unused image references
shows an orphan info flash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-28 17:55:02 +00:00
parent 3336b3aa26
commit 93ff66debc
9 changed files with 495 additions and 11 deletions

View File

@@ -471,6 +471,7 @@ defmodule BerrypodWeb.BlockEditorComponents do
attr :images, :list, required: true
attr :search, :string, required: true
attr :event_prefix, :string, default: ""
attr :upload, :any, default: nil
def image_picker(assigns) do
search = String.downcase(assigns.search)
@@ -511,6 +512,16 @@ defmodule BerrypodWeb.BlockEditorComponents do
autofocus
/>
<div :if={@upload} class="image-picker-upload">
<form phx-change="noop" phx-submit="noop">
<label class="image-picker-upload-label">
<.icon name="hero-arrow-up-tray" class="size-4" />
<span>Upload new image</span>
<.live_file_input upload={@upload} class="hidden" />
</label>
</form>
</div>
<div class="image-picker-grid">
<button
:for={image <- @filtered_images}
@@ -532,6 +543,13 @@ defmodule BerrypodWeb.BlockEditorComponents do
/>
<% end %>
<span class="image-picker-item-name">{image.filename}</span>
<span
:if={!image.alt || image.alt == ""}
class="image-picker-item-no-alt"
title="Missing alt text"
>
<.icon name="hero-exclamation-triangle-mini" class="size-3" />
</span>
</button>
<p :if={@filtered_images == []} class="image-picker-empty">