diff --git a/app/modules/project/db.py b/app/modules/project/db.py
index 46ba23a..3231fd9 100644
--- a/app/modules/project/db.py
+++ b/app/modules/project/db.py
@@ -1277,6 +1277,17 @@ class ProjectStore:
([int(i) for i in ordered_ids], stage_id),
)
+ def reorder_subtasks(self, *, parent_task_id: int, ordered_ids: list[int]) -> None:
+ """작업 팝업의 하위 작업 목록 드래그 재정렬 — 이 상위 작업의 하위 작업만
+ 0부터 다시 매긴다(목록은 parent_task_id 로 먼저 거른 뒤 sort_order 순)."""
+ with self._pool.connection() as conn:
+ conn.execute(
+ "UPDATE tasks t SET sort_order = v.ord - 1 "
+ "FROM unnest(%s::bigint[]) WITH ORDINALITY AS v(id, ord) "
+ "WHERE t.id = v.id AND t.parent_task_id = %s",
+ ([int(i) for i in ordered_ids], parent_task_id),
+ )
+
# ════════════════════════════════════════════════════════════
# 알림센터 (project_notifications)
# ════════════════════════════════════════════════════════════
diff --git a/app/modules/project/router.py b/app/modules/project/router.py
index 9022580..ce73ac7 100644
--- a/app/modules/project/router.py
+++ b/app/modules/project/router.py
@@ -1359,6 +1359,28 @@ def api_get_task(request: Request, task_id: int) -> JSONResponse:
return JSONResponse({"task": task})
+@router.put("/api/tasks/{task_id}/subtasks/order")
+def api_reorder_subtasks(
+ request: Request, task_id: int, payload: dict[str, Any] = Body(...)
+) -> JSONResponse:
+ """작업 팝업의 하위 작업 목록을 드래그로 재정렬. body: {"ordered_ids": [...]}"""
+ user = _require_user(request)
+ st = _db_or_503(request)
+ parent = st.get_task(task_id=task_id)
+ if parent is None:
+ raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
+ _require_manage(request, st, user, parent["project_id"])
+ ids = payload.get("ordered_ids") or []
+ if not isinstance(ids, list) or not ids:
+ raise HTTPException(status_code=400, detail="ordered_ids 가 필요합니다.")
+ try:
+ ordered = [int(i) for i in ids]
+ except (TypeError, ValueError):
+ raise HTTPException(status_code=400, detail="ordered_ids 가 올바르지 않습니다.")
+ st.reorder_subtasks(parent_task_id=task_id, ordered_ids=ordered)
+ return JSONResponse({"ok": True})
+
+
@router.post("/api/tasks/{task_id}/move-parent")
def api_move_subtask(
request: Request,
diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html
index dec6831..e34baa5 100644
--- a/app/modules/project/templates/project/inbox.html
+++ b/app/modules/project/templates/project/inbox.html
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
-
+
{% endblock %}
@@ -99,5 +99,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
-
+
{% endblock %}
diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html
index fcbae9b..a9f10c0 100644
--- a/app/modules/project/templates/project/mytasks.html
+++ b/app/modules/project/templates/project/mytasks.html
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
-
+
{% endblock %}
@@ -98,5 +98,5 @@
"today": {{ today | tojson }}
}
-
+
{% endblock %}
diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html
index 3a76ca0..4c7374b 100644
--- a/app/modules/project/templates/project/project.html
+++ b/app/modules/project/templates/project/project.html
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
-
+
@@ -465,5 +465,5 @@
-
+
{% endblock %}
diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html
index a8133e8..d6345f1 100644
--- a/app/modules/project/templates/project/trash.html
+++ b/app/modules/project/templates/project/trash.html
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
-
+
{% endblock %}
@@ -68,5 +68,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
-
+
{% endblock %}
diff --git a/app/static/project.css b/app/static/project.css
index 3ff282d..52b1518 100644
--- a/app/static/project.css
+++ b/app/static/project.css
@@ -922,27 +922,67 @@ label.pj-desc-fmtbtn { line-height: 26px; }
/* ── 하위 업무(인라인) ── */
.pj-subtask-list { list-style: none; margin: 0 0 8px; padding: 0; }
-.pj-subtask-row { display: flex; align-items: center; gap: 6px; padding: 4px 2px; }
-/* 완료된 하위 업무는 행 전체를 반투명하게(체크박스 포함) + 제목 취소선. */
-.pj-subtask-row.is-done { opacity: .5; }
+/* 하위 작업 한 줄(아사나식): ⠿ · ✓ · 제목(글자 폭만큼) · 빈 곳(누르면 열기) · 마감일 · 담당자 · › */
+.pj-subtask-row {
+ display: flex; align-items: center; gap: 4px; padding: 3px 2px; min-height: 36px;
+ border-bottom: 1px solid #eef0f2; cursor: pointer; border-radius: 4px;
+}
+.pj-subtask-row:hover { background: #f6f7f8; }
+.pj-subtask-row.is-dragging { opacity: .4; }
+/* 완료된 하위 작업은 제목을 흐리게 + 취소선(아사나) */
.pj-subtask-row.is-done .pj-subtask-title { text-decoration: line-through; color: #9aa1a9; }
-.pj-subtask-row input[type="checkbox"] { width: auto; margin: 0; flex: 0 0 auto; }
-/* 하위 업무 열기(›) — 줄에 마우스를 올리면 진해진다 */
+.pj-subtask-handle {
+ flex: 0 0 auto; display: inline-flex; width: 16px; justify-content: center;
+ color: #9aa1a9; cursor: grab; opacity: 0; transition: opacity .12s;
+}
+.pj-subtask-handle .material-symbols-outlined { font-size: 18px; }
+.pj-subtask-row:hover .pj-subtask-handle { opacity: 1; }
+.pj-subtask-check {
+ flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
+ width: 26px; height: 26px; padding: 0; border: none; background: transparent; border-radius: 50%;
+ color: #6d6e6f; cursor: pointer;
+}
+.pj-subtask-check .material-symbols-outlined { font-size: 21px; }
+.pj-subtask-check:hover { color: #3f8f6b; }
+.pj-subtask-row.is-done .pj-subtask-check { color: #3f8f6b; }
+.pj-subtask-row.is-done .pj-subtask-check .material-symbols-outlined { font-variation-settings: "FILL" 1; }
+.pj-subtask-title {
+ /* 폭은 JS(fitTitle)가 글자 길이만큼 인라인으로 준다. 공용 input[type=text]
+ 규칙의 width:100% 는 인라인 폭이 이긴다. */
+ flex: 0 1 auto; min-width: 40px; max-width: 100%; cursor: text;
+ border: 1px solid transparent !important; background: transparent;
+ padding: 3px 6px !important; font-size: 14px !important; margin: 0 !important;
+}
+.pj-subtask-title:hover, .pj-subtask-title:focus { border-color: #d8dce2 !important; background: #fff; }
+.pj-subtask-fill { flex: 1 1 0; align-self: stretch; min-width: 8px; }
+/* 마감일 — 날짜 글자만(아사나). 없으면 줄에 마우스를 올릴 때만 점선 원 달력 아이콘 */
+.pj-subtask-due {
+ flex: 0 0 auto; white-space: nowrap; font-size: 12px; color: var(--pj-ink-soft);
+ padding: 2px 4px; border-radius: 4px; cursor: pointer;
+}
+.pj-subtask-due:not(.is-empty):hover { background: #eceef0; }
+.pj-subtask-due.is-overdue { color: #c22b10; }
+.pj-subtask-due.is-soon { color: #3f8f6b; }
+.pj-subtask-due.is-empty {
+ display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
+ border-radius: 50%; color: #6d6e6f; opacity: 0; transition: opacity .12s;
+}
+.pj-subtask-row:hover .pj-subtask-due.is-empty { opacity: 1; }
+.pj-subtask-due.is-empty:hover { color: #1e1f21; background: #eceef0; }
+/* 담당자 — 아이콘만(아바타 / 없으면 점선 원 사람 아이콘, 줄 hover 때만) */
+.pj-subtask-av {
+ flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
+ width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: #6d6e6f;
+}
+.pj-subtask-av img.pj-person-ic { width: 22px; height: 22px; border-radius: 50%; }
+.pj-subtask-av .pj-gicon { font-size: 22px; }
+.pj-subtask-av.is-empty { opacity: 0; transition: opacity .12s; }
+.pj-subtask-row:hover .pj-subtask-av.is-empty { opacity: 1; }
+.pj-subtask-av.is-empty:hover { color: #1e1f21; background: #eceef0; }
+/* 하위 작업 열기(›) — 줄에 마우스를 올리면 진해진다 */
.pj-subtask-open { flex: 0 0 auto; width: 26px; height: 26px; color: #9aa1a9; }
.pj-subtask-row:hover .pj-subtask-open { color: var(--pj-ink); }
.pj-subtask-open .material-symbols-outlined { font-size: 20px; }
-.pj-subtask-title {
- /* flex-basis 는 반드시 0(퍼센트 아님) — auto 로 두면 .pj-modal-card 의 공용
- input[type=text] 규칙이 준 width:100% 로 넘어가 버려 한 줄 배치가 깨진다. */
- flex: 1 1 0; width: auto !important; min-width: 0;
- border: 1px solid transparent !important; background: transparent;
- padding: 4px 6px !important; font-size: 13px !important; margin: 0 !important;
-}
-.pj-subtask-title:hover, .pj-subtask-title:focus { border-color: #d8dce2 !important; background: #fff; }
-.pj-subtask-assignee {
- flex: 0 0 auto; width: 110px !important; font-size: 12px !important; padding: 4px 6px !important; margin: 0 !important;
-}
-.pj-subtask-due { flex: 0 0 auto; width: 128px !important; font-size: 12px !important; padding: 4px 6px !important; margin: 0 !important; }
.pj-subtask-form { display: flex; gap: 6px; flex-wrap: wrap; }
.pj-subtask-form input[type="text"] {
flex: 1 1 120px; width: auto !important; min-width: 90px; margin: 0 !important;
diff --git a/app/static/project.js b/app/static/project.js
index 3777a77..2bce969 100644
--- a/app/static/project.js
+++ b/app/static/project.js
@@ -510,6 +510,13 @@
'' +
'' +
"";
+ // 마감일 미지정 아이콘(아사나 모양: 점선 원 안의 달력) — 보드 카드·하위 작업 줄 공용.
+ const DUE_EMPTY_ICON_SVG =
+ '";
function personIconHtml(email) {
if (!email) return '' + EMPTY_PERSON_SVG + "";
const url = pageAvatarUrl(email);
@@ -3204,13 +3211,6 @@
: '' + ASSIGN_EMPTY_ICON_SVG + "") +
"";
}
- // 마감일 미지정 아이콘(아사나 모양: 점선 원 안의 달력).
- const DUE_EMPTY_ICON_SVG =
- '";
// 담당자 미지정 아이콘(아사나 모양: 점선 원 안의 사람).
const ASSIGN_EMPTY_ICON_SVG =
'