From aa8ae86f1da1c7a78e0fa5e57dad5c51bd35617d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Wed, 4 Mar 2026 14:51:18 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[approval]=20=EC=96=91=EC=8B=9D=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EC=8B=9C=20=EC=A0=9C=EB=AA=A9=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EC=84=A4=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - applyBodyTemplate에서 제목 필드가 비어있으면 양식명 자동 입력 - create/edit 공통 적용 --- resources/views/approvals/create.blade.php | 7 +++++++ resources/views/approvals/edit.blade.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/resources/views/approvals/create.blade.php b/resources/views/approvals/create.blade.php index 3f759d55..a5564b6c 100644 --- a/resources/views/approvals/create.blade.php +++ b/resources/views/approvals/create.blade.php @@ -341,6 +341,13 @@ function applyBodyTemplate(formId) { if (!confirm('현재 본문 내용을 양식 템플릿으로 교체하시겠습니까?')) return; } + // 제목 자동 설정 (비어있을 때만) + const titleEl = document.getElementById('title'); + if (!titleEl.value.trim()) { + const formSelect = document.getElementById('form_id'); + titleEl.value = formSelect.options[formSelect.selectedIndex].text; + } + // 편집기 활성화 후 HTML 삽입 const useEditorEl = document.getElementById('useEditor'); if (!useEditorEl.checked) { diff --git a/resources/views/approvals/edit.blade.php b/resources/views/approvals/edit.blade.php index fed2e480..75c21fef 100644 --- a/resources/views/approvals/edit.blade.php +++ b/resources/views/approvals/edit.blade.php @@ -376,6 +376,13 @@ function applyBodyTemplate(formId) { if (!confirm('현재 본문 내용을 양식 템플릿으로 교체하시겠습니까?')) return; } + // 제목 자동 설정 (비어있을 때만) + const titleEl = document.getElementById('title'); + if (!titleEl.value.trim()) { + const formSelect = document.getElementById('form_id'); + titleEl.value = formSelect.options[formSelect.selectedIndex].text; + } + const useEditorEl = document.getElementById('useEditor'); if (!useEditorEl.checked) { useEditorEl.checked = true;