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:
2026-09-22 11:04:21 +09:00
parent 79aa16bf49
commit fac8d5a0b1
11 changed files with 1152 additions and 166 deletions
@@ -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 %}