feat(project): compact links and add file icons
This commit is contained in:
@@ -315,9 +315,9 @@
|
||||
<li><b>@태그</b> — <kbd>@</kbd>를 누르면 사람 목록이 뜹니다. 고른 사람의 수신함에 이 작업이 쌓입니다.</li>
|
||||
</ul>
|
||||
<h3>첨부 파일</h3>
|
||||
<p><span class="pjh-ui">파일 추가</span>로 파일을 올립니다(한 파일 최대 20MB). 파일 이름을 누르면 내려받고, <span class="pjh-ui">×</span>로 지웁니다.</p>
|
||||
<p><span class="pjh-ui">파일 추가</span>로 파일을 올립니다(한 파일 최대 20MB). 파일 이름 옆에 이미지·엑셀·텍스트·PPT·문서·PDF 형식별 아이콘이 표시됩니다. 파일 이름을 누르면 내려받고, <span class="pjh-ui">×</span>로 지웁니다.</p>
|
||||
<h3>프로젝트 (다른 프로젝트에 추가)</h3>
|
||||
<p>작업 하나를 <b>여러 프로젝트의 보드에 동시에</b> 보이게 합니다. 예) 신상품 프로젝트의 작업을 디자인 프로젝트 보드에도 올리기.</p>
|
||||
<p>작업 하나를 <b>여러 프로젝트의 보드에 동시에</b> 보이게 합니다. 예) 신상품 프로젝트의 작업을 디자인 프로젝트 보드에도 올리기. 협업자 아래의 프로젝트 줄에 연결 목록·프로젝트 선택·섹션 선택·추가 버튼이 한 줄로 표시됩니다. 창이 좁으면 이 줄을 좌우로 스크롤할 수 있습니다.</p>
|
||||
<ol class="pjh-steps">
|
||||
<li>“프로젝트” 칸에서 프로젝트를 고릅니다.</li>
|
||||
<li>그 프로젝트에서 들어갈 섹션을 고릅니다.</li>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261004a" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -330,6 +330,18 @@
|
||||
</div>
|
||||
<button type="button" class="pj-follow-toggle" id="pj-follow-toggle">협업자로 참여</button>
|
||||
</div>
|
||||
<!-- 프로젝트 연결 — 협업자 아래에서 목록·선택·추가를 한 줄로 표시. -->
|
||||
<div class="pj-meta-row2 pj-projects-row" id="pj-links-block" hidden>
|
||||
<span class="pj-meta-cell-label pj-projects-label">
|
||||
<span class="material-symbols-outlined pj-gicon pj-gicon-sm" aria-hidden="true">link</span> 프로젝트
|
||||
</span>
|
||||
<div class="pj-link-chips" id="pj-link-chips"></div>
|
||||
<div class="pj-link-form" id="pj-link-form">
|
||||
<select id="pj-link-project" aria-label="연결할 프로젝트"><option value="">프로젝트 선택…</option></select>
|
||||
<select id="pj-link-stage" aria-label="연결할 섹션"><option value="">섹션 선택…</option></select>
|
||||
<button type="button" class="pj-btn pj-btn-primary" id="pj-link-save">다른 프로젝트에 추가</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -377,31 +389,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 첨부파일 | 연결된 프로젝트 — 나란히 2열(팝업 너비 전체를 나눠 쓴다).
|
||||
기존 업무 편집 시에만. -->
|
||||
<div class="pj-side-2col">
|
||||
<div class="pj-task-extra" id="pj-attach-block" hidden>
|
||||
<div class="pj-extra-head">
|
||||
<span class="material-symbols-outlined pj-gicon pj-gicon-sm">attach_file</span> 첨부 파일
|
||||
<label class="pj-upload-btn">
|
||||
파일 추가<input type="file" id="pj-attach-input" hidden />
|
||||
</label>
|
||||
</div>
|
||||
<ul class="pj-attach-list" id="pj-attach-list"></ul>
|
||||
</div>
|
||||
|
||||
<!-- 연결된 프로젝트 — 멀티호밍(아사나식). -->
|
||||
<div class="pj-task-extra" id="pj-links-block" hidden>
|
||||
<div class="pj-extra-head">
|
||||
<span class="material-symbols-outlined pj-gicon pj-gicon-sm">link</span> 프로젝트
|
||||
</div>
|
||||
<div class="pj-link-chips" id="pj-link-chips"></div>
|
||||
<div class="pj-link-form" id="pj-link-form">
|
||||
<select id="pj-link-project"><option value="">프로젝트 선택…</option></select>
|
||||
<select id="pj-link-stage"><option value="">섹션 선택…</option></select>
|
||||
<button type="button" class="pj-btn pj-btn-primary" id="pj-link-save">다른 프로젝트에 추가</button>
|
||||
</div>
|
||||
<!-- 첨부파일 — 팝업 너비 전체, 기존 업무 편집 시에만. -->
|
||||
<div class="pj-task-extra" id="pj-attach-block" hidden>
|
||||
<div class="pj-extra-head">
|
||||
<span class="material-symbols-outlined pj-gicon pj-gicon-sm">attach_file</span> 첨부 파일
|
||||
<label class="pj-upload-btn">
|
||||
파일 추가<input type="file" id="pj-attach-input" hidden />
|
||||
</label>
|
||||
</div>
|
||||
<ul class="pj-attach-list" id="pj-attach-list"></ul>
|
||||
</div>
|
||||
|
||||
<!-- 댓글(활동) — 팝업 너비 전체를 쓰는 맨 아래 줄. 길어지면 자체
|
||||
@@ -496,5 +492,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20261003h" defer></script>
|
||||
<script src="/static/project.js?v=20261004a" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
+25
-14
@@ -731,16 +731,14 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
|
||||
margin: 0 -22px 0 -8px; padding: 0 22px 0 8px;
|
||||
}
|
||||
.pj-task-modal-card .pj-modal-actions { flex: none; }
|
||||
/* 위에서 아래로 쭉 쌓는 단일 칼럼 — 메타 → 설명 → 하위업무 →
|
||||
(첨부파일|연결된 프로젝트 2열) → 댓글(팝업 너비 전체) 순서. 각 구간은
|
||||
/* 위에서 아래로 쭉 쌓는 단일 칼럼 — 메타(프로젝트 연결 포함) → 설명 → 하위업무 →
|
||||
첨부파일 → 댓글(팝업 너비 전체) 순서. 각 구간은
|
||||
.pj-task-extra 의 위쪽 구분선으로 나뉘고, 넘치는 부분은 이 전체가 세로로
|
||||
스크롤한다. */
|
||||
.pj-modal-body { display: flex; flex-direction: column; overflow-y: auto; }
|
||||
.pj-desc-block { min-width: 0; padding-top: 10px; margin-top: 14px; border-top: 1px solid #eef0f2; }
|
||||
.pj-subtask-full { min-width: 0; }
|
||||
/* 첨부파일 | 연결된 프로젝트 — 나란히 2열. */
|
||||
.pj-side-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
|
||||
.pj-side-2col .pj-task-extra { min-width: 0; }
|
||||
#pj-attach-block { min-width: 0; }
|
||||
/* 댓글 — 팝업 너비 전체, 목록 자체는 더 이상 안에서 스크롤하지 않고
|
||||
팝업 전체(.pj-modal-body)와 같이 늘어난다. */
|
||||
.pj-comment-full .pj-comment-list { max-height: none; overflow-y: visible; }
|
||||
@@ -763,7 +761,6 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
|
||||
.pj-comment-dock .pj-comment-form textarea { border: none !important; box-shadow: none !important; padding: 8px 8px; font-size: 14px; outline: none; background: transparent; }
|
||||
@media (max-width: 720px) {
|
||||
.pj-task-modal-card { width: 100vw; max-width: 100vw; min-width: 0; }
|
||||
.pj-side-2col { display: block; }
|
||||
}
|
||||
.pj-modal-card h3 { margin: 0 0 16px; font-size: var(--pj-heading-size); line-height: var(--pj-heading-leading); font-weight: 500; letter-spacing: normal; }
|
||||
.pj-modal-hint { margin: -6px 0 14px; font-size: 12px; color: #6b7280; }
|
||||
@@ -942,9 +939,17 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
|
||||
|
||||
.pj-attach-list, .pj-comment-list { list-style: none; margin: 0 0 6px; padding: 0; max-height: 160px; overflow-y: auto; }
|
||||
.pj-attach-item { display: flex; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; }
|
||||
.pj-attach-item a { color: #2b4a85; text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pj-attach-item a { display: flex; align-items: center; gap: 8px; min-width: 0; color: #2b4a85; text-decoration: none; flex: 1; }
|
||||
.pj-attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pj-attach-icon { flex: none; font-size: 22px; color: #6b7280; }
|
||||
.pj-attach-icon.is-image { color: #7c5ce0; }
|
||||
.pj-attach-icon.is-excel { color: #21834d; }
|
||||
.pj-attach-icon.is-text { color: #64748b; }
|
||||
.pj-attach-icon.is-ppt { color: #c85a29; }
|
||||
.pj-attach-icon.is-document { color: #356ac3; }
|
||||
.pj-attach-icon.is-pdf { color: #c43c3c; }
|
||||
.pj-attach-item a:hover { text-decoration: underline; }
|
||||
.pj-attach-size { font-size: 11px; color: #9aa1a9; }
|
||||
.pj-attach-size { flex: none; font-size: 11px; color: #9aa1a9; }
|
||||
|
||||
.pj-comment-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 2px; }
|
||||
.pj-comment-main { flex: 1; }
|
||||
@@ -1428,21 +1433,27 @@ label.pj-desc-fmtbtn {
|
||||
}
|
||||
|
||||
/* ── 연결된 프로젝트(멀티호밍) 칩 ── */
|
||||
.pj-link-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
|
||||
.pj-projects-row { gap: 8px; padding: 4px 0; flex-wrap: nowrap; overflow-x: auto; }
|
||||
.pj-projects-row[hidden] { display: none; }
|
||||
.pj-projects-label { display: inline-flex; align-items: center; gap: 4px; }
|
||||
.pj-link-chips { display: flex; flex: 0 1 auto; min-width: 32px; max-width: 25%; gap: 6px; overflow-x: auto; }
|
||||
.pj-link-chips .pj-empty-sm { padding: 0 2px; white-space: nowrap; }
|
||||
.pj-projects-row.is-readonly .pj-link-chips { max-width: none; flex: 1; }
|
||||
.pj-link-chip {
|
||||
display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
|
||||
display: inline-flex; flex: none; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap;
|
||||
padding: 3px 6px 3px 10px; border-radius: 999px; background: #eef0f2; color: #333;
|
||||
}
|
||||
.pj-link-chip .pj-link-del { border: none; background: transparent; cursor: pointer; color: #9aa1a9; font-size: 13px; line-height: 1; padding: 2px; }
|
||||
.pj-link-chip .pj-link-del:hover { color: #c22b10; }
|
||||
/* 세로로 쌓기 — 옆 칼럼이 좁아 가로 배치면 select 글자가 잘린다. */
|
||||
.pj-link-form { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
|
||||
/* 좁은 패널에서도 한 줄을 유지하며 프로젝트 줄 안에서만 가로 스크롤. */
|
||||
.pj-link-form { display: flex; flex: 1; min-width: 360px; gap: 6px; align-items: center; }
|
||||
.pj-link-form[hidden] { display: none; }
|
||||
.pj-link-form select {
|
||||
width: 100% !important; flex: none; margin: 0 !important;
|
||||
width: 0 !important; min-width: 90px; flex: 1; margin: 0 !important;
|
||||
padding: 6px 8px !important; border: 1px solid #d8dce2 !important; border-radius: 8px;
|
||||
font-size: 11.5px !important; font-family: inherit; box-sizing: border-box;
|
||||
}
|
||||
.pj-link-form .pj-btn { align-self: flex-end; }
|
||||
.pj-link-form .pj-btn { flex: none; padding: 6px 8px; font-size: 11.5px; white-space: nowrap; }
|
||||
|
||||
/* ── 알림센터 ── */
|
||||
.pj-inbox { list-style: none; margin: 0; padding: 0; }
|
||||
|
||||
+31
-1
@@ -6567,6 +6567,34 @@
|
||||
});
|
||||
|
||||
// ── 첨부파일 ──
|
||||
function attachmentIconHtml(a) {
|
||||
const suffix = String(a.filename || "").trim().toLowerCase().match(/\.([^.]+)$/);
|
||||
const ext = suffix ? suffix[1] : "";
|
||||
const mime = String(a.content_type || "").split(";")[0].trim().toLowerCase();
|
||||
// 확장자를 먼저 확인 — CSV/마크다운처럼 MIME 이 일반 text 인 파일도 구분한다.
|
||||
let kind;
|
||||
if (/^(png|jpe?g|gif|webp|bmp|svg|tiff?|ico|heic|heif|avif)$/.test(ext)) kind = "image";
|
||||
else if (/^(xlsx?|xlsm|xlsb|xltx?|xltm|csv|ods)$/.test(ext)) kind = "excel";
|
||||
else if (/^(pptx?|pptm|ppsx?|ppsm|potx?|potm|odp)$/.test(ext)) kind = "ppt";
|
||||
else if (/^(docx?|docm|dotx?|dotm|hwp|hwpx|odt|rtf)$/.test(ext)) kind = "document";
|
||||
else if (ext === "pdf") kind = "pdf";
|
||||
else if (/^(txt|text|md|markdown|log|json|xml|ya?ml|ini|conf)$/.test(ext)) kind = "text";
|
||||
else if (mime.startsWith("image/")) kind = "image";
|
||||
else if (/excel|spreadsheet|opendocument.spreadsheet|csv/.test(mime)) kind = "excel";
|
||||
else if (/powerpoint|presentation/.test(mime)) kind = "ppt";
|
||||
else if (/msword|wordprocessing|opendocument.text|hwp|rtf/.test(mime)) kind = "document";
|
||||
else if (mime === "application/pdf") kind = "pdf";
|
||||
else if (mime.startsWith("text/") || /json|xml/.test(mime)) kind = "text";
|
||||
else kind = "file";
|
||||
const types = {
|
||||
image: ["image", "이미지 파일"], excel: ["table_chart", "엑셀 파일"],
|
||||
text: ["article", "텍스트 파일"], ppt: ["slideshow", "PPT 파일"],
|
||||
document: ["description", "문서 파일"], pdf: ["picture_as_pdf", "PDF 파일"],
|
||||
file: ["draft", "파일"],
|
||||
};
|
||||
return '<span class="material-symbols-outlined pj-attach-icon is-' + kind +
|
||||
'" role="img" aria-label="' + types[kind][1] + '" title="' + types[kind][1] + '">' + types[kind][0] + '</span>';
|
||||
}
|
||||
function fmtSize(n) {
|
||||
if (n < 1024) return n + " B";
|
||||
if (n < 1048576) return (n / 1024).toFixed(1) + " KB";
|
||||
@@ -6586,7 +6614,8 @@
|
||||
li.className = "pj-attach-item";
|
||||
// 댓글에 붙은 파일은 "댓글" 표시 — 아래 댓글 목록에도 같은 파일이 보인다(같은 파일임을 알 수 있게).
|
||||
li.innerHTML =
|
||||
'<a href="/project/api/attachments/' + a.id + '/download">' + escapeHtml(a.filename) + "</a>" +
|
||||
'<a href="/project/api/attachments/' + a.id + '/download">' + attachmentIconHtml(a) +
|
||||
'<span class="pj-attach-name">' + escapeHtml(a.filename) + "</span></a>" +
|
||||
(a.comment_id != null ? '<span class="pj-attach-from-comment" title="댓글에 첨부한 파일">댓글</span>' : "") +
|
||||
'<span class="pj-attach-size">' + fmtSize(a.size_bytes) + "</span>" +
|
||||
(canManage && !taskReadOnly ? '<button type="button" class="pj-icon-btn pj-attach-del" data-id="' + a.id + '">×</button>' : "");
|
||||
@@ -7937,6 +7966,7 @@
|
||||
ctxSeq++;
|
||||
taskId = opts.taskId; homeProjectId = opts.projectId; onChange = opts.onChange || null;
|
||||
readOnly = !!opts.readOnly;
|
||||
el("pj-links-block").classList.toggle("is-readonly", readOnly);
|
||||
if (linkForm) linkForm.hidden = readOnly;
|
||||
if (!readOnly) loadProjects();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user