ec78dd328d
- 사이드바 휴지통 아래 "목표": 누르면 연도 목록이 펼쳐지고(올해는 항상), 관리자는 + 연도 추가
- /project/goals/{연도}: 매출(목표·실적·달성)·로아스(목표·실적) 월별 숫자 + 업무 영역
(상품·마케팅·컨텐츠·유통[콜라보·인플·쿠팡·기타])별 연간·월별 글을 스프레드시트처럼 한 표에
- 매출 연간 합계·달성률은 화면에서 계산, 칸별 즉시 저장, 영역 이름·색·순서·줄 추가/삭제
- 입력·구조 변경은 관리자만, 조회는 project 권한자 전원
- 새 연도는 가장 가까운 이전 연도의 영역 구성을 복사(처음이면 기본 4개 영역)
- DB 마이그레이션 013(goal_years·goal_metrics·goal_areas·goal_rows·goal_cells), 문서·도움말 갱신
- project.js/css 캐시 버전 20260930a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
135 lines
8.3 KiB
HTML
135 lines
8.3 KiB
HTML
{# ── 프로젝트 모듈 좌측 사이드바 (공용) ──────────────────────────────
|
||
수신함·내 업무·휴지통·프로젝트 화면이 함께 쓴다 — 어느 화면이든 프로젝트
|
||
목록은 똑같다(관리자: 드래그 순서 변경·✎ 수정·× 삭제·우클릭 메뉴).
|
||
|
||
변수:
|
||
mention_unread 미확인 @태그 개수 (수신함 배지)
|
||
my_open_total 진행 중인 내 업무 개수 (내 업무 배지)
|
||
nav_projects 프로젝트 목록(평면)
|
||
current_pid 지금 보고 있는 프로젝트 id (내 업무/수신함 화면이면 0)
|
||
side_active 'inbox' | 'mytasks' | 'trash' | 'goals' | '' — 개인 메뉴 활성 표시
|
||
goal_years "목표" 아래 연도 목록(router._goal_years_nav — 올해는 항상 포함)
|
||
goal_year_active 목표 화면에서 보고 있는 연도
|
||
is_admin 프로젝트 생성/수정/삭제 권한
|
||
목록 동작은 project.js 의 initSideTree(첫 화면을 같은 마크업으로 다시 그림),
|
||
새 프로젝트/수정 모달은 각 화면이 include 하는 project/_side_modals.html. #}
|
||
{# 날짜 팝업(openDatePopover)이 공휴일을 빨강으로 칠할 때 쓰는 표 — 이 사이드바는
|
||
프로젝트 관리의 모든 화면에 들어가므로 여기서 한 번 넘긴다(main.py 의 Jinja 전역). #}
|
||
<script>window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
|
||
<aside class="pj-side" data-is-admin="{{ 'true' if is_admin else 'false' }}"
|
||
data-is-super="{{ 'true' if user.is_super_admin else 'false' }}"
|
||
data-me="{{ user.email }}">
|
||
<!-- 전체 검색 — 제목·설명·댓글, 내가 볼 수 있는 모든 프로젝트(하위 업무 포함).
|
||
결과를 누르면 그 업무 팝업(/project/t/{id})으로. 어디서든 "/" 키로 포커스. -->
|
||
<div class="pj-side-search">
|
||
<span class="material-symbols-outlined pj-side-search-ic">search</span>
|
||
<input type="search" id="pj-global-search" placeholder="전체 검색 ( / )" autocomplete="off" aria-label="작업 전체 검색" />
|
||
<div class="pj-search-results" id="pj-search-results" hidden></div>
|
||
</div>
|
||
<!-- 아사나처럼 맨 위에 개인 메뉴(수신함 / 내 업무). 내 업무는 접었다 펴는
|
||
패널이 아니라 오른쪽 화면 전체에 목록을 띄우는 별도 페이지다. -->
|
||
<nav class="pj-side-nav">
|
||
<a class="pj-side-navlink {% if side_active == 'inbox' %}is-active{% endif %}" 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>
|
||
<a class="pj-side-navlink {% if side_active == 'mytasks' %}is-active{% endif %}" href="/project/">
|
||
<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" id="pj-myopen-badge"
|
||
{% if not my_open_total %}hidden{% endif %}>{{ my_open_total }}</span>
|
||
</a>
|
||
{# 휴지통 — 관리자만 보이고(화면·복구 API 도 관리자 전용), 지운 업무를 3개월 보관. #}
|
||
{% if is_admin %}
|
||
<a class="pj-side-navlink {% if side_active == 'trash' %}is-active{% endif %}" href="/project/trash">
|
||
<span class="material-symbols-outlined pj-side-navic">delete</span>
|
||
<span class="pj-side-navtext">휴지통</span>
|
||
</a>
|
||
{% endif %}
|
||
{# 목표 — 누르면 바로 아래에 연도가 펼쳐지고, 연도를 누르면 오른쪽에 그해 전체 목표
|
||
(/project/goals/{연도}). 펼침 상태는 localStorage(pj_goal_open), 목표 화면에서는 항상 펼침.
|
||
연도 추가는 관리자만(마이그레이션 013). #}
|
||
{% set goal_open = side_active == 'goals' %}
|
||
<div class="pj-side-goal{% if goal_open %} is-open{% endif %}" id="pj-side-goal"
|
||
data-force-open="{{ 'true' if goal_open else 'false' }}">
|
||
<button type="button" class="pj-side-navlink pj-side-goal-toggle" id="pj-side-goal-toggle"
|
||
aria-expanded="{{ 'true' if goal_open else 'false' }}">
|
||
<span class="material-symbols-outlined pj-side-navic">flag</span>
|
||
<span class="pj-side-navtext">목표</span>
|
||
<span class="material-symbols-outlined pj-side-goal-caret">expand_more</span>
|
||
</button>
|
||
<div class="pj-side-goal-years" id="pj-side-goal-years"{% if not goal_open %} hidden{% endif %}>
|
||
{% for y in (goal_years or []) %}
|
||
<a class="pj-side-goal-year{% if side_active == 'goals' and y == goal_year_active %} is-active{% endif %}"
|
||
href="/project/goals/{{ y }}">{{ y }}년</a>
|
||
{% endfor %}
|
||
{% if is_admin %}
|
||
<button type="button" class="pj-side-goal-add" id="pj-goal-year-add"
|
||
data-next="{{ ((goal_years or [0]) | max) + 1 }}">+ 연도 추가</button>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="pj-side-block pj-tree-block">
|
||
<div class="pj-side-head">
|
||
<span>프로젝트</span>
|
||
{% if is_admin %}
|
||
<button type="button" class="pj-icon-btn" id="pj-new-project-side" title="새 프로젝트">+</button>
|
||
{% endif %}
|
||
</div>
|
||
{% macro nav_li(p) %}
|
||
<li class="pj-tree-li" data-id="{{ p.id }}"{% if is_admin %} draggable="true"{% endif %}
|
||
data-name="{{ p.name }}" data-desc="{{ p.description or '' }}"
|
||
data-start="{{ p.start_date or '' }}" data-due="{{ p.due_date or '' }}"
|
||
data-color="{{ p.color }}" data-status="{{ p.status or 'active' }}"
|
||
data-creator="{{ p.created_by or '' }}" data-icon="{{ p.icon or '' }}">
|
||
<div class="pj-tree-row {% if p.id == current_pid %}is-active{% endif %}">
|
||
{% if is_admin %}<span class="pj-tree-handle" title="드래그로 순서 변경">⣿</span>{% endif %}
|
||
<a class="pj-tree-link" href="/project/p/{{ p.id }}"{% if is_admin %} draggable="false"{% endif %}>
|
||
<span class="pj-tree-avatar{% if p.icon %} has-icon{% endif %}" style="background: {{ p.color }}">{% if p.icon %}<span class="material-symbols-outlined pj-proj-ic">{{ p.icon }}</span>{% else %}{{ p.name[0] | upper }}{% endif %}</span>
|
||
<span class="pj-tree-name">{{ p.name }}</span>
|
||
</a>
|
||
{% if is_admin %}
|
||
<span class="pj-tree-acts">
|
||
<button type="button" class="pj-icon-btn pj-tree-edit" data-id="{{ p.id }}"
|
||
data-name="{{ p.name }}" data-desc="{{ p.description or '' }}"
|
||
data-start="{{ p.start_date or '' }}" data-due="{{ p.due_date or '' }}"
|
||
data-color="{{ p.color }}" data-status="{{ p.status or 'active' }}" title="프로젝트 수정">✎</button>
|
||
<button type="button" class="pj-icon-btn pj-tree-del" data-id="{{ p.id }}" data-name="{{ p.name }}" data-creator="{{ p.created_by }}" title="프로젝트 삭제">×</button>
|
||
</span>
|
||
{% endif %}
|
||
</div>
|
||
</li>
|
||
{% endmacro %}
|
||
{% set nav_active = nav_projects | rejectattr("status", "equalto", "completed") | list %}
|
||
{% set nav_done = nav_projects | selectattr("status", "equalto", "completed") | list %}
|
||
{% if nav_active %}
|
||
<ul class="pj-tree" id="pj-tree-root">
|
||
{% for p in nav_active %}{{ nav_li(p) }}{% endfor %}
|
||
</ul>
|
||
{% else %}
|
||
<div class="pj-empty-sm">프로젝트 없음</div>
|
||
{% endif %}
|
||
{% if nav_done %}
|
||
<div class="pj-side-head pj-side-head-done"><span>완료 프로젝트</span></div>
|
||
<ul class="pj-tree" id="pj-tree-root-done">
|
||
{% for p in nav_done %}{{ nav_li(p) }}{% endfor %}
|
||
</ul>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- 전체 멤버 — 등록된 전체 직원(프로젝트 권한 보유자). 관리자 전용
|
||
(/api/all-users 도 관리자만). 아이콘 클릭 시 그 사람이 담당자인 업무를
|
||
팝업으로 보여준다(프로젝트/세션/마감일). 수신함·내 업무·프로젝트 화면
|
||
모두에서 보인다 — 팝업 마크업은 _member_tasks_modal.html. -->
|
||
{% if is_admin %}
|
||
<div class="pj-side-block">
|
||
<div class="pj-side-head"><span>전체 멤버</span></div>
|
||
<div class="pj-allmembers-grid" id="pj-allmembers-grid">불러오는 중…</div>
|
||
</div>
|
||
{% endif %}
|
||
</aside>
|