From 0ca2bd6d41317bed822943b5d97ef312fcb16ac7 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Fri, 8 May 2026 11:55:06 +0800 Subject: [PATCH] fix: use forEach for edit photos, cleaner JS no confirm --- internal/web/ui/templates/face_gallery.html | 27 ++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/internal/web/ui/templates/face_gallery.html b/internal/web/ui/templates/face_gallery.html index 9a2e3c9..b9be551 100644 --- a/internal/web/ui/templates/face_gallery.html +++ b/internal/web/ui/templates/face_gallery.html @@ -25,8 +25,8 @@ {{if .Photos}} {{if gt .PhotoCount 1}} - - + + {{end}} {{else}}
无照片
@@ -65,7 +65,7 @@ function navPhoto(id,dir){ document.getElementById('next-'+id).style.display=d.idx===d.photos.length-1?'none':''; } function showImport(){ - document.getElementById('modal-body').innerHTML='

批量导入

选择按姓名分目录的照片根目录。
'; + document.getElementById('modal-body').innerHTML='

批量导入

选择按姓名分目录的照片根目录
'; document.getElementById('modal').style.display='flex'; } function showAdd(){ @@ -73,14 +73,19 @@ function showAdd(){ document.getElementById('modal').style.display='flex'; } function showEdit(id,name,photos){ - document.getElementById('modal-body').innerHTML='

编辑人员

'+ - '
'+ - ''+ - '
'+ - '
'+photos.map(function(p){return '
';}).join('')+'
'+ - '
'+ - ''+ - '
'; + var html='

编辑人员

'; + html+='
'; + html+=''; + html+='
'; + html+='
'; + photos.forEach(function(p){ + html+='
'; + }); + html+='
'; + html+='
'; + html+=''; + html+='
'; + document.getElementById('modal-body').innerHTML=html; document.getElementById('modal').style.display='flex'; } function closeModal(){document.getElementById('modal').style.display='none';}