fix: admin UX — QR placeholder, 투표 상태 분리, 제목 placeholder 다양화, 시상 빈블럭 가드
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
22
app.py
22
app.py
@@ -29,6 +29,15 @@ CATEGORIES = [
|
||||
("polish_team", "🏆 완성도상", "양우산 5개"),
|
||||
("utility_team", "🛠 실용성상", "팜레스트 5개"),
|
||||
]
|
||||
TITLE_PLACEHOLDERS = [
|
||||
"예: Slack 멘션 자동 분류기",
|
||||
"예: kubectl 매크로 CLI",
|
||||
"예: PR 우선순위 큐",
|
||||
"예: 회의 캘린더 브리핑",
|
||||
"예: 신입 가이드 봇",
|
||||
"예: 배포 알림 봇",
|
||||
"예: 점심 투표 봇",
|
||||
]
|
||||
PRIZE_PRIORITY = ["utility_team", "polish_team", "fun_team"]
|
||||
|
||||
SHOW_CSS = """
|
||||
@@ -668,7 +677,7 @@ def render_admin():
|
||||
new_override = st.text_input(
|
||||
"Override (비워두면 자동 감지)",
|
||||
value=cur_override,
|
||||
placeholder="http://192.168.1.10:8501",
|
||||
placeholder="https://hackerthon.altair823.xyz",
|
||||
key="qr_override",
|
||||
)
|
||||
if st.button("Override 저장"):
|
||||
@@ -676,9 +685,11 @@ def render_admin():
|
||||
st.success("저장됨.")
|
||||
st.rerun()
|
||||
|
||||
st.divider()
|
||||
st.subheader("🗳 투표 상태")
|
||||
voting_open = is_voting_open()
|
||||
cur_label = "🟢 투표 진행 중" if voting_open else "🔴 투표 마감됨"
|
||||
st.markdown(f"### 투표 상태: {cur_label}")
|
||||
st.markdown(f"**현재**: {cur_label}")
|
||||
cc1, cc2 = st.columns(2)
|
||||
with cc1:
|
||||
if voting_open and st.button("🛑 투표 마감 (시상 시작 전 필수)", type="primary"):
|
||||
@@ -807,11 +818,11 @@ def render_admin():
|
||||
titles = get_titles()
|
||||
with st.form("titles_form"):
|
||||
new_titles = {}
|
||||
for team in TEAMS:
|
||||
for i, team in enumerate(TEAMS):
|
||||
new_titles[team] = st.text_input(
|
||||
team,
|
||||
value=titles.get(team, ""),
|
||||
placeholder="예: 슬랙 멘션 자동 분류기",
|
||||
placeholder=TITLE_PLACEHOLDERS[i % len(TITLE_PLACEHOLDERS)],
|
||||
key=f"title_{team}",
|
||||
)
|
||||
if st.form_submit_button("제목 저장"):
|
||||
@@ -914,7 +925,10 @@ def render_admin():
|
||||
|
||||
st.divider()
|
||||
st.subheader("🎤 시상식 발표용 (복사해서 화면 공유)")
|
||||
if public_lines:
|
||||
st.code("\n".join(public_lines), language="markdown")
|
||||
else:
|
||||
st.caption("아직 결과 없음. 투표 마감 후 자동 표시.")
|
||||
|
||||
st.divider()
|
||||
with st.expander("🔍 감사 로그 (사칭 추적용)"):
|
||||
|
||||
Reference in New Issue
Block a user