feat(showcase): lightbox, checkbox per-card toggle, lazyload, fix toggle Y-align, remove navbar on public page

This commit is contained in:
2026-07-06 00:24:03 +08:00
parent 2c0229b12f
commit 66ba163ef6
7 changed files with 98 additions and 28 deletions

View File

@@ -514,12 +514,12 @@ def profile_showcase_save(
@router.post("/postcards/{postcard_id}/showcase-toggle")
def postcard_showcase_toggle(postcard_id: int, showcase_hidden: str = Form(""), user: User = Depends(get_current_user_web), db: Session = Depends(get_db)):
def postcard_showcase_toggle(postcard_id: int, showcase_visible: str = Form(""), user: User = Depends(get_current_user_web), db: Session = Depends(get_db)):
pc = db.query(Postcard).filter(Postcard.id == postcard_id).first()
if pc:
profile = db.query(Profile).filter(Profile.id == pc.profile_id, Profile.user_id == user.id).first()
if profile and profile.showcase_enabled:
pc.showcase_hidden = showcase_hidden == "1"
pc.showcase_hidden = showcase_visible != "1"
db.commit()
return _redirect("/settings?tab=showcase")