Files
dbx-main/app/modules/notice/templates/notice/admin.html
T
king 2aa6b6efae feat(notice): urgent notices centered on every ERP screen until acknowledged
- Super admin only: /notice/ page (title, body with images, show time KST, all or picked people,
  preview, edit with optional re-show, cancel/undo, per-person acknowledgement status)
- Shown on every ERP page (erp_base, main, admin) dead center; [확인] only (no Esc/backdrop close),
  queue in order, ack failure keeps the dialog, closes when acked/cancelled elsewhere
- project_db migration 024 (urgent_notices, targets, acks, images as bytea); shares ProjectStore.pool
- Body sanitized like task descriptions, images restricted to /notice/images/{id}, type sniffed
- Entry points: ERP sidebar foot and Project options dialog (super admin)
- Docs (NOTICE_MODULE, DEPLOYMENT 024, overview, CLAUDE.md); tests (DB-less, real PostgreSQL, jsdom)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:07:10 +09:00

64 lines
3.1 KiB
HTML

{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
{% block content %}
{% if not enabled %}
<div class="ntc-card">
<h2>긴급 공지 준비 필요</h2>
<p>project_db 마이그레이션 024(<code>scripts/sql/project_db_024_urgent_notices.sql</code>)를 적용하면 사용할 수 있습니다.</p>
</div>
{% else %}
<div class="ntc-wrap" id="ntc-root">
<section class="ntc-card" aria-labelledby="ntc-form-title">
<h2 id="ntc-form-title">새 긴급 공지</h2>
<input type="hidden" id="ntc-id" value="" />
<label class="ntc-field">제목
<input type="text" id="ntc-title" maxlength="200" placeholder="예: 오늘 18시 서버 점검" autocomplete="off" />
</label>
<div class="ntc-field">내용
<div class="ntc-editor-bar">
<button type="button" data-cmd="bold" title="굵게"><b>B</b></button>
<button type="button" id="ntc-image-btn" title="이미지 넣기(붙여넣기·끌어 놓기도 됩니다)">이미지</button>
<input type="file" id="ntc-image-file" accept="image/png,image/jpeg,image/gif,image/webp" hidden multiple />
</div>
<div class="ntc-editor" id="ntc-body" contenteditable="true" role="textbox" aria-multiline="true" aria-label="공지 내용"
data-placeholder="공지 내용을 쓰세요. 이미지는 붙여넣거나 끌어 놓아도 됩니다."></div>
</div>
<label class="ntc-field">띄울 시각(한국시간 — 비우면 바로)
<input type="datetime-local" id="ntc-show-at" />
</label>
<div class="ntc-field">받는 사람
<div class="ntc-targets">
<label><input type="radio" name="ntc-to" value="all" checked /> 전체(로그인하는 모든 사람)</label>
<label><input type="radio" name="ntc-to" value="some" /> 고른 사람만</label>
<div class="ntc-people" id="ntc-people" hidden>
{% for p in people %}
<label><input type="checkbox" value="{{ p.email }}" /> {{ p.name }} <small>{{ p.email.split('@')[0] }}</small></label>
{% endfor %}
</div>
</div>
</div>
<label class="ntc-field" id="ntc-reshow-row" hidden style="flex-direction:row;align-items:center;font-weight:500">
<input type="checkbox" id="ntc-reshow" /> 이미 [확인]한 사람에게도 다시 띄우기
</label>
<div class="ntc-actions">
<button type="button" class="erp-btn erp-btn-outline" id="ntc-reset">새로 쓰기</button>
<button type="button" class="erp-btn erp-btn-outline" id="ntc-preview">미리 보기</button>
<button type="button" class="erp-btn" id="ntc-save">공지 만들기</button>
</div>
<p class="ntc-msg" id="ntc-msg" role="alert" hidden></p>
</section>
<section class="ntc-card" aria-labelledby="ntc-list-title">
<h2 id="ntc-list-title">공지 목록</h2>
<div class="ntc-list" id="ntc-list">불러오는 중…</div>
</section>
</div>
<script>window.NTC_PEOPLE = {{ people | tojson }};</script>
<script src="/static/erp-notice-admin.js?v=20261012a" defer></script>
{% endif %}
{% endblock %}