Files
dbx-main/app/modules/vacation/templates/vacation/index.html
T

139 lines
7.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/vacation.css?v=20261102a" />{% endblock %}
{% block content %}
<section class="vac">
<!-- 페이지 액션 -->
<div class="vac-actions">
<div class="vac-actions-main">
<a class="erp-btn erp-btn-primary" href="/vacation/new">+ 휴가 신청</a>
<a class="erp-btn erp-btn-outline" href="/vacation/mine">내 신청 내역</a>
{% if consult_count %}
<a class="erp-btn erp-btn-outline" href="/vacation/pending#consults">협의 대기
<span class="erp-badge erp-badge-inverse vac-mini">{{ consult_count }}</span>
</a>
{% endif %}
{% if is_approver %}
<a class="erp-btn erp-btn-outline" href="/vacation/pending">승인 대기
{% if pending_count %}<span class="erp-badge erp-badge-inverse vac-mini">{{ pending_count }}</span>{% endif %}
</a>
{% endif %}
<a class="erp-btn erp-btn-outline" href="/vacation/export.xlsx?year={{ year }}&month={{ month }}">엑셀</a>
{#- 옵션(2026-10-27) — 승인자·승인 통보자·잔여 연차(수정 = 관리자·승인자·통보자) · 내 Gmail 연결(누구나). 설정 버튼은 없앰 -#}
<a class="erp-btn erp-btn-outline" href="/vacation/options">옵션</a>
</div>
<div class="vac-balance">
{#- 내 연차 — 입사일 기준(2026-10-27, 12/31 소멸 없음): 이번 연차 기간에 생기는 연차·쓴 날·지금 쓸 수 있는 잔여·먼저 소멸할 잔여 -#}
{% set gt = '%g' % balance.granted_so_far ~ ((' (+%g 예정)' % balance.upcoming) if balance.upcoming else '') %}
<span class="vac-bal-item" title="이번 연차 기간 {{ balance.period_start }} ~ {{ balance.period_end }}에 생기는 연차(오늘까지 생긴 것 + 앞으로 생길 것)">발생 <strong>{{ gt }}</strong></span>
<span class="vac-bal-sep">·</span>
<span class="vac-bal-item" title="승인된 연차·오전반차·오후반차(병가·경조·대체휴무·기타는 빼지 않음)">사용 <strong>{{ '%g' % balance.used_days }}</strong></span>
<span class="vac-bal-sep">·</span>
<span class="vac-bal-item vac-bal-remain{% if balance.remaining_days < 0 %} is-minus{% endif %}" title="오늘 쓸 수 있는 연차">잔여 <strong>{{ '%g' % balance.remaining_days }}</strong></span>
{% if balance.expiring %}<span class="erp-muted vac-bal-year">{{ balance.expiring.date | replace('-', '.') }} 소멸 {{ '%g' % balance.expiring.days }}일</span>
{% elif not balance.has_hire and balance.manual_total is none %}<span class="erp-muted vac-bal-year">입사일 미등록(옵션)</span>{% endif %}
</div>
</div>
<div class="vac-layout">
<!-- ── 왼쪽: 월간 달력 ── -->
<div class="erp-card vac-cal-card">
<div class="vac-cal-head">
<a class="erp-btn erp-btn-outline vac-nav-btn"
href="/vacation/?year={{ prev_y }}&month={{ prev_m }}">‹</a>
<h2 class="vac-cal-title">{{ year }}년 {{ month }}월</h2>
<a class="erp-btn erp-btn-outline vac-nav-btn"
href="/vacation/?year={{ next_y }}&month={{ next_m }}">›</a>
<a class="erp-btn erp-btn-outline vac-today-btn" href="/vacation/">오늘</a>
</div>
<div class="vac-cal">
<div class="vac-wd-row">
{% for wd in weekdays %}
<div class="vac-wd {% if loop.index0 == 0 %}vac-red{% elif loop.index0 == 6 %}vac-blue{% endif %}">{{ wd }}</div>
{% endfor %}
</div>
{% for week in weeks %}
<div class="vac-week{% if week.days | selectattr('holiday_name') | list %} has-hol{% endif %}">
<div class="vac-week-days">
{% for cell in week.days %}
<a class="vac-day
{% if not cell.in_month %}vac-out{% endif %}
{% if cell.is_today %}vac-today{% endif %}
{% if cell.is_selected %}vac-selected{% endif %}"
href="/vacation/?year={{ year }}&month={{ month }}&date={{ cell.date }}"
{% if cell.holiday_name %}title="{{ cell.holiday_name }}"{% endif %}>
<span class="vac-day-num
{% if cell.is_sunday or cell.is_holiday %}vac-red{% elif cell.is_saturday %}vac-blue{% endif %}">{{ cell.day }}</span>
{#- 국경일·대체공휴일·회사 휴일 이름 — 날짜 숫자 아래(2026-10-27) -#}
{% if cell.holiday_name %}<span class="vac-hol-name">{{ cell.holiday_name }}</span>{% endif %}
</a>
{% endfor %}
</div>
<div class="vac-week-bars">
{% for bar in week.bars %}
<a class="vac-bar {{ bar.status_class }}
{% if bar.continues_left %}vac-bar-l{% endif %}
{% if bar.continues_right %}vac-bar-r{% endif %}"
style="grid-column: {{ bar.start_col + 1 }} / span {{ bar.span }}; grid-row: {{ bar.lane + 1 }};"
href="/vacation/{{ bar.id }}"
title="{{ bar.label }} ({{ bar.days }}일 · {{ bar.status }})">
<span class="vac-bar-label">{{ bar.label }}</span>
</a>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
<div class="vac-legend">
<span class="vac-leg"><i class="vac-dot vac-bar-submit"></i>협의·제출</span>
<span class="vac-leg"><i class="vac-dot vac-bar-approve"></i>승인</span>
<span class="vac-leg"><i class="vac-dot vac-bar-reject"></i>반려</span>
<span class="vac-leg"><i class="vac-dot vac-bar-cancel"></i>취소</span>
</div>
</div>
<!-- ── 오른쪽: 선택일 휴가 리스트 ── -->
<div class="erp-card vac-list-card">
<div class="vac-list-head">
<h2>{{ selected_date }}</h2>
<span class="erp-muted">{{ sel_requests|length }}건</span>
</div>
{% if sel_requests %}
<ul class="vac-list">
{% for r in sel_requests %}
<li class="vac-list-item">
<a href="/vacation/{{ r.id }}" class="vac-list-link">
<div class="vac-list-top">
<strong>{{ r.owner_name or r.owner }}</strong>
{% set badge = 'erp-badge-neutral' %}
{% if r.status == '승인' %}{% set badge = 'erp-badge-success' %}
{% elif r.status in ('제출', '협의중') %}{% set badge = 'erp-badge-inverse' %}
{% elif r.status == '반려' %}{% set badge = 'erp-badge-danger' %}{% endif %}
<span class="erp-badge {{ badge }}">{{ r.status }}</span>
</div>
<div class="vac-list-meta erp-muted">
{{ r.vacation_type }} · {{ r.days }}일 ·
{{ r.start_date }}{% if r.end_date != r.start_date %} ~ {{ r.end_date }}{% endif %}
</div>
{% if r.reason %}<div class="vac-list-reason erp-muted">{{ r.reason }}</div>{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<p class="erp-muted vac-empty">선택한 날짜의 휴가가 없습니다.
<a href="/vacation/new">휴가 신청</a></p>
{% endif %}
</div>
</div>
</section>
{% endblock %}