당직근무 0.15.4 (웹 2026-11-25.8): 근무 순서 이름 줄마다 표시 고르기

사용자 지시(2026-11-25): 근무 순서 이름 창 위쪽의 공통 달력에 보일 것 하나로 하지 말고 이름 줄마다 고르게 할 것.

- 근무표(rotation)에 nameModes를 더했다. 순서와 같은 길이이고 값은 both·name·shift 또는 빈 글자(예전 공통 선택 nameDisplay를 따름).
- 앱·웹 이름 창: 줄마다 이름 칸 옆에 둘 다·이름만·근무만. 공통 선택 칸은 뺐다. 웹은 비회원도 고를 수 있다.
- 달력 칸·위젯·오늘 카드·다른 달력 반영·구독 제목이 줄마다 고른 대로 보인다(Schedule.nameModeOn, WorkPlan.nameModeOn, name_mode_on).
- 서버: validate_rotation_name_modes, 0.15.0~0.15.3 앱이 nameModes 없이 저장해도 이름이 있고 길이가 같으면 보존, 소속 공유에는 넣지 않음.
- 기초 설정에서 근무 종류만 바꾸면(길이 같음) 이름과 표시를 남긴다.
- 앱 0.15.4 / 설치 번호 28. APK 876810바이트, SHA-256 05d64c0b57c9817719d6b067fc7c6e7a3a6260c78b05ff02ecb78aa6b2e009c3
This commit is contained in:
블리어 committed 2026-11-25 04:05:14 +00:00
1 parent 5f1b5b076c
commit f7aaa68fd0
26 files changed
+244 -88

No files matched your search

+4 -4
View File
@@ -10,7 +10,7 @@ import hashlib
import json
from pathlib import Path
from work_names import name_matches
from work_plan import shift as plan_shift, name_on
from work_plan import shift as plan_shift, name_on, name_mode_on
OPTIONS=('rotation','events','anniversaries','names','notes')
LABELS={'DUTY':'당직','OFF':'비번','REGULAR':'일반근무','DAY':'주간','EVENING':'오후','NIGHT':'야간','REST':'휴무','LEAVE':'연차·휴가','SICK':'병가','TRAINING':'교육','ANNUAL_LEAVE':'연차','MONTHLY_LEAVE':'월차','VACATION':'일반휴가','OFFICIAL_LEAVE':'공가','FAMILY_LEAVE':'경조휴가'}
@@ -67,7 +67,7 @@ def project(state,chosen,today,holidays):
rules=[item['data'] for item in items if item['kind']=='name_rule'];output={}
# '일반근무 이름 한 개'(regularName)는 0.15.3에서 껐다. 저장된 값이 있어도 제목에 쓰지 않는다.
labels=LABELS
# 근무 순서에 넣은 이름은 회원이 고른 표시 방법(근무만 · 이름만 · 둘 다)을 따른다.
# 근무 순서에 넣은 이름은 이름 줄마다 고른 표시 방법(근무만 · 이름만 · 둘 다)을 따른다. 고른 적이 없으면 예전 공통 선택이다.
mode=next((item['data'].get('nameDisplay') for item in items if item['kind']=='preferences'),None) or 'both'
def put(key,title,notes,start,end,all_day):
output[key]={'key':key,'title':title,'notes':notes,'start':start,'end':end,'allDay':all_day}
@@ -83,8 +83,8 @@ def project(state,chosen,today,holidays):
if name_matches(rule,day,own,holiday,shift(person,day) if person else None):
name=person['name'] if rule['mode']=='PERSON' else rule['name']
if name not in names:names.append(name)
slot=name_on(rotation,day)
title=labels[own] if not slot or mode=='shift' else slot if mode=='name' else labels[own]+'('+slot+')'
slot=name_on(rotation,day);slot_mode=name_mode_on(rotation,day,mode) if slot else mode
title=labels[own] if not slot or slot_mode=='shift' else slot if slot_mode=='name' else labels[own]+'('+slot+')'
put('rotation:'+day.isoformat(),title+(' · '+' · '.join(names) if names else ''),'',day,day+timedelta(days=1),True)
if chosen['anniversaries']:
for item in items: