feat(project): 보드 가로 스크롤 · 카드 인라인 편집 · 내 업무 사이드 메뉴 · @태그
- 보드: 매이슨리 절대배치 제거 → 아사나식 flex 가로 배치. 세션이 늘어나면
아래로 접히지 않고 계속 오른쪽으로 이어지고, 보드가 가로로 스크롤된다
(막대는 attachHScrollIndicator 가 직접 그린다). 긴 세션은 컬럼 안에서 세로 스크롤.
- 카드: 담당자/마감일을 클릭하면 팝업을 열지 않고 그 자리에서 바꾼다.
값이 없는 칩은 카드 호버 시 흐리게 나타나 바로 지정할 수 있다.
- 내 업무: 화면 오른쪽 상시 패널을 없애고 좌측 사이드바의 접이식 메뉴로 이전
(기본 접힘, 업무를 고르면 팝업이 열리며 다시 접힘). 레이아웃 3열 → 2열.
- 설명란: 웹주소를 붙여넣으면 자동 링크(target=_blank), 클릭하면 새 탭으로 연다.
contenteditable 은 브라우저가 링크를 기본으로 열지 않아 클릭을 직접 받는다.
- @태그: 설명란·댓글에서 @ 로 멤버를 고른다. 설명란은 멘션 칩(data-email),
댓글은 화면이 고른 이메일을 함께 전송. 서버는 설명란의 경우 저장될 HTML 에서
직접 이메일을 뽑는다(화면이 보낸 목록을 믿지 않는다).
태그된 사람은 수신함(/project/inbox)에서 그 업무를 리스트로 본다.
DB: 마이그레이션 006(task_mentions) 신규 — 배포 시 적용 필요.
미적용 환경에서도 화면이 죽지 않게 멘션 조회/기록은 모두 감쌌다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -922,6 +922,90 @@ class ProjectStore:
|
||||
)
|
||||
return cur.rowcount or 0
|
||||
|
||||
# ════════════════════════════════════════════════════════════
|
||||
# 멘션(@태그) — task_mentions
|
||||
#
|
||||
# 설명란/댓글에서 @로 지정된 사람. 수신함의 "나를 태그한 업무" 목록이
|
||||
# 이걸 읽는다. 같은 자리(설명란=comment_id NULL, 또는 같은 댓글)에서 같은
|
||||
# 사람을 두 번 저장하지 않는다(마이그레이션 006 의 UNIQUE 인덱스).
|
||||
# ════════════════════════════════════════════════════════════
|
||||
def add_mentions(
|
||||
self, *, task_id: int, emails: list[str], actor_email: str = "",
|
||||
comment_id: int | None = None, source: str = "description",
|
||||
) -> list[str]:
|
||||
"""멘션을 기록하고 '이번에 새로 추가된' 이메일만 돌려준다(알림 대상)."""
|
||||
actor = store.norm_str(actor_email, lower=True)
|
||||
targets = [e for e in store.normalize_emails(emails) if e != actor]
|
||||
if not targets:
|
||||
return []
|
||||
added: list[str] = []
|
||||
with self._pool.connection() as conn:
|
||||
for email in targets:
|
||||
cur = conn.execute(
|
||||
"INSERT INTO task_mentions "
|
||||
"(task_id, comment_id, mentioned_email, actor_email, source) "
|
||||
"VALUES (%s,%s,%s,%s,%s) ON CONFLICT DO NOTHING",
|
||||
(task_id, comment_id, email, actor, source),
|
||||
)
|
||||
if cur.rowcount:
|
||||
added.append(email)
|
||||
return added
|
||||
|
||||
def list_mentioned_tasks(
|
||||
self, *, mentioned_email: str, limit: int = 100
|
||||
) -> list[dict[str, Any]]:
|
||||
"""내가 태그된 업무 목록(업무 1건당 1행, 가장 최근 태그 기준 정렬)."""
|
||||
email = store.norm_str(mentioned_email, lower=True)
|
||||
with self._pool.connection() as conn:
|
||||
rows = conn.execute(
|
||||
"""
|
||||
SELECT t.*, p.name AS project_name, p.color AS project_color,
|
||||
s.name AS stage_name,
|
||||
m.last_at AS mentioned_at,
|
||||
m.unread AS unread_mentions,
|
||||
m.last_actor AS mention_actor
|
||||
FROM (
|
||||
SELECT task_id,
|
||||
MAX(created_at) AS last_at,
|
||||
COUNT(*) FILTER (WHERE NOT is_read) AS unread,
|
||||
(ARRAY_AGG(actor_email ORDER BY created_at DESC))[1] AS last_actor
|
||||
FROM task_mentions
|
||||
WHERE mentioned_email = %s
|
||||
GROUP BY task_id
|
||||
) m
|
||||
JOIN tasks t ON t.id = m.task_id
|
||||
JOIN projects p ON p.id = t.project_id
|
||||
LEFT JOIN project_stages s ON s.id = t.stage_id
|
||||
ORDER BY m.last_at DESC
|
||||
LIMIT %s
|
||||
""",
|
||||
(email, int(limit)),
|
||||
).fetchall()
|
||||
return [self._serialize(r) for r in rows]
|
||||
|
||||
def count_unread_mentions(self, *, mentioned_email: str) -> int:
|
||||
with self._pool.connection() as conn:
|
||||
row = conn.execute(
|
||||
"SELECT COUNT(*) AS n FROM task_mentions "
|
||||
"WHERE mentioned_email = %s AND is_read = FALSE",
|
||||
(store.norm_str(mentioned_email, lower=True),),
|
||||
).fetchone()
|
||||
return int(row["n"] or 0)
|
||||
|
||||
def mark_mentions_read(
|
||||
self, *, mentioned_email: str, task_id: int | None = None
|
||||
) -> int:
|
||||
clause = "WHERE mentioned_email = %s AND is_read = FALSE"
|
||||
params: list[Any] = [store.norm_str(mentioned_email, lower=True)]
|
||||
if task_id is not None:
|
||||
clause += " AND task_id = %s"
|
||||
params.append(task_id)
|
||||
with self._pool.connection() as conn:
|
||||
cur = conn.execute(
|
||||
f"UPDATE task_mentions SET is_read = TRUE {clause}", params
|
||||
)
|
||||
return cur.rowcount or 0
|
||||
|
||||
# ════════════════════════════════════════════════════════════
|
||||
# 실시간 새로고침 — 프로젝트/업무/댓글/멤버/단계 중 가장 최근 변경 시각
|
||||
# ════════════════════════════════════════════════════════════
|
||||
@@ -933,7 +1017,8 @@ class ProjectStore:
|
||||
" COALESCE((SELECT MAX(updated_at) FROM tasks), 'epoch'::timestamptz),"
|
||||
" COALESCE((SELECT MAX(created_at) FROM task_comments), 'epoch'::timestamptz),"
|
||||
" COALESCE((SELECT MAX(created_at) FROM project_members), 'epoch'::timestamptz),"
|
||||
" COALESCE((SELECT MAX(created_at) FROM project_stages), 'epoch'::timestamptz)"
|
||||
" COALESCE((SELECT MAX(created_at) FROM project_stages), 'epoch'::timestamptz),"
|
||||
" COALESCE((SELECT MAX(created_at) FROM task_mentions), 'epoch'::timestamptz)"
|
||||
") AS ts"
|
||||
).fetchone()
|
||||
ts = row["ts"] if row else None
|
||||
|
||||
@@ -171,6 +171,37 @@ def _inbox(
|
||||
logger.warning("알림 생성 실패: %s", r)
|
||||
|
||||
|
||||
def _record_mentions(
|
||||
st: Any, *, task: dict[str, Any], emails: list[str], actor: str,
|
||||
comment_id: int | None = None, source: str = "description",
|
||||
project_name: str = "",
|
||||
) -> None:
|
||||
"""@태그를 기록하고 새로 태그된 사람에게만 알림을 만든다.
|
||||
|
||||
태그는 부가 기능이라 여기서 실패해도(예: 006 마이그레이션 미적용) 본
|
||||
저장/등록은 막지 않는다 — 로그만 남긴다.
|
||||
"""
|
||||
if not emails:
|
||||
return
|
||||
try:
|
||||
added = st.add_mentions(
|
||||
task_id=task["id"], emails=emails, actor_email=actor,
|
||||
comment_id=comment_id, source=source,
|
||||
)
|
||||
except Exception: # noqa: BLE001
|
||||
logger.warning("멘션 기록 실패: task=%s", task.get("id"))
|
||||
return
|
||||
if not added:
|
||||
return
|
||||
where = "댓글" if source == "comment" else "설명"
|
||||
_inbox(
|
||||
st, recipients=added, actor=actor,
|
||||
project_id=task["project_id"], task_id=task["id"], ntype="mention",
|
||||
title=f"나를 태그함: {task['title']}",
|
||||
body=f"{project_name or task.get('project_name') or ''} · {where}",
|
||||
)
|
||||
|
||||
|
||||
def _render_config_needed(request: Request, user: dict[str, Any]) -> HTMLResponse:
|
||||
from app.main import build_erp_nav, render_template # noqa: WPS433
|
||||
from app.store import is_admin # noqa: WPS433
|
||||
@@ -454,6 +485,8 @@ async def index(request: Request) -> HTMLResponse:
|
||||
t["due_label"] = _fmt_date_kr(t.get("due_date"))
|
||||
# 내 업무를 프로젝트별로 묶어 트리로 표시(전체/진행/완료 개수 포함)
|
||||
my_projects = _group_my_tasks(my_tasks)
|
||||
my_open_total = sum(g["open"] for g in my_projects)
|
||||
mention_unread = _safe_mention_unread(st, user["email"])
|
||||
|
||||
# 홈 화면 카드/내업무에 노출된 업무 전체(id→업무) — 클릭 시 페이지 이동 없이
|
||||
# 팝업으로 편집하기 위해 필요한 원본 데이터를 그대로 클라이언트에 넘긴다.
|
||||
@@ -610,6 +643,8 @@ async def project_page(request: Request, project_id: int) -> HTMLResponse:
|
||||
"current_project_id": project_id,
|
||||
"my_projects": my_projects,
|
||||
"my_tasks": my_tasks,
|
||||
"my_open_total": my_open_total,
|
||||
"mention_unread": mention_unread,
|
||||
"nav_projects": nav_projects,
|
||||
"stages": stages,
|
||||
"tasks": all_tasks,
|
||||
@@ -985,6 +1020,11 @@ async def api_create_task(
|
||||
title=f"업무 배정: {task['title']}",
|
||||
body=f"{project['name']} · 마감 {task.get('due_date') or '-'}",
|
||||
)
|
||||
_record_mentions(
|
||||
st, task=task,
|
||||
emails=store.extract_mentions_from_html(task.get("description") or ""),
|
||||
actor=user["email"], project_name=project["name"],
|
||||
)
|
||||
return JSONResponse({"task": task}, status_code=201)
|
||||
|
||||
|
||||
@@ -1053,6 +1093,12 @@ async def api_update_task(
|
||||
actor=user["email"], project_id=existing["project_id"], task_id=task_id,
|
||||
ntype="completed", title=f"업무 완료: {task['title']}", body=project_name,
|
||||
)
|
||||
if "description" in payload:
|
||||
_record_mentions(
|
||||
st, task=task,
|
||||
emails=store.extract_mentions_from_html(payload["description"]),
|
||||
actor=user["email"], project_name=project_name,
|
||||
)
|
||||
return JSONResponse({"task": task})
|
||||
|
||||
|
||||
@@ -1185,6 +1231,13 @@ async def api_add_comment(
|
||||
ntype="comment", title=f"새 댓글: {task['title']}",
|
||||
body=comment["body"][:120],
|
||||
)
|
||||
# 댓글은 평문이라 본문에서 이메일을 꺼낼 수 없다 — 화면이 고른 멤버
|
||||
# 목록을 그대로 받아 기록한다(설명란은 본문 HTML 에서 직접 뽑는다).
|
||||
_record_mentions(
|
||||
st, task=task, emails=store.normalize_emails(payload.get("mentions")),
|
||||
actor=user["email"], comment_id=comment["id"], source="comment",
|
||||
project_name=project.get("name", ""),
|
||||
)
|
||||
return JSONResponse({"comment": comment}, status_code=201)
|
||||
|
||||
|
||||
@@ -1433,6 +1486,62 @@ async def api_notif_read_all(request: Request) -> JSONResponse:
|
||||
return JSONResponse({"ok": True, "marked": n})
|
||||
|
||||
|
||||
# ────────────────────────────────────────────────────────────
|
||||
# 수신함 — 나를 @태그한 업무 (아사나 Inbox)
|
||||
# ────────────────────────────────────────────────────────────
|
||||
def _safe_mentions(st: Any, email: str, *, limit: int = 100) -> list[dict[str, Any]]:
|
||||
"""task_mentions 조회. 006 마이그레이션 미적용 환경에서도 화면이 죽지 않게."""
|
||||
try:
|
||||
return st.list_mentioned_tasks(mentioned_email=email, limit=limit)
|
||||
except Exception: # noqa: BLE001
|
||||
logger.warning("멘션 조회 실패 — project_db_006 마이그레이션 확인 필요")
|
||||
return []
|
||||
|
||||
|
||||
def _safe_mention_unread(st: Any, email: str) -> int:
|
||||
try:
|
||||
return st.count_unread_mentions(mentioned_email=email)
|
||||
except Exception: # noqa: BLE001
|
||||
return 0
|
||||
|
||||
|
||||
@router.get("/api/mentions")
|
||||
async def api_mentions(request: Request) -> JSONResponse:
|
||||
"""나를 태그한 업무 목록 + 미확인 개수."""
|
||||
user = _require_user(request)
|
||||
st = _db_or_503(request)
|
||||
tasks = _safe_mentions(st, user["email"])
|
||||
return JSONResponse({
|
||||
"tasks": tasks,
|
||||
"unread": _safe_mention_unread(st, user["email"]),
|
||||
})
|
||||
|
||||
|
||||
@router.get("/api/mentions/unread-count")
|
||||
async def api_mentions_unread(request: Request) -> JSONResponse:
|
||||
user = _require_user(request)
|
||||
st = _db_or_503(request)
|
||||
return JSONResponse({"unread": _safe_mention_unread(st, user["email"])})
|
||||
|
||||
|
||||
@router.post("/api/mentions/read")
|
||||
async def api_mentions_read(
|
||||
request: Request, payload: dict[str, Any] = Body(default={})
|
||||
) -> JSONResponse:
|
||||
"""태그 확인 처리. task_id 를 주면 그 업무만, 없으면 전부."""
|
||||
user = _require_user(request)
|
||||
st = _db_or_503(request)
|
||||
task_id = payload.get("task_id")
|
||||
try:
|
||||
n = st.mark_mentions_read(
|
||||
mentioned_email=user["email"],
|
||||
task_id=int(task_id) if task_id else None,
|
||||
)
|
||||
except Exception: # noqa: BLE001
|
||||
n = 0
|
||||
return JSONResponse({"ok": True, "marked": n})
|
||||
|
||||
|
||||
@router.get("/inbox", response_class=HTMLResponse)
|
||||
async def inbox_page(request: Request) -> HTMLResponse:
|
||||
from app.main import build_erp_nav, render_template # noqa: WPS433
|
||||
@@ -1443,6 +1552,9 @@ async def inbox_page(request: Request) -> HTMLResponse:
|
||||
if st is None:
|
||||
return _render_config_needed(request, user)
|
||||
items = st.list_notifications(recipient_email=user["email"], limit=100)
|
||||
mentioned = _safe_mentions(st, user["email"])
|
||||
for t in mentioned:
|
||||
t["due_label"] = _fmt_date_kr(t.get("due_date"))
|
||||
return render_template(
|
||||
request,
|
||||
"project/inbox.html",
|
||||
@@ -1450,9 +1562,11 @@ async def inbox_page(request: Request) -> HTMLResponse:
|
||||
"user": user,
|
||||
"is_admin": is_admin(user),
|
||||
"nav_items": build_erp_nav(user, active="project"),
|
||||
"page_title": "알림센터",
|
||||
"page_subtitle": "내게 온 프로젝트 알림",
|
||||
"page_title": "수신함",
|
||||
"page_subtitle": "나를 태그한 업무와 프로젝트 알림",
|
||||
"force_sidebar_collapsed": True,
|
||||
"notifications": items,
|
||||
"mentioned_tasks": mentioned,
|
||||
"mention_unread": _safe_mention_unread(st, user["email"]),
|
||||
},
|
||||
)
|
||||
|
||||
@@ -262,11 +262,17 @@ _DESC_ALLOWED_TAGS: frozenset[str] = frozenset({
|
||||
"ul", "ol", "li", "blockquote", "code", "pre", "span", "div",
|
||||
})
|
||||
_DESC_VOID_TAGS: frozenset[str] = frozenset({"br", "img"})
|
||||
# a: target/rel 은 "새 탭에서 열기"용. 화면(설명란)에서 링크를 클릭하면
|
||||
# 새 탭으로 여는데, 저장했다 다시 열었을 때도 같은 동작이어야 해서 허용한다.
|
||||
# span: 멘션 칩(@이름) 전용 — class="pj-mention" + data-email 만 남긴다.
|
||||
_DESC_ALLOWED_ATTRS: dict[str, frozenset[str]] = {
|
||||
"a": frozenset({"href"}),
|
||||
"a": frozenset({"href", "target", "rel"}),
|
||||
"img": frozenset({"src", "alt", "width", "height"}),
|
||||
"span": frozenset({"class", "data-email"}),
|
||||
}
|
||||
_DESC_DANGEROUS_URL_PREFIXES: tuple[str, ...] = ("javascript:", "vbscript:", "data:text/html")
|
||||
# 멘션 칩: <span class="pj-mention" data-email="...">@이름</span>
|
||||
_MENTION_CLASS = "pj-mention"
|
||||
# script/style 은 태그 자체는 물론 그 안의 텍스트(코드)도 통째로 버린다 —
|
||||
# 허용 태그 목록에 없어 태그는 이미 안 남지만, HTMLParser는 이 둘의 내용을
|
||||
# 별도 데이터로 넘기므로 handle_data 에서 따로 걸러야 한다.
|
||||
@@ -302,6 +308,10 @@ class _DescriptionSanitizer(HTMLParser):
|
||||
if tag not in _DESC_ALLOWED_TAGS:
|
||||
return
|
||||
allowed = _DESC_ALLOWED_ATTRS.get(tag, frozenset())
|
||||
# span 은 멘션 칩일 때만 속성을 갖는다 — class 가 pj-mention 이 아니면
|
||||
# data-email 까지 통째로 버린다(평범한 span 으로만 남는다).
|
||||
if tag == "span" and (dict(attrs).get("class") or "").strip() != _MENTION_CLASS:
|
||||
allowed = frozenset()
|
||||
kept: list[str] = []
|
||||
for name, value in attrs:
|
||||
if name not in allowed:
|
||||
@@ -309,6 +319,10 @@ class _DescriptionSanitizer(HTMLParser):
|
||||
value = value or ""
|
||||
if name in ("href", "src") and not _desc_url_is_safe(value):
|
||||
continue
|
||||
# class 는 멘션 칩 하나만 허용한다(임의 클래스로 화면 스타일을
|
||||
# 흔들 여지를 남기지 않는다).
|
||||
if name == "class" and value.strip() != _MENTION_CLASS:
|
||||
continue
|
||||
kept.append(f'{name}="{_desc_escape_attr(value)}"')
|
||||
attr_text = (" " + " ".join(kept)) if kept else ""
|
||||
self.out.append(f"<{tag}{attr_text}>")
|
||||
@@ -358,3 +372,50 @@ def sanitize_description_html(html: str) -> str:
|
||||
parser.feed(html or "")
|
||||
parser.close()
|
||||
return "".join(parser.out).strip()
|
||||
|
||||
|
||||
# ════════════════════════════════════════════════════════════
|
||||
# 멘션(@태그)
|
||||
#
|
||||
# 설명란은 HTML이라 멘션 칩(<span class="pj-mention" data-email="...">)에서
|
||||
# 이메일을 그대로 꺼낼 수 있다 — 클라이언트가 따로 알려주는 목록을 믿지 않고
|
||||
# 저장될 본문에서 직접 읽는다(본문과 알림이 어긋나지 않는다).
|
||||
# 댓글은 평문이라 칩을 넣을 수 없으므로, 그쪽만 클라이언트가 보낸 이메일
|
||||
# 목록을 받아 normalize_emails 로 정리해 쓴다.
|
||||
# ════════════════════════════════════════════════════════════
|
||||
class _MentionCollector(HTMLParser):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(convert_charrefs=True)
|
||||
self.emails: list[str] = []
|
||||
|
||||
def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
|
||||
if tag != "span":
|
||||
return
|
||||
attr = dict(attrs)
|
||||
if (attr.get("class") or "").strip() != _MENTION_CLASS:
|
||||
return
|
||||
email = norm_str(attr.get("data-email") or "", lower=True)
|
||||
if email and email not in self.emails:
|
||||
self.emails.append(email)
|
||||
|
||||
|
||||
def extract_mentions_from_html(html: str) -> list[str]:
|
||||
"""설명 HTML 안의 멘션 칩에서 이메일을 뽑는다(중복 제거, 순서 유지)."""
|
||||
parser = _MentionCollector()
|
||||
parser.feed(html or "")
|
||||
parser.close()
|
||||
return parser.emails
|
||||
|
||||
|
||||
def normalize_emails(values: Any) -> list[str]:
|
||||
"""임의 입력(리스트/문자열)을 소문자 이메일 목록으로 정리한다."""
|
||||
if isinstance(values, str):
|
||||
values = values.split(",")
|
||||
if not isinstance(values, (list, tuple)):
|
||||
return []
|
||||
out: list[str] = []
|
||||
for v in values:
|
||||
e = norm_str(str(v or ""), lower=True)
|
||||
if e and "@" in e and e not in out:
|
||||
out.append(e)
|
||||
return out
|
||||
|
||||
@@ -1,49 +1,88 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260918d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922a" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="pj-wrap">
|
||||
<div class="pj-section-head">
|
||||
<h2>알림센터</h2>
|
||||
<h2>수신함</h2>
|
||||
<div style="display:flex; gap:8px;">
|
||||
<a class="pj-btn" href="/project/">← 프로젝트</a>
|
||||
<button type="button" class="pj-btn pj-btn-primary" id="pj-readall">모두 읽음</button>
|
||||
<button type="button" class="pj-btn" id="pj-mentions-readall">태그 모두 확인</button>
|
||||
<button type="button" class="pj-btn pj-btn-primary" id="pj-readall">알림 모두 읽음</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not notifications %}
|
||||
<div class="pj-empty">알림이 없습니다.</div>
|
||||
{% else %}
|
||||
<ul class="pj-inbox" id="pj-inbox">
|
||||
{% for n in notifications %}
|
||||
<li class="pj-inbox-item {% if not n.is_read %}is-unread{% endif %}"
|
||||
data-id="{{ n.id }}"
|
||||
{% if n.task_id %}data-project="{{ n.project_id }}"{% endif %}>
|
||||
<span class="material-symbols-outlined pj-inbox-icon">
|
||||
{% if n.type == 'assigned' %}assignment_ind
|
||||
{% elif n.type == 'completed' %}task_alt
|
||||
{% elif n.type == 'comment' %}chat_bubble
|
||||
{% else %}notifications{% endif %}
|
||||
</span>
|
||||
<div class="pj-inbox-body">
|
||||
<div class="pj-inbox-title">{{ n.title }}</div>
|
||||
{% if n.body %}<div class="pj-inbox-sub">{{ n.body }}</div>{% endif %}
|
||||
<div class="pj-inbox-meta">
|
||||
{% if n.actor_email %}{{ n.actor_email.split('@')[0] }} · {% endif %}{{ n.created_at[:16].replace('T',' ') }}
|
||||
<!-- 아사나 Inbox 처럼 "나를 태그(@)한 업무"를 맨 위에 리스트로 보여준다.
|
||||
업무를 누르면 그 프로젝트 화면이 열리면서 업무 편집 팝업이 뜬다
|
||||
(?task= 파라미터 — project.js 가 처리). -->
|
||||
<div class="pj-inbox-section">
|
||||
<h3 class="pj-inbox-h3">
|
||||
나를 태그한 업무
|
||||
<span class="pj-inbox-count" id="pj-mention-unread"
|
||||
{% if not mention_unread %}hidden{% endif %}>{{ mention_unread }}</span>
|
||||
</h3>
|
||||
{% if not mentioned_tasks %}
|
||||
<div class="pj-empty">태그된 업무가 없습니다.</div>
|
||||
{% else %}
|
||||
<ul class="pj-inbox pj-mention-list" id="pj-mention-tasks">
|
||||
{% for t in mentioned_tasks %}
|
||||
<li class="pj-inbox-item pj-mention-item {% if t.unread_mentions %}is-unread{% endif %}"
|
||||
data-task-id="{{ t.id }}" data-project="{{ t.project_id }}">
|
||||
<span class="material-symbols-outlined pj-inbox-icon">alternate_email</span>
|
||||
<div class="pj-inbox-body">
|
||||
<div class="pj-inbox-title {% if t.completed_at %}is-done{% endif %}">{{ t.title }}</div>
|
||||
<div class="pj-inbox-meta">
|
||||
<span class="pj-inbox-proj" style="color: {{ t.project_color or '#4573d2' }}">● {{ t.project_name }}</span>
|
||||
{% if t.stage_name %} · {{ t.stage_name }}{% endif %}
|
||||
{% if t.due_label %} · 마감 {{ t.due_label }}{% endif %}
|
||||
{% if t.mention_actor %} · {{ t.mention_actor.split('@')[0] }}님이 태그{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if n.project_id %}
|
||||
<a class="pj-btn pj-inbox-go" href="/project/p/{{ n.project_id }}">이동</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<a class="pj-btn pj-inbox-go" href="/project/p/{{ t.project_id }}?task={{ t.id }}">열기</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="pj-inbox-section">
|
||||
<h3 class="pj-inbox-h3">알림</h3>
|
||||
{% if not notifications %}
|
||||
<div class="pj-empty">알림이 없습니다.</div>
|
||||
{% else %}
|
||||
<ul class="pj-inbox" id="pj-inbox">
|
||||
{% for n in notifications %}
|
||||
<li class="pj-inbox-item {% if not n.is_read %}is-unread{% endif %}"
|
||||
data-id="{{ n.id }}"
|
||||
{% if n.task_id %}data-project="{{ n.project_id }}"{% endif %}>
|
||||
<span class="material-symbols-outlined pj-inbox-icon">
|
||||
{% if n.type == 'assigned' %}assignment_ind
|
||||
{% elif n.type == 'completed' %}task_alt
|
||||
{% elif n.type == 'comment' %}chat_bubble
|
||||
{% elif n.type == 'mention' %}alternate_email
|
||||
{% else %}notifications{% endif %}
|
||||
</span>
|
||||
<div class="pj-inbox-body">
|
||||
<div class="pj-inbox-title">{{ n.title }}</div>
|
||||
{% if n.body %}<div class="pj-inbox-sub">{{ n.body }}</div>{% endif %}
|
||||
<div class="pj-inbox-meta">
|
||||
{% if n.actor_email %}{{ n.actor_email.split('@')[0] }} · {% endif %}{{ n.created_at[:16].replace('T',' ') }}
|
||||
</div>
|
||||
</div>
|
||||
{% if n.project_id %}
|
||||
<a class="pj-btn pj-inbox-go"
|
||||
href="/project/p/{{ n.project_id }}{% if n.task_id %}?task={{ n.task_id }}{% endif %}">이동</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/project.js?v=20260918d" defer></script>
|
||||
<script src="/static/project.js?v=20260922a" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260918d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922a" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -428,5 +428,5 @@
|
||||
window.PJ_COLORS = {{ ["#4573d2","#37a3a3","#62a420","#e8a33d","#e8384f","#aa62e3","#f06a6a","#5a6772"] | tojson }};
|
||||
window.PJ_STAGE_COLORS = {{ ["#4573d2","#37a3a3","#62a420","#e8a33d","#e8384f","#aa62e3","#f06a6a","#5a6772","#e8398a","#a15c43"] | tojson }};
|
||||
</script>
|
||||
<script src="/static/project.js?v=20260918d" defer></script>
|
||||
<script src="/static/project.js?v=20260922a" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260918d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922a" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -29,6 +29,76 @@
|
||||
<div class="pj-layout">
|
||||
<!-- ── 좌측: 프로젝트 트리 + 멤버 ── -->
|
||||
<aside class="pj-side">
|
||||
<!-- 아사나처럼 맨 위에 개인 메뉴(수신함 / 내 업무). 둘 다 기본 접힘이고
|
||||
누르면 펼쳐진다 — 예전 화면 오른쪽에 항상 떠 있던 "내 업무" 패널을
|
||||
이 메뉴가 대신한다. -->
|
||||
<nav class="pj-side-nav">
|
||||
<a class="pj-side-navlink" href="/project/inbox">
|
||||
<span class="material-symbols-outlined pj-side-navic">inbox</span>
|
||||
<span class="pj-side-navtext">수신함</span>
|
||||
<span class="pj-side-navbadge" id="pj-mention-badge"
|
||||
{% if not mention_unread %}hidden{% endif %}>{{ mention_unread }}</span>
|
||||
</a>
|
||||
<button type="button" class="pj-side-navlink pj-mytasks-toggle" id="pj-mytasks-toggle"
|
||||
aria-expanded="false" aria-controls="pj-mytasks-panel">
|
||||
<span class="material-symbols-outlined pj-side-navic">checklist</span>
|
||||
<span class="pj-side-navtext">내 업무</span>
|
||||
<span class="pj-side-navbadge pj-side-navbadge-open"
|
||||
{% if not my_open_total %}hidden{% endif %}>{{ my_open_total }}</span>
|
||||
<span class="material-symbols-outlined pj-side-navcaret">expand_more</span>
|
||||
</button>
|
||||
</nav>
|
||||
<!-- 내 업무 목록 — 접힌 상태가 기본. 업무를 고르면 팝업이 열리면서 다시 접힌다. -->
|
||||
<div class="pj-mytasks-panel" id="pj-mytasks-panel" hidden>
|
||||
{% if not my_projects %}
|
||||
<div class="pj-empty-sm">배정된 업무가 없습니다.</div>
|
||||
{% else %}
|
||||
<div class="pj-mytree">
|
||||
{% for p in my_projects %}
|
||||
<div class="pj-mytree-group" data-group-id="{{ p.id }}">
|
||||
<div class="pj-mytree-head">
|
||||
<button type="button" class="pj-mytree-toggle" title="펼치기/접기">
|
||||
<span class="material-symbols-outlined" style="color: {{ p.color }}; font-size:18px;">folder_open</span>
|
||||
</button>
|
||||
<a class="pj-mytree-proj" href="/project/p/{{ p.id }}">
|
||||
<span class="pj-mytree-proj-name">{{ p.name }}</span>
|
||||
</a>
|
||||
<span class="pj-mytree-counts">
|
||||
<span class="pj-mtc-num pj-mtc-open" data-tip="진행">{{ p.open }}</span>
|
||||
<span class="pj-mtc-num pj-mtc-done" data-tip="완료">{{ p.done }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<ul class="pj-mytree-tasks">
|
||||
{% for t in p.tasks %}
|
||||
<li class="pj-mytree-task {% if t.completed_at %}is-done{% endif %}">
|
||||
<a href="/project/p/{{ t.project_id }}?task={{ t.id }}" data-task-id="{{ t.id }}" class="pj-task-popup-link">
|
||||
<span class="pj-mytree-lead">
|
||||
{% if t.comment_count %}
|
||||
<span class="pj-cmt-badge" data-task-id="{{ t.id }}" data-count="{{ t.comment_count }}" title="댓글 {{ t.comment_count }}개">
|
||||
<span class="pj-cmt-ic">💬</span><span class="pj-cmt-n">{{ t.comment_count }}</span>
|
||||
</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
<span class="pj-mytree-body">
|
||||
<span class="pj-mytree-title">{{ t.title }}</span>
|
||||
{% if t.start_date or t.due_date %}
|
||||
<span class="pj-mytree-dates">
|
||||
{% if t.start_date and t.due_date %}{{ t.start_label }} ~ {{ t.due_label }}
|
||||
{% elif t.due_date %}~ {{ t.due_label }}
|
||||
{% else %}{{ t.start_label }} ~{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="pj-side-block">
|
||||
<div class="pj-side-head">
|
||||
<span>프로젝트</span>
|
||||
@@ -183,6 +253,10 @@
|
||||
<div class="pj-board" id="pj-board">
|
||||
<div class="pj-board-canvas" id="pj-board-canvas"></div>
|
||||
</div>
|
||||
<!-- 가로 스크롤 막대 — 네이티브 막대는 CSS 로 숨겨두므로(자동숨김
|
||||
환경 대응) 보드 바깥에 직접 그린다. JS(attachHScrollIndicator)가
|
||||
pj-board 의 scrollLeft 와 동기화한다. -->
|
||||
<div class="pj-hbar" id="pj-board-hbar" hidden><div class="pj-hbar-thumb"></div></div>
|
||||
</div>
|
||||
<!-- 리스트 -->
|
||||
<div class="pj-view" data-view="list" hidden>
|
||||
@@ -200,59 +274,6 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ── 우측: 내 업무 (홈 화면과 동일) ── -->
|
||||
<aside class="pj-home-side pj-project-mytasks">
|
||||
<div class="pj-section-head"><h2>내 업무</h2></div>
|
||||
{% if not my_projects %}
|
||||
<div class="pj-empty pj-empty-sm">배정된 업무가 없습니다.</div>
|
||||
{% else %}
|
||||
<div class="pj-mytree">
|
||||
{% for p in my_projects %}
|
||||
<div class="pj-mytree-group" data-group-id="{{ p.id }}">
|
||||
<div class="pj-mytree-head">
|
||||
<button type="button" class="pj-mytree-toggle" title="펼치기/접기">
|
||||
<span class="material-symbols-outlined" style="color: {{ p.color }}; font-size:18px;">folder_open</span>
|
||||
</button>
|
||||
<a class="pj-mytree-proj" href="/project/p/{{ p.id }}">
|
||||
<span class="pj-mytree-proj-name">{{ p.name }}</span>
|
||||
</a>
|
||||
<!-- .pj-mytree-head 자체는 접어도(is-collapsed 는 .pj-mytree-tasks 만
|
||||
숨김) 계속 보인다. -->
|
||||
<span class="pj-mytree-counts">
|
||||
<span class="pj-mtc-num pj-mtc-open" data-tip="진행">{{ p.open }}</span>
|
||||
<span class="pj-mtc-num pj-mtc-done" data-tip="완료">{{ p.done }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<ul class="pj-mytree-tasks">
|
||||
{% for t in p.tasks %}
|
||||
<li class="pj-mytree-task {% if t.completed_at %}is-done{% endif %}">
|
||||
<a href="/project/p/{{ t.project_id }}?task={{ t.id }}" data-task-id="{{ t.id }}" class="pj-task-popup-link">
|
||||
<span class="pj-mytree-lead">
|
||||
{% if t.comment_count %}
|
||||
<span class="pj-cmt-badge" data-task-id="{{ t.id }}" data-count="{{ t.comment_count }}" title="댓글 {{ t.comment_count }}개">
|
||||
<span class="pj-cmt-ic">💬</span><span class="pj-cmt-n">{{ t.comment_count }}</span>
|
||||
</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
<span class="pj-mytree-body">
|
||||
<span class="pj-mytree-title">{{ t.title }}</span>
|
||||
{% if t.start_date or t.due_date %}
|
||||
<span class="pj-mytree-dates">
|
||||
{% if t.start_date and t.due_date %}{{ t.start_label }} ~ {{ t.due_label }}
|
||||
{% elif t.due_date %}~ {{ t.due_label }}
|
||||
{% else %}{{ t.start_label }} ~{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -553,5 +574,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260918d" defer></script>
|
||||
<script src="/static/project.js?v=20260922a" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user