add settings editor component for unified on-site editing
All checks were successful
deploy / deploy (push) Successful in 4m13s
All checks were successful
deploy / deploy (push) Successful in 4m13s
Phase 3b of unified editing mode. The Settings tab now shows context-specific forms: custom pages get editable title, slug, meta, visibility and nav options; system pages get read-only info with links to admin; product/collection pages show provider info. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -112,6 +112,12 @@ defmodule BerrypodWeb.PageRenderer do
|
||||
theme_editor_presets={Map.get(assigns, :theme_editor_presets, [])}
|
||||
theme_editor_customise_open={Map.get(assigns, :theme_editor_customise_open, false)}
|
||||
site_name={Map.get(assigns, :site_name, "")}
|
||||
product={assigns[:product]}
|
||||
collection_title={assigns[:collection_title]}
|
||||
live_action={assigns[:live_action]}
|
||||
settings_form={Map.get(assigns, :settings_form)}
|
||||
settings_dirty={Map.get(assigns, :settings_dirty, false)}
|
||||
settings_save_status={Map.get(assigns, :settings_save_status, :idle)}
|
||||
/>
|
||||
</.editor_sheet>
|
||||
"""
|
||||
@@ -138,6 +144,12 @@ defmodule BerrypodWeb.PageRenderer do
|
||||
attr :theme_editor_presets, :list, default: []
|
||||
attr :theme_editor_customise_open, :boolean, default: false
|
||||
attr :site_name, :string, default: ""
|
||||
attr :product, :map, default: nil
|
||||
attr :collection_title, :string, default: nil
|
||||
attr :live_action, :atom, default: nil
|
||||
attr :settings_form, :map, default: nil
|
||||
attr :settings_dirty, :boolean, default: false
|
||||
attr :settings_save_status, :atom, default: :idle
|
||||
|
||||
defp editor_panel_content(%{editor_active_tab: :page} = assigns) do
|
||||
~H"""
|
||||
@@ -174,7 +186,15 @@ defmodule BerrypodWeb.PageRenderer do
|
||||
|
||||
defp editor_panel_content(%{editor_active_tab: :settings} = assigns) do
|
||||
~H"""
|
||||
<.settings_editor_content page={@page} site_name={@site_name} />
|
||||
<BerrypodWeb.ShopComponents.SettingsEditor.settings_editor
|
||||
page={@page}
|
||||
product={@product}
|
||||
collection_title={@collection_title}
|
||||
live_action={@live_action}
|
||||
settings_form={@settings_form}
|
||||
settings_dirty={@settings_dirty}
|
||||
settings_save_status={@settings_save_status}
|
||||
/>
|
||||
"""
|
||||
end
|
||||
|
||||
@@ -198,37 +218,6 @@ defmodule BerrypodWeb.PageRenderer do
|
||||
"""
|
||||
end
|
||||
|
||||
# Settings editor content - shows page/shop settings
|
||||
attr :page, :map, default: nil
|
||||
attr :site_name, :string, default: ""
|
||||
|
||||
defp settings_editor_content(assigns) do
|
||||
~H"""
|
||||
<div class="editor-settings-content">
|
||||
<%= if @page do %>
|
||||
<div class="theme-section">
|
||||
<label class="theme-section-label">Page</label>
|
||||
<p class="admin-text-secondary">{@page.title}</p>
|
||||
</div>
|
||||
<div class="theme-section">
|
||||
<p class="admin-text-secondary">
|
||||
Page settings like SEO, visibility, and slug editing coming soon.
|
||||
For now, <a href="/admin/pages" class="admin-link">manage pages in admin</a>.
|
||||
</p>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="theme-section">
|
||||
<p class="admin-text-secondary">
|
||||
This page doesn't have editable settings.
|
||||
<a href="/admin/settings" class="admin-link">Shop settings</a>
|
||||
can be changed in admin.
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
# Editor sheet content - the block list and editing controls
|
||||
attr :page, :map, default: nil
|
||||
attr :editing_blocks, :list, default: nil
|
||||
|
||||
Reference in New Issue
Block a user