@model bitforum.Models.Page.Document
@{
    ViewData["Title"] = "문서 수정";
}

<div class="container">
    <h3>@ViewData["Title"]</h3>
    <hr />

    <partial name="_StatusMessage" />
    <partial name="_Editor" />

    <form name="f_admin_write" id="fAdminWrite" method="post" accept-charset="utf-8" autocomplete="off" asp-controller="Document" asp-action="Update">
        <input type="hidden" asp-for="ID" />

      
        <div class="row mb-2">
            <label for="Code" class="col-sm-2 col-form-label">주소</label>
            <div class="col-sm-10">
                @ViewBag.siteURL /docs/ <input type="text" asp-for="Code" class="form-control d-inline w-auto" required />
                <span asp-validation-for="Code" class="text-danger"></span>
            </div>
        </div>
        <div class="row mb-2">
            <label for="Subject" class="col-sm-2 col-form-label">제목</label>
            <div class="col-sm-10">
                <input asp-for="Subject" class="form-control"/>
                <span asp-validation-for="Subject" class="text-danger" required></span>
            </div>
        </div>
        <div class="row mb-2">
            <label for="Content" class="col-sm-2 col-form-label">내용</label>
            <div class="col-sm-10">
                <textarea asp-for="Content" class="form-control ck-editor" required></textarea>
                <span asp-validation-for="Content" class="text-danger"></span>
            </div>
        </div>
        <div class="row mb-2">
            <label for="IsActive" class="col-sm-2 col-form-label">사용 여부</label>
            <div class="col-sm-10 align-content-center">
                <div class="form-check-inline">
                    <input type="checkbox" asp-for="IsActive" class="form-check-input" />
                    <label class="form-check-label" for="IsActive">
                        사용합니다.
                    </label>
                    <span asp-validation-for="IsActive" class="text-danger"></span>
                </div>
            </div>
        </div>
        @if (Model.UpdatedAt is not null)
        {
            <div class="row mb-2">
                <label class="col-sm-2 col-form-label">수정일시</label>
                <div class="col-sm-10">
                    <input asp-for="UpdatedAt" class="form-control-plaintext" type="text" readonly />
                </div>
            </div>
        }
        @if (Model.CreatedAt is not null)
        {
            <div class="row mb-2">
                <label class="col-sm-2 col-form-label">등록일시</label>
                <div class="col-sm-10">
                    <input asp-for="CreatedAt" class="form-control-plaintext" type="text" readonly />
                </div>
            </div>
        }
        <hr/>
        <div class="d-grid gap-2 text-center d-md-block">
            <button type="submit" class="btn btn-sm btn-success">저장</button>
            <a asp-action="Index" class="btn btn-sm btn-secondary">취소</a>
        </div>
        <br/>
    </form>
</div>