"""
return layout(
"Amazon.com Gift Cards",
body,
cart_count,
body_class="specialty-page gift-cards-page",
account_name=account_name,
)
def gift_card_preview_page(
preview: dict[str, Any], cart_count: int, account_name: str | None
) -> str:
design = str(preview.get("design", "classic"))
design_label = GIFT_DESIGNS.get(design, GIFT_DESIGNS["classic"])
recipient = "For me" if preview.get("recipient_kind") == "self" else "For someone else"
amount = money(int(preview.get("amount_minor", 0)), "USD")
body = f"""
{_simulation_notice("This is a saved preview in this browser session. It is not in the cart and no payment or Gift Card value exists.")}
amazon{amount}
Local Gift Card preview #{int(preview['preview_id'])}
{_simulation_notice("Nothing saved here is published, searchable by other shoppers, or sent to Amazon. No seller identity, tax, bank, or payout data is collected.")}
1
What will you sell?
Choose a supported local catalog category and write a clear title.
2
How will you offer it?
Set condition, price, and quantity. The server validates every field.
3
Ready to publish?
Review the local result. Publishing and fulfillment stay intentionally unavailable.
Getting started
Save a local listing draft
Estimate gross listing value from price × quantity without implying fees, revenue, or real sales.
Your browser session
Saved listing drafts
{draft_cards}
Why model selling?
It connects catalog information, inventory choices, validation, and a review step.
Local incentives
There are no promotional credits or seller benefits in this clone.
Next step
Use the saved result to review data before a hypothetical publish action.
"""
return layout(
"Sell on Amazon - local draft",
body,
cart_count,
body_class="specialty-page specialty-sell-page",
account_name=account_name,
)
def seller_draft_page(
draft: dict[str, Any], cart_count: int, account_name: str | None
) -> str:
gross_minor = int(draft["price_minor"]) * int(draft["quantity"])
body = f"""
{_simulation_notice("This draft belongs only to this browser session and is not a public Amazon listing.")}
"""
return layout(
"Local seller listing draft",
body,
cart_count,
body_class="specialty-page specialty-result-page",
account_name=account_name,
)
def registry_page(
own_registries: Iterable[dict[str, Any]], cart_count: int, account_name: str | None
) -> str:
type_cards = "".join(
f'{icon}{escape(label)}{escape(copy)}'
for (key, label), icon, copy in zip(
REGISTRY_TYPES.items(),
("💍", "🧸", "🎁"),
("Plan shared gift ideas", "Prepare for a new arrival", "Collect ideas for any occasion"),
)
)
type_options = "".join(
f''
for key, label in REGISTRY_TYPES.items()
)
own_cards = "".join(
f'{escape(str(item["registry_name"]))}{escape(REGISTRY_TYPES.get(str(item["registry_type"]), str(item["registry_type"])))}Private local draft'
for item in own_registries
) or '
No registry drafts saved in this browser session.
'
body = f"""
Registry & Gift List
Find a registry or create your own
Search local demo registries and your own private browser-session drafts.
{_simulation_notice("Registry drafts are private to this browser session. They are not published to Amazon and are never exposed in another visitor's search results.")}
Choose the list that fits
Baby Registry, Wedding Registry, and Gift List
{type_cards}
Create and personalize
Start a private local registry draft
After saving, build the idea list by browsing Books, Home, Toys, Beauty, or Electronics.
Reasons and benefits
One place to organize gift ideas
Personalize
Name the event and choose the kind of registry.
Build
Use the live catalog links on the saved detail page.
Keep it private
Only the creating browser session can open the draft.
{own_cards}
"""
return layout(
"Amazon Registry & Gift List",
body,
cart_count,
body_class="specialty-page specialty-registry-page",
account_name=account_name,
)
def registry_search_page(
query: str,
results: Iterable[dict[str, Any]],
cart_count: int,
account_name: str | None,
) -> str:
cards: list[str] = []
for item in results:
label = REGISTRY_TYPES.get(str(item.get("registry_type")), "Gift List")
if item.get("is_own"):
href = REGISTRY_DETAIL_PATH + "?" + urlencode(
{"registryID": int(item["registry_id"])}
)
action = f'Open your private draft'
else:
action = "Local demo result — no personal data"
cards.append(
f'
{escape(label)}
{escape(str(item["registry_name"]))}
{escape(str(item["owner_name"]))}{action}'
)
result_markup = "".join(cards) or '
No local demo or private draft matched that search.
'
body = f"""
Results for “{escape(query)}”
{result_markup}
{_simulation_notice("Only built-in demo entries and registries owned by this browser session are searchable here.")}
"""
return layout(
"Find a local registry",
body,
cart_count,
body_class="specialty-page specialty-registry-page",
account_name=account_name,
)
def registry_detail_page(
item: dict[str, Any], cart_count: int, account_name: str | None
) -> str:
date_copy = escape(str(item.get("event_date") or "No event date selected"))
body = f"""
{_simulation_notice("This registry exists only in the creating browser session and is not published or shared.")}