generated from westfarn/web_django_template
Ship Print Forge shop site (colors, photos, 3D viewer) (#2)
## Summary - Rebrand the Django client template as Print Forge (`client_site` → `print_forge`) with shop + shipping enabled. - Product listings support multiple photos, color variants (shared price/description/STL, per-color stock and photos), and a photo-first / 3D-second gallery. - Public pages use 3D printer / printed-toy photography instead of leftover t-shirt mockups; beta CI deploys on `master`. Closes #1 Infra: [server-infra#27](ai_ml_operations/server-infra#27) (easy deploy beta). ## Test plan - [ ] Product page shows photo first, 3D model second; color swatches swap photos and stock - [ ] Portal can upload multiple photos and per-color qty/images; STL stays shared - [ ] Public home/about/gallery have no t-shirt mockups - [ ] `manage.py test` passes - [ ] After server-infra#27: beta deploy to `print-forge-preview.aimloperations.com` Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -34,6 +34,20 @@ def site_branding(request):
|
||||
}
|
||||
|
||||
|
||||
def shop_cart(request):
|
||||
from django.apps import apps as django_apps
|
||||
|
||||
if not django_apps.is_installed("shop"):
|
||||
return {"cart_count": 0}
|
||||
session = getattr(request, "session", None)
|
||||
if session is None:
|
||||
return {"cart_count": 0}
|
||||
from shop.services import cart_lines
|
||||
|
||||
lines = cart_lines(session)
|
||||
return {"cart_count": sum(line["quantity"] for line in lines)}
|
||||
|
||||
|
||||
def tianji_tracking(request):
|
||||
match = getattr(request, "resolver_match", None)
|
||||
url_name = getattr(match, "url_name", "") or ""
|
||||
@@ -63,6 +77,15 @@ def tianji_tracking(request):
|
||||
nav_section = "social_accounts"
|
||||
elif namespace == "social":
|
||||
nav_section = "social"
|
||||
elif namespace == "shop_portal":
|
||||
if url_name.startswith("product"):
|
||||
nav_section = "shop_products"
|
||||
elif url_name.startswith("order"):
|
||||
nav_section = "shop_orders"
|
||||
elif url_name == "sales":
|
||||
nav_section = "shop_sales"
|
||||
elif namespace == "shop":
|
||||
nav_section = "shop"
|
||||
|
||||
return {
|
||||
"tianji_enabled": getattr(settings, "TIANJI_ENABLED", False)
|
||||
|
||||
Reference in New Issue
Block a user