feat: add default content pages for delivery, privacy and terms
Replace one-off ShopLive.About with generic ShopLive.Content that handles all static content pages via live_action. Add delivery & returns, privacy policy, and terms of service pages with sample content. Update footer help links and theme editor preview. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
<div
|
||||
id="shop-container"
|
||||
phx-hook="CartPersist"
|
||||
class="shop-container min-h-screen pb-20 md:pb-0"
|
||||
style="background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);"
|
||||
>
|
||||
<.skip_link />
|
||||
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
<.announcement_bar theme_settings={@theme_settings} />
|
||||
<% end %>
|
||||
|
||||
<.shop_header
|
||||
theme_settings={@theme_settings}
|
||||
logo_image={@logo_image}
|
||||
header_image={@header_image}
|
||||
active_page="about"
|
||||
mode={@mode}
|
||||
cart_count={@cart_count}
|
||||
/>
|
||||
|
||||
<main id="main-content" class="content-page" style="background-color: var(--t-surface-base);">
|
||||
<.hero_section
|
||||
title="About the studio"
|
||||
description="Your story goes here – this is sample content for the demo shop"
|
||||
background={:sunken}
|
||||
/>
|
||||
|
||||
<.content_body
|
||||
image_src="/mockups/night-sky-blanket-3"
|
||||
image_alt="Night sky blanket draped over a chair"
|
||||
>
|
||||
<.rich_text blocks={SimpleshopTheme.Theme.PreviewData.about_content()} />
|
||||
</.content_body>
|
||||
</main>
|
||||
|
||||
<.shop_footer theme_settings={@theme_settings} mode={@mode} />
|
||||
|
||||
<.cart_drawer
|
||||
cart_items={@cart_items}
|
||||
subtotal={@cart_subtotal}
|
||||
cart_count={@cart_count}
|
||||
mode={@mode}
|
||||
open={assigns[:cart_drawer_open] || false}
|
||||
cart_status={assigns[:cart_status]}
|
||||
/>
|
||||
|
||||
<.search_modal hint_text={~s(Try a search – e.g. "mountain" or "notebook")} />
|
||||
|
||||
<.mobile_bottom_nav active_page="about" mode={@mode} />
|
||||
</div>
|
||||
@@ -0,0 +1,71 @@
|
||||
<div
|
||||
id="shop-container"
|
||||
phx-hook="CartPersist"
|
||||
class="shop-container min-h-screen pb-20 md:pb-0"
|
||||
style="background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);"
|
||||
>
|
||||
<.skip_link />
|
||||
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
<.announcement_bar theme_settings={@theme_settings} />
|
||||
<% end %>
|
||||
|
||||
<.shop_header
|
||||
theme_settings={@theme_settings}
|
||||
logo_image={@logo_image}
|
||||
header_image={@header_image}
|
||||
active_page={@active_page}
|
||||
mode={@mode}
|
||||
cart_count={@cart_count}
|
||||
/>
|
||||
|
||||
<main id="main-content" class="content-page" style="background-color: var(--t-surface-base);">
|
||||
<%= if assigns[:hero_background] do %>
|
||||
<.hero_section
|
||||
title={@hero_title}
|
||||
description={@hero_description}
|
||||
background={@hero_background}
|
||||
/>
|
||||
<% else %>
|
||||
<.hero_section
|
||||
variant={:page}
|
||||
title={@hero_title}
|
||||
description={@hero_description}
|
||||
/>
|
||||
<% end %>
|
||||
|
||||
<div style="padding: var(--space-xl) var(--space-lg); max-width: 800px; margin: 0 auto;">
|
||||
<%= if assigns[:image_src] do %>
|
||||
<div
|
||||
class="content-image"
|
||||
style="margin-bottom: var(--space-lg); border-radius: var(--t-radius-image); overflow: hidden;"
|
||||
>
|
||||
<.responsive_image
|
||||
src={@image_src}
|
||||
source_width={1200}
|
||||
alt={@image_alt}
|
||||
sizes="(max-width: 800px) 100vw, 800px"
|
||||
class="w-full h-[300px] object-cover"
|
||||
/>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<.rich_text blocks={@content_blocks} />
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<.shop_footer theme_settings={@theme_settings} mode={@mode} />
|
||||
|
||||
<.cart_drawer
|
||||
cart_items={@cart_items}
|
||||
subtotal={@cart_subtotal}
|
||||
cart_count={@cart_count}
|
||||
mode={@mode}
|
||||
open={assigns[:cart_drawer_open] || false}
|
||||
cart_status={assigns[:cart_status]}
|
||||
/>
|
||||
|
||||
<.search_modal hint_text={~s(Try a search – e.g. "mountain" or "notebook")} />
|
||||
|
||||
<.mobile_bottom_nav active_page={@active_page} mode={@mode} />
|
||||
</div>
|
||||
@@ -691,22 +691,33 @@ defmodule SimpleshopThemeWeb.ShopComponents do
|
||||
<a
|
||||
href="#"
|
||||
phx-click="change_preview_page"
|
||||
phx-value-page="about"
|
||||
phx-value-page="delivery"
|
||||
class="transition-colors hover:opacity-80"
|
||||
style="color: var(--t-text-secondary); cursor: pointer;"
|
||||
>
|
||||
Delivery
|
||||
Delivery & returns
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="#"
|
||||
phx-click="change_preview_page"
|
||||
phx-value-page="about"
|
||||
phx-value-page="privacy"
|
||||
class="transition-colors hover:opacity-80"
|
||||
style="color: var(--t-text-secondary); cursor: pointer;"
|
||||
>
|
||||
Returns
|
||||
Privacy policy
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="#"
|
||||
phx-click="change_preview_page"
|
||||
phx-value-page="terms"
|
||||
class="transition-colors hover:opacity-80"
|
||||
style="color: var(--t-text-secondary); cursor: pointer;"
|
||||
>
|
||||
Terms of service
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -723,20 +734,29 @@ defmodule SimpleshopThemeWeb.ShopComponents do
|
||||
<% else %>
|
||||
<li>
|
||||
<a
|
||||
href="/contact"
|
||||
href="/delivery"
|
||||
class="transition-colors hover:opacity-80"
|
||||
style="color: var(--t-text-secondary);"
|
||||
>
|
||||
Delivery
|
||||
Delivery & returns
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="/contact"
|
||||
href="/privacy"
|
||||
class="transition-colors hover:opacity-80"
|
||||
style="color: var(--t-text-secondary);"
|
||||
>
|
||||
Returns
|
||||
Privacy policy
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="/terms"
|
||||
class="transition-colors hover:opacity-80"
|
||||
style="color: var(--t-text-secondary);"
|
||||
>
|
||||
Terms of service
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -4205,6 +4225,16 @@ defmodule SimpleshopThemeWeb.ShopComponents do
|
||||
"""
|
||||
end
|
||||
|
||||
defp rich_text_block(%{block: %{type: :list}} = assigns) do
|
||||
~H"""
|
||||
<ul class="mb-4 ml-6 list-disc" style="color: var(--t-text-secondary);">
|
||||
<%= for item <- @block.items do %>
|
||||
<li class="mb-1">{item}</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
"""
|
||||
end
|
||||
|
||||
defp rich_text_block(assigns) do
|
||||
~H"""
|
||||
<p class="mb-4" style="color: var(--t-text-secondary);">
|
||||
|
||||
Reference in New Issue
Block a user