@extends('admin.layouts.app')

@section('content')
<div class="container-fluid">
    <h2>메타 태그</h2>
    <hr/>
    @include('admin.messages')
    @include('admin.config.layout.navTabs')

    <form name="f_admin_write" id="fAdminWrite" action="{{ route('admin.config.layout.meta.store') }}" method="post" enctype="multipart/form-data">
        @csrf
        <div class="alert alert-dismissible alert-primary">
            SEO 검색엔진 최적화에 필요한 메타 태그를 지정 합니다.<br/>
            <a href="https://developer.mozilla.org/ko/docs/Web/HTML/Element/meta/name" target="_blank">
                https://developer.mozilla.org/ko/docs/Web/HTML/Element/meta/name
            </a>
        </div>
        <div class="row mb-3">
            <label for="metaKeywords" class="col-sm-2 col-form-label">Meta keywords</label>
            <div class="col-sm-10">
                <input type="text" name="meta_keywords" id="metaKeywords" class="form-control" value="{{ config('meta_keywords') }}" />
                <div class="form-text text-muted">
                    검색엔진 키워드
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="metaDescription" class="col-sm-2 col-form-label">Meta description</label>
            <div class="col-sm-10">
                <input type="text" name="meta_description" id="metaDescription" class="form-control" value="{{ config('meta_description') }}" />
                <div class="form-text text-muted">
                    사이트 설명
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="metaAuthor" class="col-sm-2 col-form-label">Meta author</label>
            <div class="col-sm-10">
                <input type="text" name="meta_author" id="metaAuthor" class="form-control" value="{{ config('meta_author') }}" />
                <div class="form-text text-muted">
                    사이트 제작자
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="metaViewport" class="col-sm-2 col-form-label">Meta viewport</label>
            <div class="col-sm-10">
                <input type="text" name="meta_viewport" id="metaViewport" class="form-control" value="{{ config('meta_viewport') }}" />
                <div class="form-text text-muted">
                    페이지 크기와 비율 지정
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="metaApplicationName" class="col-sm-2 col-form-label">Meta Application Name</label>
            <div class="col-sm-10">
                <input type="text" name="meta_application_name" id="metaApplicationName" class="form-control" value="{{ config('meta_application_name') }}" />
                <div class="form-text text-muted">
                    웹 프로그램 이름
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="metaGenerator" class="col-sm-2 col-form-label">Meta Generator</label>
            <div class="col-sm-10">
                <input type="text" name="meta_generator" id="metaGenerator" class="form-control" value="{{ config('meta_generator') }}" />
                <div class="form-text text-muted">
                    문서 작성에 사용한 저작 도구를 지정, 저작자가 저작 도구를 사용하지 않고 직접 작성한 때에는 이 속성값을 사용하지 않음
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="metaRobots" class="col-sm-2 col-form-label">Meta Robots</label>
            <div class="col-sm-10">
                <input type="text" name="meta_robots" id="metaRobots" class="form-control" value="{{ config('meta_robots') }}" />
                <div class="form-text text-muted">
                    협조적인 크롤러, 또는 "로봇"의 동작을 지정
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="metaAddsInfo" class="col-sm-2 col-form-label">Meta Adds Info</label>
            <div class="col-sm-10">
                <textarea name="meta_adds_info" id="metaAddsInfo" class="form-control" rows="5">{{ config('meta_adds_info') }}</textarea>
                <div class="form-text text-muted">
                    직접 추가할 메타 태그를 입력 합니다.
                </div>
            </div>
        </div>
        <hr/>
        <div class="text-end">
            <button type="submit" class="btn btn-success">저장하기</button>
        </div>
    </form>
</div>

<script type="module">
$("#fAdminWrite").validate({
    rules: {
        meta_keywords: {maxlength: 500},
        meta_description: {maxlength: 500},
        meta_author: {maxlength: 500},
        meta_viewport: {maxlength: 500},
        meta_application_name: {maxlength: 500},
        meta_generator: {maxlength: 500},
        meta_robots: {maxlength: 500},
        meta_adds_info: {maxlength: 2000}
    }
});
</script>

@endsection
