당직근무 0.16.0 (웹 2026-12-01.1): 관리자 공지 메뉴와 앱 첫 화면 공지 띠

This commit is contained in:
블리어 committed 2026-12-01 05:50:27 +00:00
1 parent 2116ef5607
commit 5f2e2f6952
22 files changed
+265 -27

No files matched your search

+13 -3
View File
@@ -45,9 +45,11 @@ SITE_FIELDS = {
"defaultShowLunar": {"group": "처음 기본값(웹)", "label": "음력 날짜 함께 보기", "kind": "bool", "default": False},
"defaultOffRed": {"group": "처음 기본값(웹)", "label": "비번을 빨간색으로 표시", "kind": "bool", "default": False},
"defaultDutyWeekday": {"group": "처음 기본값(웹)", "label": "당직일은 평일색으로 표시", "kind": "bool", "default": False},
"noticeOn": {"group": "공지 띠", "label": "공지 띠 보이기", "kind": "bool", "default": False},
"noticeTone": {"group": "공지 띠", "label": "공지 종류", "kind": "choice", "choices": {"info": "안내", "warn": "주의"}, "default": "info"},
"noticeText": {"group": "공지 띠", "label": "공지 내용", "kind": "text", "max": 200, "default": ""},
# 공지 띠는 관리자 '공지' 화면에서 고친다. 홈페이지 맨 위와 앱 첫 화면(0.16.0부터, api/version의 notice)에 같이 보인다.
"noticeOn": {"page": "notice", "group": "공지 띠", "label": "공지 띠 보이기", "kind": "bool", "default": False},
"noticeTone": {"page": "notice", "group": "공지 띠", "label": "공지 종류", "kind": "choice", "choices": {"info": "안내", "warn": "주의"}, "default": "info"},
"noticeText": {"page": "notice", "group": "공지 띠", "label": "공지 내용", "kind": "text", "max": 200, "default": "",
"help": "홈페이지 맨 위와 앱 첫 화면에 한 줄로 보입니다. 200자까지 씁니다."},
"registrationOpen": {"group": "회원", "label": "새 회원가입 받기", "kind": "bool", "default": True},
# 게시판 화면 설정. 게시판 종류(이름·권한)는 관리자 '게시판'에서 따로 만든다.
"boardOn": {"page": "board", "group": "게시판 전체", "label": "게시판 열기", "kind": "bool", "default": True,
@@ -442,6 +444,14 @@ def setup(app, prefix, root, data_dir, db, identity, payload, throttle, administ
return {"entries": rows, "total": total, "page": page, "pageSize": 50}
def notice(db):
"""공지 띠. 앱은 버전 확인(api/version) 때 함께 받아 첫 화면에 보인다. 꺼져 있거나 글이 없으면 text가 빈 글자다."""
with db() as conn:
values, _ = read_settings(conn)
text = values["noticeText"].strip() if values["noticeOn"] else ""
return {"text": text, "tone": values["noticeTone"] if text else "info"}
def registration_open(db):
with db() as conn:
values, _ = read_settings(conn)