feat(project): 수신함도 좌측 사이드바 + 우측 프레임 2단 레이아웃으로
수신함이 사이드바 없이 화면 전체를 쓰고 있어, 내 업무·프로젝트 화면과
같은 2단 구조로 맞췄다. 내용은 오른쪽 프레임 안에서만 스크롤한다.
- inbox.html 을 .pj-layout + 공용 _side.html + <section class="pj-main">
으로 감쌌다. 사이드바로 이동할 수 있으니 "← 프로젝트" 버튼은 뺐다.
- _side.html 에 side_active('inbox' | 'mytasks' | '')를 받아 지금 보고 있는
개인 메뉴를 강조한다. 새 프로젝트 "+" 는 그 모달을 갖고 배선하는 화면
(내 업무·프로젝트)에서만 보인다.
- 라우터: 사이드바 데이터를 세 화면이 같이 쓰므로 _nav_projects 헬퍼로
묶고, 수신함에도 nav_projects/my_open_total 을 넘긴다.
- 내 업무·수신함 본문은 폭 1180px 로 제한 — 표/목록이 화면 끝까지 늘어나
눈이 따라가기 힘들던 문제(보드·달력 등은 종전대로 전체 폭).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -236,6 +236,31 @@ def _fmt_date_kr(d: str | None) -> str:
|
||||
return dd.strftime("%m/%d") + f"({_WEEKDAYS_KR[dd.weekday()]})"
|
||||
|
||||
|
||||
def _nav_projects(st: Any, user: dict[str, Any], admin: bool) -> list[dict[str, Any]]:
|
||||
"""좌측 사이드바(project/_side.html)의 프로젝트 트리 데이터.
|
||||
|
||||
내 업무 · 수신함 · 프로젝트 화면이 같은 사이드바를 쓰므로 한 곳에서 만든다.
|
||||
"""
|
||||
projects = st.list_projects(
|
||||
include_archived=False,
|
||||
member_email=None if admin else user["email"],
|
||||
)
|
||||
return [
|
||||
{
|
||||
"id": p["id"],
|
||||
"name": p["name"],
|
||||
"color": p.get("color") or "#4573d2",
|
||||
"created_by": p.get("created_by") or "",
|
||||
"description": p.get("description") or "",
|
||||
"start_date": p.get("start_date"),
|
||||
"due_date": p.get("due_date"),
|
||||
"status": p.get("status") or "active",
|
||||
}
|
||||
for p in projects
|
||||
if not p.get("parent_id")
|
||||
]
|
||||
|
||||
|
||||
def _build_tree(projects: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||
"""평면 프로젝트 목록 → parent_id 기준 트리(children 키)."""
|
||||
by_id: dict[int, dict[str, Any]] = {}
|
||||
@@ -395,24 +420,7 @@ async def my_tasks_page(request: Request) -> HTMLResponse:
|
||||
return _render_config_needed(request, user)
|
||||
|
||||
admin = is_admin(user)
|
||||
projects = st.list_projects(
|
||||
include_archived=False,
|
||||
member_email=None if admin else user["email"],
|
||||
)
|
||||
nav_projects = [
|
||||
{
|
||||
"id": p["id"],
|
||||
"name": p["name"],
|
||||
"color": p.get("color") or "#4573d2",
|
||||
"created_by": p.get("created_by") or "",
|
||||
"description": p.get("description") or "",
|
||||
"start_date": p.get("start_date"),
|
||||
"due_date": p.get("due_date"),
|
||||
"status": p.get("status") or "active",
|
||||
}
|
||||
for p in projects
|
||||
if not p.get("parent_id")
|
||||
]
|
||||
nav_projects = _nav_projects(st, user, admin)
|
||||
|
||||
today_iso = today_kst().isoformat()
|
||||
my_tasks = st.list_tasks(assignee_email=user["email"], limit=1000)
|
||||
@@ -1485,17 +1493,26 @@ async def inbox_page(request: Request) -> HTMLResponse:
|
||||
st = _store(request)
|
||||
if st is None:
|
||||
return _render_config_needed(request, user)
|
||||
admin = is_admin(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"))
|
||||
# 좌측 사이드바(project/_side.html)는 세 화면 공용 — 같은 데이터가 필요하다.
|
||||
nav_projects = _nav_projects(st, user, admin)
|
||||
my_open_total = sum(
|
||||
1 for t in st.list_tasks(assignee_email=user["email"], limit=1000)
|
||||
if not t.get("completed_at")
|
||||
)
|
||||
return render_template(
|
||||
request,
|
||||
"project/inbox.html",
|
||||
{
|
||||
"user": user,
|
||||
"is_admin": is_admin(user),
|
||||
"is_admin": admin,
|
||||
"nav_items": build_erp_nav(user, active="project"),
|
||||
"nav_projects": nav_projects,
|
||||
"my_open_total": my_open_total,
|
||||
"page_title": "수신함",
|
||||
"page_subtitle": "나를 태그한 업무와 프로젝트 알림",
|
||||
"force_sidebar_collapsed": True,
|
||||
|
||||
Reference in New Issue
Block a user