@extends('admin.layouts.app')

@section('content')
<div class="container-fluid">
    <h2>이메일 양식</h2>
    <hr/>
    @include('admin.messages')
    @include('admin.config.form.navTabs')

    <form name="f_admin_write" id="fAdminWrite" method="post" action="{{ route('admin.config.form.email.store') }}" enctype="multipart/form-data">
        @csrf
        <p>
            <button type="button" id="btnConfigEmailFormLayout" class="btn btn-default btn-sm">기본 레이아웃 보기</button>
        </p>
        <div class="alert alert-success" role="alert">
            <p><strong>*치환가능변수</strong></p>
            <p>{홈페이지명}, {회사명}, {홈페이지주소}, {회원아이디}, {회원이름}, {회원이메일}, {메일인증주소}, {인증번호}, {회원아이피}</p>
            <p>{회원아이피} 는 회원가입시 접속한 실제 IP 로 치환됩니다.</p>
            <p>{메일인증주소} 는 이메일 인증기능을 사용하는 설정 하에, 회원에게 보내는 메일에만 치환 기능이 작동합니다.</p>
        </div>
        <div class="row mb-3">
            <label for="sendEmailRegisterAdminTitle" class="col-sm-2 col-form-label">회원가입</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_register_form_title" id="sendEmailRegisterAdminTitle" class="form-control" value="{{ $config->item('send_email_register_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_register_form_content', $config->item('send_email_register_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailRegisterFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailChangePwFormTitle" class="col-sm-2 col-form-label">비밀번호 변경</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_changepw_form_title" id="sendEmailChangePwFormTitle" class="form-control" value="{{ $config->item('send_email_changepw_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_changepw_form_content', $config->item('send_email_changepw_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailChangePwFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailWithdrawFormTitle" class="col-sm-2 col-form-label">회원탈퇴</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_withdraw_form_title" id="sendEmailWithdrawFormTitle" class="form-control" value="{{ $config->item('send_email_withdraw_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_withdraw_form_content', $config->item('send_email_withdraw_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailWithdrawFormContent'); ?>
            </div>
        </div>
        <!--
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailAuthFormTitle" class="col-sm-2 col-form-label">이메일 인증</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_auth_form_title" id="sendEmailAuthFormTitle" class="form-control" value="{{ $config->item('send_email_auth_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_auth_form_content', $config->item('send_email_auth_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailAuthFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailVerifyCodeFormTitle" class="col-sm-2 col-form-label">인증번호</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_verify_code_form_title" id="sendEmailVerifyCodeFormTitle" class="form-control" value="{{ $config->item('send_email_verify_code_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_verify_code_form_content', $config->item('send_email_verify_code_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailVerifyCodeFormContent'); ?>
            </div>
        </div>
        -->
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailFindFormTitle" class="col-sm-2 col-form-label">회원정보 찾기</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_find_form_title" id="sendEmailFindFormTitle" class="form-control" value="{{ $config->item('send_email_find_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_find_form_content', $config->item('send_email_find_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailFindFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailPostFormTitle" class="col-sm-2 col-form-label">게시글 작성</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_post_form_title" id="sendEmailPostFormTitle" class="form-control" value="{{ $config->item('send_email_post_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_post_form_content', $config->item('send_email_post_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailPostFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailCommentFormTitle" class="col-sm-2 col-form-label">댓글 작성</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_comment_form_title" id="sendEmailCommentFormTitle" class="form-control" value="{{ $config->item('send_email_comment_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_comment_form_content', $config->item('send_email_comment_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailCommentFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailPostBlameFormTitle" class="col-sm-2 col-form-label">게시글 신고</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_post_blame_form_title" id="sendEmailPostBlameFormTitle" class="form-control" value="{{ $config->item('send_email_post_blame_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_post_blame_form_content', $config->item('send_email_post_blame_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailPostBlameFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailCommentBlameFormTitle" class="col-sm-2 col-form-label">댓글 신고</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_comment_blame_form_title" id="sendEmailCommentBlameFormTitle" class="form-control" value="{{ $config->item('send_email_comment_blame_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_comment_blame_form_content', $config->item('send_email_comment_blame_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailCommentBlameFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailPostPersonalFormTitle" class="col-sm-2 col-form-label">1:1 문의 접수<br/>(게시글)</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_post_personal_form_title" id="sendEmailPostPersonalFormTitle" class="form-control" value="{{ $config->item('send_email_post_personal_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_post_personal_form_content', $config->item('send_email_post_personal_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailPostPersonalFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="row mb-3">
            <label for="sendEmailPostPersonalReplyFormTitle" class="col-sm-2 col-form-label">1:1 문의 답변<br/>(댓글)</label>
            <div class="col-sm-10">
                <div class="form-label">
                    <input type="text" name="send_email_post_personal_reply_form_title" id="sendEmailPostPersonalReplyFormTitle" class="form-control" value="{{ $config->item('send_email_post_personal_reply_form_title') }}" />
                </div>
                <?php echo htmlEditor('send_email_post_personal_reply_form_content', $config->item('send_email_post_personal_reply_form_content'), 'form-control dhtml-editor', true, false, '', 8, 'sendEmailPostPersonalReplyFormContent'); ?>
            </div>
        </div>
        <hr/>
        <div class="text-end">
            <button type="submit" class="btn btn-success">저장하기</button>
        </div>
    </form>
</div>

<script type="module">
$("#fAdminWrite").validate({
    rules: {
        send_email_register_form_title: {required: false},
        send_email_register_form_content: {'required_tinymce': false},
        send_email_changepw_form_title: {required: false},
        send_email_changepw_form_content: {'required_tinymce': false},
        send_email_withdraw_form_title: {required: false},
        send_email_withdraw_form_content: {'required_tinymce': false},
        /*
        send_email_auth_form_title: {required: false},
        send_email_auth_form_content: {'required_tinymce': false},
        send_email_verify_code_form_title: {required: false},
        send_email_verify_code_form_content: {'required_tinymce': false},
        */
        send_email_find_form_title: {required: false},
        send_email_find_form_content: {'required_tinymce': false},
        send_email_post_form_title: {required: false},
        send_email_post_form_content: {'required_tinymce': false},
        send_email_comment_form_title: {required: false},
        send_email_comment_form_content: {'required_tinymce': false},
        send_email_post_blame_form_title: {required: false},
        send_email_post_blame_form_content: {'required_tinymce': false},
        send_email_comment_blame_form_title: {required: false},
        send_email_comment_blame_form_content: {'required_tinymce': false},
        send_email_post_personal_form_title: {required: false},
        send_email_post_personal_form_content: {'required_tinymce': false},
        send_email_post_personal_reply_form_title: {required: false},
        send_email_post_personal_reply_form_content: {'required_tinymce': false}
    }
});

$(document).on("click", "#btnConfigEmailFormLayout", function() {
   popupCenter(ADMIN_URL + '/config/form/email/layout', "기본 레이아웃", 1024, 600);
});
</script>
@endsection
