작품 목록 분리: 판매 중 / 판매 완료(카톡 제작 문의 버튼)

This commit is contained in:
한땀 작업실 committed 2026-11-01 04:56:29 +00:00
1 parent aba5d4d6e2
commit b803ab4efd
6 files changed
+157 -8

No files matched your search

+15 -2
View File
@@ -370,6 +370,7 @@ def build_shared(site: Dict[str, Any], home: str, asset_prefix: str) -> Dict[str
"credits": credits,
"home": home,
"asset_prefix": asset_prefix,
"kakao_url": esc(str(contact.get("kakao", "")).strip()),
}
@@ -390,6 +391,7 @@ def product_loop_items(products: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
"subtitle": esc(product.get("subtitle", "")),
"price_text": format_price(product.get("price")),
"sold_html": sold_html,
"inquiry_title": esc(product["title"]),
}
)
return items
@@ -479,7 +481,13 @@ def build_index(
"hero_material": esc(featured.get("material", "")),
"hero_href": f"p/{featured['slug']}.html",
"works_note": esc(site.get("works_note", "")),
"products": product_loop_items(products),
"products": product_loop_items([p for p in products if not p.get("sold_out")]),
"sold_products": product_loop_items([p for p in products if p.get("sold_out")]),
"sold_count": str(sum(1 for p in products if p.get("sold_out"))),
"sold_empty_html": ("" if any(p.get("sold_out") for p in products)
else '<p class="note">아직 판매 완료된 작품이 없습니다. 판매되면 이 자리에 모아 두고, 같은 무늬로 다시 만들 수 있도록 문의 버튼을 붙입니다.</p>'),
"sold_note": esc(site.get("sold_works_note", "")),
"kakao_url": esc(str(site.get("contact", {}).get("kakao", "")).strip()),
"process": process_loop_items(steps),
"process_intro": esc(site.get("process_intro", "")),
"kit_title": esc(kit["title"]),
@@ -526,7 +534,11 @@ def build_product_page(
width, height = image_size(image)
if product.get("sold_out"):
buy_html = '<p class="pending">판매 완료 — 재제작을 원하시면 문의해 주세요</p>'
buy_html = (
f'<button class="btn inquiry-btn" type="button" data-inquiry="{esc(product["title"])}">'
"카톡으로 제작 문의</button>"
'<p class="inquiry-note">재고가 없어 주문을 받은 뒤 제작합니다. 아래 문구가 복사되니 카톡 대화창에 붙여넣어 주세요.</p>'
)
else:
naver_url = str(product.get("naver_url", "")).strip()
if naver_url:
@@ -591,6 +603,7 @@ def build_product_page(
"price_note_html": price_note_html,
"sold_html": '<p class="product-sold">판매 완료</p>' if product.get("sold_out") else "",
"buy_html": buy_html,
"inquiry_title": esc(product["title"]),
"material": esc(material) or "—",
"size": esc(product.get("size", "")) or "—",
"care": esc(product.get("care", "")) or "—",