feat(project): 프로젝트 색상·아이콘을 아사나식으로(16색 + 아이콘 42종)
- 색상표: 아사나 프로젝트 16색(8칸×2줄, 고른 색에 체크), 새 프로젝트 기본 파랑. 예전 팔레트 색 프로젝트는 그대로 유지(수정 팝업이 첫 칸으로 바꾸지 않음) - 아이콘: 아사나 프로젝트 아이콘과 같은 종류 42개(Material Symbols, self-host 글꼴에 전부 있는 것 확인). 새 프로젝트·수정 팝업에 아이콘 격자(첫 칸 Aa=없음), 사이드바 배지·프로젝트 제목에 흰 아이콘 - DB: projects.icon (scripts/sql/project_db_011_project_icon.sql). 아이콘은 고르거나 바꿨을 때만 보내서 011 적용 전에도 다른 생성·수정은 그대로 동작, 아이콘을 고르면 "마이그레이션 011 필요" 안내(503) - 색상·아이콘 칸을 label 대신 div 로(글자를 누르면 첫 버튼이 눌리던 문제) - 정적 파일 버전 20260926h Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -381,6 +381,7 @@ def _nav_projects(st: Any, user: dict[str, Any], admin: bool) -> list[dict[str,
|
||||
"id": p["id"],
|
||||
"name": p["name"],
|
||||
"color": p.get("color") or "#4573d2",
|
||||
"icon": p.get("icon") or "",
|
||||
"created_by": p.get("created_by") or "",
|
||||
"description": p.get("description") or "",
|
||||
"start_date": p.get("start_date"),
|
||||
@@ -587,6 +588,7 @@ def my_tasks_page(request: Request) -> HTMLResponse:
|
||||
"avatars": avatars,
|
||||
"priority_labels": store.PRIORITY_LABELS,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"today": today_iso,
|
||||
},
|
||||
)
|
||||
@@ -714,6 +716,7 @@ def project_page(request: Request, project_id: int) -> HTMLResponse:
|
||||
"id": p["id"],
|
||||
"name": p["name"],
|
||||
"color": p.get("color") or "#4573d2",
|
||||
"icon": p.get("icon") or "",
|
||||
"start_date": p.get("start_date"),
|
||||
"due_date": p.get("due_date"),
|
||||
"created_by": p.get("created_by") or "",
|
||||
@@ -724,6 +727,7 @@ def project_page(request: Request, project_id: int) -> HTMLResponse:
|
||||
"id": p["id"],
|
||||
"name": p["name"],
|
||||
"color": p.get("color") or "#4573d2",
|
||||
"icon": p.get("icon") or "",
|
||||
"created_by": p.get("created_by") or "",
|
||||
"description": p.get("description") or "",
|
||||
"start_date": p.get("start_date"),
|
||||
@@ -796,6 +800,7 @@ def project_page(request: Request, project_id: int) -> HTMLResponse:
|
||||
"avatars": avatars,
|
||||
"priority_labels": store.PRIORITY_LABELS,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"stage_color_palette": list(store.STAGE_COLOR_PALETTE),
|
||||
"today": today.isoformat(),
|
||||
"year": year,
|
||||
@@ -832,6 +837,9 @@ def api_list_projects(request: Request) -> JSONResponse:
|
||||
return JSONResponse({"projects": projects, "tree": _build_tree(projects)})
|
||||
|
||||
|
||||
_PROJECT_ICON_MIGRATION_MSG = "프로젝트 아이콘 기능이 아직 준비되지 않았습니다(DB 마이그레이션 011 필요)."
|
||||
|
||||
|
||||
@router.post("/api/projects")
|
||||
def api_create_project(
|
||||
request: Request, payload: dict[str, Any] = Body(...)
|
||||
@@ -849,9 +857,12 @@ def api_create_project(
|
||||
start_date=payload.get("start_date"),
|
||||
due_date=payload.get("due_date"),
|
||||
created_by=user["email"],
|
||||
icon=payload.get("icon"),
|
||||
)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc))
|
||||
except UndefinedColumn:
|
||||
raise HTTPException(status_code=503, detail=_PROJECT_ICON_MIGRATION_MSG)
|
||||
return JSONResponse({"project": project}, status_code=201)
|
||||
|
||||
|
||||
@@ -913,6 +924,8 @@ def api_update_project(
|
||||
project = st.update_project(project_id=project_id, fields=payload)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc))
|
||||
except UndefinedColumn:
|
||||
raise HTTPException(status_code=503, detail=_PROJECT_ICON_MIGRATION_MSG)
|
||||
except KeyError:
|
||||
raise HTTPException(status_code=404, detail="프로젝트를 찾을 수 없습니다.")
|
||||
return JSONResponse({"project": project})
|
||||
@@ -2001,6 +2014,7 @@ def trash_page(request: Request) -> HTMLResponse:
|
||||
"page_subtitle": "삭제한 작업 — 3개월 보관, 관리자만 복구",
|
||||
"force_sidebar_collapsed": True,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"trash_enabled": enabled,
|
||||
"items": _trash_view_items(st.list_trash()) if enabled else [],
|
||||
},
|
||||
@@ -2073,6 +2087,7 @@ def inbox_page(request: Request) -> HTMLResponse:
|
||||
"page_subtitle": "나를 태그한 작업과 프로젝트 알림",
|
||||
"force_sidebar_collapsed": True,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"notifications": items,
|
||||
"mentioned_tasks": mentioned,
|
||||
"mention_unread": _safe_mention_unread(st, user["email"]),
|
||||
|
||||
Reference in New Issue
Block a user