@extends('admin.layouts.app')

@section('content')
<div class="container-fluid">
    <h2>게시판 관리 - 작성</h2>
    <hr/>
    @include('admin.messages')
    @if($boardID)
        @include('admin.board.board.navTabs')
    @endif

    <form name="f_admin_write" id="fAdminWrite" method="post" action="{{ $actionURL }}" enctype="multipart/form-data">
        @csrf
        <input type="hidden" name="board_id" value="{{ $boardID }}" />
        <div class="row mb-3">
            <label for="writeHeaderContent" class="col-sm-2 col-form-label">작성폼 상단 내용</label>
            <div class="col-sm-8">
                <?php echo htmlEditor('write_header_content', ($boardMetaData->write_header_content ?? old('write_header_content')), 'form-control dhtml-editor', true, false, '', 8, 'writeHeaderContent'); ?>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[write_header_content]" id="grpWriteHeaderContent" class="form-check-input" value="1" />
                    <label for="grpWriteHeaderContent" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[write_header_content]" id="allWriteHeaderContent" class="form-check-input" value="1" />
                    <label for="allWriteHeaderContent" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="mobileWriteHeaderContent" class="col-sm-2 col-form-label">모바일 작성폼 상단 내용</label>
            <div class="col-sm-8">
                <?php echo htmlEditor('mobile_write_header_content', ($boardMetaData->mobile_write_header_content ?? old('mobile_write_header_content')), 'form-control dhtml-editor', true, false, '', 8, 'mobileWriteHeaderContent'); ?>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[mobile_write_header_content]" id="grpMobileWriteHeaderContent" class="form-check-input" value="1" />
                    <label for="grpMobileWriteHeaderContent" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[mobile_write_header_content]" id="allMobileWriteHeaderContent" class="form-check-input" value="1" />
                    <label for="allMobileWriteHeaderContent" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="postDefaultSubject" class="col-sm-2 col-form-label">글쓰기 시 기본 제목</label>
            <div class="col-sm-8">
                <input type="text" name="post_default_subject" id="postDefaultSubject" class="form-control" value="{{ $boardMetaData->post_default_subject ?? old('post_default_subject') }}" />
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[post_default_subject]" id="grpPostDefaultSubject" class="form-check-input" value="1" />
                    <label for="grpPostDefaultSubject" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[post_default_subject]" id="allPostDefaultSubject" class="form-check-input" value="1" />
                    <label for="allPostDefaultSubject" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="postDefaultContent" class="col-sm-2 col-form-label">글쓰기 시 기본 내용</label>
            <div class="col-sm-8">
                <textarea name="post_default_content" id="postDefaultContent" class="form-control" rows="5">{{ $boardMetaData->post_default_content ?? old('post_default_content') }}</textarea>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[post_default_content]" id="grpPostDefaultContent" class="form-check-input" value="1" />
                    <label for="grpPostDefaultContent" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[post_default_content]" id="allPostDefaultContent" class="form-check-input" value="1" />
                    <label for="allPostDefaultContent" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="usePostDhtml_1" class="col-sm-2">본문 에디터 사용</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_post_dhtml" id="usePostDhtml_1" class="form-check-input" value="1" @if($boardMetaData->use_post_dhtml ?? old('use_post_dhtml')) checked @endif/>
                    <label for="usePostDhtml_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_post_dhtml" id="usePostDhtml_0" class="form-check-input" value="0" @if(!($boardMetaData->use_post_dhtml ?? old('use_post_dhtml'))) checked @endif/>
                    <label for="usePostDhtml_0" class="form-check-label">아니오</label>
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[use_post_dhtml]" id="grpUsePostDhtml" class="form-check-input" value="1" />
                    <label for="grpUsePostDhtml" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[use_post_dhtml]" id="allUsePostDhtml" class="form-check-input" value="1" />
                    <label for="allUsePostDhtml" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="saveExternalImage_1" class="col-sm-2">외부 이미지 가져오기</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="save_external_image" id="saveExternalImage_1" class="form-check-input" value="1" @if($boardMetaData->save_external_image ?? old('save_external_image')) checked @endif/>
                    <label for="saveExternalImage_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="save_external_image" id="saveExternalImage_0" class="form-check-input" value="0" @if(!($boardMetaData->save_external_image ?? old('save_external_image'))) checked @endif/>
                    <label for="saveExternalImage_0" class="form-check-label">아니오</label>
                </div>
                <div class="form-text text-muted">
                    게시물 입력시 본문에 외부사이트 이미지가 있는 경우 서버로 이미지를 수집합니다.
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[save_external_image]" id="grpSaveExternalImage" class="form-check-input" value="1" />
                    <label for="grpSaveExternalImage" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[save_external_image]" id="allSaveExternalImage" class="form-check-input" value="1" />
                    <label for="allSaveExternalImage" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="postSubjectMinLength" class="col-sm-2 col-form-label">최소 글수 제한<br/>(제목)</label>
            <div class="col-sm-8">
                <input type="text" name="post_subject_min_length" id="postSubjectMinLength" class="form-control only-digits-input d-inline w-auto" value="{{ $boardMetaData->post_subject_min_length ?? old('post_subject_min_length') }}" /> 글자
                <div class="form-text text-muted">
                    글자 이상 작성하셔야 합니다. 0 입력시 제한 없음
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[post_subject_min_length]" id="grpPostSubjectMinLength" class="form-check-input" value="1" />
                    <label for="grpPostSubjectMinLength" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[post_subject_min_length]" id="allPostSubjectMinLength" class="form-check-input" value="1" />
                    <label for="allPostSubjectMinLength" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="postSubjectMaxLength" class="col-sm-2 col-form-label">최대 글수 제한<br/>(제목)</label>
            <div class="col-sm-8">
                <input type="text" name="post_subject_max_length" id="postSubjectMaxLength" class="form-control only-digits-input d-inline w-auto" value="{{ $boardMetaData->post_subject_max_length ?? old('post_subject_max_length') }}" /> 글자
                <div class="form-text text-muted">
                    글자 이하 작성하셔야 합니다. 0 입력시 제한 없음
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[post_subject_max_length]" id="grpPostSubjectMaxLength" class="form-check-input" value="1" />
                    <label for="grpPostSubjectMaxLength" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[post_subject_max_length]" id="allPostSubjectMaxLength" class="form-check-input" value="1" />
                    <label for="allPostSubjectMaxLength" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="postContentMinLength" class="col-sm-2 col-form-label">최소 글수 제한<br/>(내용)</label>
            <div class="col-sm-8">
                <input type="text" name="post_content_min_length" id="postContentMinLength" class="form-control only-digits-input d-inline w-auto" value="{{ $boardMetaData->post_content_min_length ?? old('post_content_min_length') }}" /> 글자
                <div class="form-text text-muted">
                    글자 이상 작성하셔야 합니다. 0 입력시 제한 없음
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[post_content_min_length]" id="grpPostContentMinLength" class="form-check-input" value="1" />
                    <label for="grpPostContentMinLength" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[post_content_min_length]" id="allPostContentMinLength" class="form-check-input" value="1" />
                    <label for="allPostContentMinLength" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="postContentMaxLength" class="col-sm-2 col-form-label">최대 글수 제한<br/>(내용)</label>
            <div class="col-sm-8">
                <div class="form-inline">
                    <input type="text" name="post_content_max_length" id="postContentMaxLength" class="form-control only-digits-input d-inline w-auto" value="{{ $boardMetaData->post_content_max_length ?? old('post_content_max_length') }}" /> 글자
                </div>
                <div class="form-text text-muted">
                    글자 이하 작성하셔야 합니다. 0 입력시 제한 없음
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[post_content_max_length]" id="grpPostContentMaxLength" class="form-check-input" value="1" />
                    <label for="grpPostContentMaxLength" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[post_content_max_length]" id="allPostContentMaxLength" class="form-check-input" value="1" />
                    <label for="allPostContentMaxLength" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="useCategoryRequired_1" class="col-sm-2">분류 필수 선택</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_category_required" id="useCategoryRequired_1" class="form-check-input" value="1" @if($boardMetaData->use_category_required ?? old('use_category_required')) checked @endif/>
                    <label for="useCategoryRequired_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_category_required" id="useCategoryRequired_0" class="form-check-input" value="0" @if(!($boardMetaData->use_category_required ?? old('use_category_required'))) checked @endif/>
                    <label for="useCategoryRequired_0" class="form-check-label">아니오</label>
                </div>
                <div class="form-text text-muted">
                    분류를 필수 선택하도록 합니다.
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[use_post_secret_selected]" id="grpUsePostSecretSelected" class="form-check-input" value="1" />
                    <label for="grpUsePostSecretSelected" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[use_post_secret_selected]" id="allUsePostSecretSelected" class="form-check-input" value="1" />
                    <label for="allUsePostSecretSelected" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="usePostSecret" class="col-sm-2 col-form-label">비밀글 사용</label>
            <div class="col-sm-8">
                <select name="use_post_secret" id="usePostSecret" class="form-select w-auto">
                    <option value="" {{ ($boardMetaData->use_post_secret ?? old('use_post_secret')) == '' ? 'selected' : '' }} >사용하지 않음</option>
                    <option value="1" {{ ($boardMetaData->use_post_secret ?? old('use_post_secret')) == '1' ? 'selected' : '' }} >선택 사용</option>
                    <option value="2" {{ ($boardMetaData->use_post_secret ?? old('use_post_secret')) == '2' ? 'selected' : '' }} >항상 비밀글</option>
                </select>
                <div class="form-text text-muted">
                    비밀글은 작성자 본인과 게시판 관리자 이상만 열람 가능합니다.
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[use_post_secret]" id="grpUsePostSecret" class="form-check-input" value="1" />
                    <label for="grpUsePostSecret" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[use_post_secret]" id="allUsePostSecret" class="form-check-input" value="1" />
                    <label for="allUsePostSecret" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="usePostSecretSelected_1" class="col-sm-2">비밀글 기본 선택</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_post_secret_selected" id="usePostSecretSelected_1" class="form-check-input" value="1" @if($boardMetaData->use_post_secret_selected ?? old('use_post_secret_selected')) checked @endif/>
                    <label for="usePostSecretSelected_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_post_secret_selected" id="usePostSecretSelected_0" class="form-check-input" value="0" @if(!($boardMetaData->use_post_secret_selected ?? old('use_post_secret_selected'))) checked @endif/>
                    <label for="usePostSecretSelected_0" class="form-check-label">아니오</label>
                </div>
                <div class="form-text text-muted">
                    비밀글 선택 사용 가능 게시판에서 글쓰기시 비밀글 옵션 부분이 기본으로 선택되어 있습니다.
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[use_post_secret_selected]" id="grpUsePostSecretSelected" class="form-check-input" value="1" />
                    <label for="grpUsePostSecretSelected" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[use_post_secret_selected]" id="allUsePostSecretSelected" class="form-check-input" value="1" />
                    <label for="allUsePostSecretSelected" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row">
            <label for="usePostTag_1" class="col-sm-2">태그 사용</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_post_tag" id="usePostTag_1" class="form-check-input" value="1" @if($boardMetaData->use_post_tag ?? old('use_post_tag')) checked @endif/>
                    <label for="usePostTag_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_post_tag" id="usePostTag_0" class="form-check-input" value="0" @if(!($boardMetaData->use_post_tag ?? old('use_post_tag'))) checked @endif/>
                    <label for="usePostTag_0" class="form-check-label">아니오</label>
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[use_post_tag]" id="grpUsePostTag" class="form-check-input" value="1" />
                    <label for="grpUsePostTag" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[use_post_tag]" id="allUsePostTag" class="form-check-input" value="1" />
                    <label for="allUsePostTag" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="linkNum" class="col-sm-2 col-form-label">URL Link 개수</label>
            <div class="col-sm-8">
                <input type="text" name="link_num" id="linkNum" class="form-control only-digits-input d-inline w-auto" value="{{ $boardMetaData->link_num ?? old('link_num') }}" /> 개
                <div class="form-text text-muted">
                    글 입력시 URL link 입력 필드가 나타납니다. (최대 10개, 0개는 사용 안함)
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[link_num]" id="grpLinkNum" class="form-check-input" value="1" />
                    <label for="grpLinkNum" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[link_num]" id="allLinkNum" class="form-check-input" value="1" />
                    <label for="allLinkNum" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row">
            <label for="useUploadFile_1" class="col-sm-2">첨부파일 사용</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_upload_file" id="useUploadFile_1" class="form-check-input" value="1" @if($boardMetaData->use_upload_file ?? old('use_upload_file')) checked @endif/>
                    <label for="useUploadFile_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_upload_file" id="useUploadFile_0" class="form-check-input" value="0" @if(!($boardMetaData->use_upload_file ?? old('use_upload_file'))) checked @endif/>
                    <label for="useUploadFile_0" class="form-check-label">아니오</label>
                </div>
                <span class="form-text text-muted">

                </span>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[use_upload_file]" id="grpUseUploadFile" class="form-check-input" value="1" />
                    <label for="grpUseUploadFile" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[use_upload_file]" id="allUseUploadFile" class="form-check-input" value="1" />
                    <label for="allUseUploadFile" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="uploadFileNum" class="col-sm-2 col-form-label">첨부파일 개수 제한</label>
            <div class="col-sm-8">
                <input type="text" name="upload_file_num" id="uploadFileNum" class="form-control only-digits-input d-inline w-auto" value="{{ $boardMetaData->upload_file_num ?? old('upload_file_num') }}" /> 개 이하로 첨부가능
                <div class="form-text text-muted">
                    최대 10개까지 첨부 가능
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[upload_file_num]" id="grpUploadFileNum" class="form-check-input" value="1" />
                    <label for="grpUploadFileNum" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[upload_file_num]" id="allUploadFileNum" class="form-check-input" value="1" />
                    <label for="allUploadFileNum" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="uploadFileMaxSize" class="col-sm-2 col-form-label">첨부파일 용량 제한</label>
            <div class="col-sm-8">
                <input type="text" name="upload_file_max_size" id="uploadFileMaxSize" class="form-control only-digits-input d-inline w-auto" value="{{ $boardMetaData->upload_file_max_size ?? old('upload_file_max_size') }}" /> MB
                <div class="form-text text-muted">
                    최대 {{ ini_get('upload_max_filesize') }} 까지 파일 첨부 가능, post_max_size: {{ ini_get('post_max_size') }}
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[upload_file_max_size]" id="grpUploadFileMaxSize" class="form-check-input" value="1" />
                    <label for="grpUploadFileMaxSize" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[upload_file_max_size]" id="allUploadFileMaxSize" class="form-check-input" value="1" />
                    <label for="allUploadFileMaxSize" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="uploadOnlyImgFile_1" class="col-sm-2">첨부파일 이미지 전용</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="upload_only_img_file" id="uploadOnlyImgFile_1" class="form-check-input" value="1" @if($boardMetaData->upload_only_img_file ?? old('upload_only_img_file')) checked @endif/>
                    <label for="uploadOnlyImgFile_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="upload_only_img_file" id="uploadOnlyImgFile_0" class="form-check-input" value="0" @if(!($boardMetaData->upload_only_img_file ?? old('upload_only_img_file'))) checked @endif/>
                    <label for="uploadOnlyImgFile_0" class="form-check-label">아니오</label>
                </div>
                <div class="form-text text-muted">
                    gif, jpg, jpeg, png 확장자만 첨부 가능합니다.
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[upload_only_img_file]" id="grpUploadOnlyImgFile" class="form-check-input" value="1" />
                    <label for="grpUploadOnlyImgFile" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[upload_only_img_file]" id="allUploadOnlyImgFile" class="form-check-input" value="1" />
                    <label for="allUploadOnlyImgFile" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row">
            <label for="uploadFileExtension" class="col-sm-2 col-form-label">첨부파일 허용 확장자</label>
            <div class="col-sm-8">
                <input type="text" name="upload_file_extension" id="uploadFileExtension" class="form-control" value="{{ $boardMetaData->upload_file_extension ?? old('upload_file_extension') }}" />
                <div class="form-text text-muted">
                    HTML5 File 속성 사용, `|` 로 구분하여 입력, 입력하지 않으면 확장자 제한없이 첨부 가능
                    <br/><a href="//www.w3schools.com/tags/att_input_accept.asp" target="_blank">[FILE 속성 참고]</a><br/>
                    <pre>&lt;input accept="<em>file_extension</em>|audio/*|video/*|image/*|<i>media_type</i>"&gt;</pre>
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[upload_file_extension]" id="grpUploadFileExtension" class="form-check-input" value="1" />
                    <label for="grpUploadFileExtension" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[upload_file_extension]" id="allUploadFileExtension" class="form-check-input" value="1" />
                    <label for="allUploadFileExtension" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="useOnlyOnePost_1" class="col-sm-2">하루에 한 글만 작성</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_only_one_post" id="useOnlyOnePost_1" class="form-check-input" value="1" @if($boardMetaData->use_only_one_post ?? old('use_only_one_post')) checked @endif/>
                    <label for="useOnlyOnePost_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_only_one_post" id="useOnlyOnePost_0" class="form-check-input" value="0" @if(!($boardMetaData->use_only_one_post ?? old('use_only_one_post'))) checked @endif/>
                    <label for="useOnlyOnePost_0" class="form-check-label">아니오</label>
                </div>
                <div class="form-text text-muted">
                    출석 게시판 처럼 사용이 가능하도록 하루에 글은 한개만 작성이 가능합니다. *로그인 사용자에 적용됩니다.
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[use_only_one_post]" id="grpUseOnlyOnePost" class="form-check-input" value="1" />
                    <label for="grpUseOnlyOnePost" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[use_only_one_post]" id="allUseOnlyOnePost" class="form-check-input" value="1" />
                    <label for="allUseOnlyOnePost" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="usePostCaptcha_1" class="col-sm-2">Captcha 사용</label>
            <div class="col-sm-8">
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_post_captcha" id="usePostCaptcha_1" class="form-check-input" value="1" @if($boardMetaData->use_post_captcha ?? old('use_post_captcha')) checked @endif/>
                    <label for="usePostCaptcha_1" class="form-check-label">예</label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="radio" name="use_post_captcha" id="usePostCaptcha_0" class="form-check-input" value="0" @if(!($boardMetaData->use_post_captcha ?? old('use_post_captcha'))) checked @endif/>
                    <label for="usePostCaptcha_0" class="form-check-label">아니오</label>
                </div>
                <div class="form-text text-muted">
                    글 작성 시 Captcha를 사용합니다.
                </div>
            </div>
            <div class="col-sm-2">
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="grp[use_post_captcha]" id="grpUsePostCaptcha" class="form-check-input" value="1" />
                    <label for="grpUsePostCaptcha" class="form-check-label">
                        그룹적용
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input type="checkbox" name="all[use_post_captcha]" id="allUsePostCaptcha" class="form-check-input" value="1" />
                    <label for="allUsePostCaptcha" class="form-check-label">
                        전체적용
                    </label>
                </div>
            </div>
        </div>
        <hr/>
        <div class="text-end">
            <button type="submit" class="btn btn-success">저장하기</button>
            <button type="button" class="btn btn-light btn-write-cancel" value="{{ route('admin.board.board.list.index') }}">취소하기</button>
        </div>
    </form>
</div>

<script type="module">
$("#fAdminWrite").validate({
    rules: {
        write_header_content: {'required_tinymce': false},
        mobile_write_header_content: {'required_tinymce': false},
        post_default_subject: {required: false, maxlength: 255},
        post_default_content: {required: false, maxlength: 4000},
        use_post_dhtml: {required: true, number: true},
        save_external_image: {required: true, number: true},
        post_subject_min_length: {required: true, number: true, min: 0},
        post_subject_max_length: {required: true, number: true, max: 255},
        post_content_min_length: {required: true, number: true, min: 0},
        post_content_max_length: {required: true, number: true, max: 4000},
        use_category_required: {required: false, number: true},
        use_post_secret: {required: false, number: true},
        use_post_secret_selected: {required: true, number: true},
        use_post_tag: {required: true},
        link_num: {required: true, number: true, max: 10},
        use_upload_file: {required: true, number: true},
        upload_file_num: {required: true, number: true, max: 10},
        upload_file_max_size: {required: true, number: true},
        upload_only_img_file: {required: true, number: true},
        upload_file_extension: {maxlength: 255},
        use_only_one_post: {required: true, number: true},
        use_post_captcha: {required: true, number: true}
    }
});
</script>
@endsection
