2aa6b6efae
- Super admin only: /notice/ page (title, body with images, show time KST, all or picked people,
preview, edit with optional re-show, cancel/undo, per-person acknowledgement status)
- Shown on every ERP page (erp_base, main, admin) dead center; [확인] only (no Esc/backdrop close),
queue in order, ack failure keeps the dialog, closes when acked/cancelled elsewhere
- project_db migration 024 (urgent_notices, targets, acks, images as bytea); shares ProjectStore.pool
- Body sanitized like task descriptions, images restricted to /notice/images/{id}, type sniffed
- Entry points: ERP sidebar foot and Project options dialog (super admin)
- Docs (NOTICE_MODULE, DEPLOYMENT 024, overview, CLAUDE.md); tests (DB-less, real PostgreSQL, jsdom)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
970 B
Python
24 lines
970 B
Python
"""긴급 공지 — ERP 전체 화면 가운데에 띄우는 공지(2026-10-12).
|
|
|
|
- 라우터: `router.py` (prefix=/notice) — 만들기·고치기는 수퍼관리자만, 받기·[확인]은 로그인 사용자 누구나
|
|
- 저장소: `db.py` (project_db 마이그레이션 024 의 urgent_notice* 표 — 프로젝트 저장소의 연결 풀을 같이 쓴다)
|
|
- 검증: `store.py`
|
|
- 화면: 관리 `templates/notice/admin.html` + `static/erp-notice-admin.js`, 표시 `static/erp-notice.js`(erp_base.html 공용)
|
|
상세는 docs/NOTICE_MODULE.md.
|
|
"""
|
|
|
|
from typing import Any
|
|
|
|
from .router import router
|
|
|
|
__all__ = ["router", "build_notice_store"]
|
|
|
|
|
|
def build_notice_store(project_store: Any) -> Any:
|
|
"""프로젝트 저장소(PROJECT_DB_URL)가 있으면 그 연결 풀로 NoticeStore, 없으면 None(공지 API 는 503)."""
|
|
if project_store is None:
|
|
return None
|
|
from .db import NoticeStore # noqa: WPS433
|
|
|
|
return NoticeStore(project_store.pool)
|