Merge remote-tracking branch 'origin/sub_laptop_5' into sub_laptop_7

This commit is contained in:
2026-09-28 22:25:53 +09:00
5 changed files with 23 additions and 1 deletions
@@ -16,6 +16,8 @@ export interface TemplateInfo {
이름: string;
판: string;
수정일: string;
/** 프로그램이 이름으로 부르는 양식이면 그 쓰는 곳 — 있으면 못 지움 */
쓰는곳?: string;
}
export interface TemplateDoc {
@@ -81,7 +81,10 @@ def _path(kind: str, name: str) -> Path:
def _info(kind: str, path: Path) -> dict[str, Any]:
raw = path.read_bytes()
stamp = datetime.fromtimestamp(path.stat().st_mtime).isoformat(timespec="seconds")
return {"종류": kind, "이름": path.stem, "판": version_of(raw), "수정일": stamp}
row = {"종류": kind, "이름": path.stem, "판": version_of(raw), "수정일": stamp}
if (kind, path.stem) in IN_USE:
row["쓰는곳"] = IN_USE[(kind, path.stem)] # 화면이 지우기 확인 창 전에 막음
return row
def list_all() -> list[dict[str, Any]]:
@@ -332,6 +332,13 @@ export function buildSide(opt: SideOptions): SideHandle {
await refresh(); // 저장 직후여도 최신 판으로
const info = currentInfo();
if (!info) return;
if (info.쓰는곳) {
showToast(
L("M02_InUse").replace("{value}", info.이름).replace("{use}", info.쓰는곳),
"error",
);
return;
}
if (!(await showConfirmDialog(L("M02_DeleteConfirm").replace("{value}", info.이름)))) return;
try {
await deleteTemplate(info.종류, info.이름, info.판);