@model iyixiGames.Domain.DTOs.Sites.CreateSiteRequest

@{
    ViewData["Title"] = "创建新网站";
}

<div class="container mt-4">
    <h1>创建新网站</h1>
    <hr />
    <div class="row">
        <div class="col-md-8">
            <form asp-action="Create">
                <div asp-validation-summary="ModelOnly" class="text-danger"></div>

                <div class="mb-3">
                    <label asp-for="Name" class="form-label">网站名称</label>
                    <input asp-for="Name" class="form-control" />
                    <span asp-validation-for="Name" class="text-danger"></span>
                </div>
                <div class="mb-3">
                    <label asp-for="Domain" class="form-label">网站域名</label>
                    <input asp-for="Domain" class="form-control" placeholder="例如: https://game-pixel.fun" />
                    <span asp-validation-for="Domain" class="text-danger"></span>
                </div>
                <div class="mb-3">
                    <label asp-for="OwnerUserId" class="form-label">所有者用户ID</label>
                    <input asp-for="OwnerUserId" class="form-control" />
                    <span asp-validation-for="OwnerUserId" class="text-danger"></span>
                </div>

                <div class="card mb-3">
                    <div class="card-header">SEO 信息 (可选)</div>
                    <div class="card-body">
                        <div class="mb-3">
                            <label asp-for="Seo.Description" class="form-label">描述</label>
                            <textarea asp-for="Seo.Description" class="form-control" rows="3"></textarea>
                            <span asp-validation-for="Seo.Description" class="text-danger"></span>
                        </div>
                        <div class="mb-3">
                            <label asp-for="Seo.Keywords" class="form-label">关键词 (逗号分隔)</label>
                            <input asp-for="Seo.Keywords" class="form-control" />
                            <span asp-validation-for="Seo.Keywords" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="card mb-3">
                    <div class="card-header">网站设置 (可选)</div>
                    <div class="card-body">
                        <div class="mb-3">
                            <label asp-for="Settings.Theme" class="form-label">主题</label>
                            <select asp-for="Settings.Theme" class="form-select">
                                <option value="light">Light</option>
                                <option value="dark">Dark</option>
                            </select>
                            <span asp-validation-for="Settings.Theme" class="text-danger"></span>
                        </div>
                        <div class="mb-3">
                            <label asp-for="Settings.Language" class="form-label">语言</label>
                            <input asp-for="Settings.Language" class="form-control" />
                            <span asp-validation-for="Settings.Language" class="text-danger"></span>
                        </div>
                        <div class="form-check mb-3">
                            <input class="form-check-input" type="checkbox" asp-for="Settings.AdEnabled" />
                            <label class="form-check-label" asp-for="Settings.AdEnabled">启用广告</label>
                            <span asp-validation-for="Settings.AdEnabled" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="mb-3">
                    <button type="submit" class="btn btn-primary">创建</button>
                    <a asp-action="Index" class="btn btn-secondary ms-2">取消并返回</a>
                </div>
            </form>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}