feat(vacation): 휴가 신청 날짜 칸 — 프로젝트와 같은 아사나식 날짜 팝업
- 공용 erp-datepop.js/css(project.js openDatePopover·enhanceDateInput·.pj-datepop CSS 를 떼어 낸 같은 모양·동작) - 시작일·종료일 = 숨긴 input + 날짜 버튼 둘(enhanceRange), 어느 쪽을 눌러도 같은 기간 팝업(누른 칸 먼저, 시작 → 종료 → 닫힘), 반차는 하루짜리, 직접 입력(Enter), Esc·바깥 클릭 닫힘 - 공휴일 = 휴가 설정 공휴일(빨강, 작년~내년) — 팝업 빨강·이름, 예상 일수에서도 제외(서버 compute_days 와 같게) - 테스트: vacation_datepop.browser.test.js(render_vacation.py), 휴가 신청 화면 공휴일·스크립트 렌더 확인 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -343,9 +343,27 @@ def _form_context(request: Request, user: dict[str, Any]) -> dict[str, Any]:
|
||||
"vacation_types": list(VACATION_TYPES),
|
||||
"halves": list(HALVES),
|
||||
"half_labels": HALF_LABELS,
|
||||
"holidays": _red_holidays(request),
|
||||
}
|
||||
|
||||
|
||||
def _red_holidays(request: Request) -> dict[str, str]:
|
||||
"""날짜 팝업 공휴일(빨강·이름) — 휴가 설정의 공휴일(is_red) 작년~내년. 일수 계산과 같은 표."""
|
||||
st = _store(request)
|
||||
if st is None:
|
||||
return {}
|
||||
year = today_kst().year
|
||||
out: dict[str, str] = {}
|
||||
try:
|
||||
for y in (year - 1, year, year + 1):
|
||||
for h in st.list_holidays(year=y):
|
||||
if h.get("is_red", True):
|
||||
out[h["holiday_date"]] = h.get("name") or ""
|
||||
except Exception: # noqa: BLE001 — 공휴일 표시가 신청 화면을 막지 않게
|
||||
return {}
|
||||
return out
|
||||
|
||||
|
||||
@router.get("/new", response_class=HTMLResponse)
|
||||
def new_form(request: Request) -> HTMLResponse:
|
||||
from app.main import render_template # noqa: WPS433
|
||||
|
||||
Reference in New Issue
Block a user