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;