@page "/admin/announcements/{id:int}/edit"
@model TaxBaik.Web.Pages.Admin.Announcements.EditModel
@{ ViewData["Title"] = "공지사항 수정"; }

<section class="admin-page-shell">
    @await Html.PartialAsync("_AdminPageHeader", new TaxBaik.Web.Models.AdminPageHeaderModel("Content", "공지사항 수정", "기존 공지사항을 Tabler 표준 폼으로 수정합니다.", null, null))

    <form method="post" class="card">
        <div class="card-header d-flex flex-wrap align-items-center justify-content-between gap-2">
            <div>
                <div class="text-muted small text-uppercase mb-1">불러온 원본</div>
                <div class="fw-semibold">@Model.Input.Title</div>
                <div class="text-muted small">유형: @Model.Input.DisplayType</div>
            </div>
            <span class="badge bg-secondary-lt text-secondary">원본 확인 후 수정</span>
        </div>
        <div class="card-body">
            @await Html.PartialAsync("_ValidationSummary")
            <input type="hidden" asp-for="Input.Id" />
            <div class="row g-3">
                <div class="col-lg-8">
                    <label asp-for="Input.Title" class="form-label"></label>
                    <input asp-for="Input.Title" class="form-control" />
                    <span asp-validation-for="Input.Title" class="text-danger small"></span>
                </div>
                <div class="col-lg-4">
                    <label asp-for="Input.DisplayType" class="form-label"></label>
                    <select asp-for="Input.DisplayType" class="form-select">
                        <option value="info">info</option>
                        <option value="success">success</option>
                        <option value="warning">warning</option>
                        <option value="danger">danger</option>
                    </select>
                </div>
                <div class="col-12">
                    <label asp-for="Input.Content" class="form-label"></label>
                    <textarea asp-for="Input.Content" class="form-control" rows="8"></textarea>
                    <span asp-validation-for="Input.Content" class="text-danger small"></span>
                </div>
                <div class="col-md-4">
                    <label asp-for="Input.SortOrder" class="form-label"></label>
                    <input asp-for="Input.SortOrder" class="form-control" type="number" />
                </div>
                <div class="col-md-4">
                    <label asp-for="Input.StartsAt" class="form-label"></label>
                    <input asp-for="Input.StartsAt" class="form-control" type="datetime-local" />
                </div>
                <div class="col-md-4">
                    <label asp-for="Input.EndsAt" class="form-label"></label>
                    <input asp-for="Input.EndsAt" class="form-control" type="datetime-local" />
                </div>
                <div class="col-12">
                    <label class="form-check">
                        <input asp-for="Input.IsActive" class="form-check-input" type="checkbox" />
                        <span class="form-check-label">활성</span>
                    </label>
                </div>
            </div>
        </div>
        <div class="card-footer d-flex justify-content-between gap-2">
            <div class="d-flex gap-2">
                <button class="btn btn-outline-danger" type="submit" formaction="?handler=Delete" formmethod="post" onclick="return confirm('정말 삭제하시겠습니까?');">삭제</button>
                <a class="btn btn-outline-secondary" href="/admin/announcements">취소</a>
                <button class="btn btn-primary" type="submit">저장</button>
            </div>
        </div>
    </form>
</section>









