@model CodingWiki_Model.Models.Publisher
@{
    var title = "Create Publisher";
}
<form method="post">
    <div class="row p-3 border">
        <div asp-validation-summary="ModelOnly" class="text-danger"></div>
        <input type="hidden" asp-for="Publisher_Id" />
        @if (Model.Publisher_Id != 0)
        {
            //edit
            title = "Edit Publisher";
        }
        <div class="col-12 border-bottom">
            <h2 class="text-primary">@title</h2>
        </div>
        <div class="col-8 pt-4">
            <div class="form-group row py-2">
                <div class="col-4">
                    <label asp-for="Name"></label>
                </div>
                <div class="col-8">
                    <input asp-for="Name" class="form-control" />
                    <span asp-validation-for="Name" class="text-danger"></span>
                </div>
            </div>
            <div class="form-group row py-2">
                <div class="col-4">
                    <label asp-for="Location"></label>
                </div>
                <div class="col-8">
                    <input asp-for="Location" class="form-control" />
                    <span asp-validation-for="Location" class="text-danger"></span>
                </div>
            </div>
            <div class="form-group row py-2">
                <div class="col-4 offset-4">
                    @if (Model.Publisher_Id != 0)
                    {
                        <button type="submit" class="btn btn-primary form-control">Update</button>
                    }
                    else
                    {
                        <button type="submit" class="btn btn-primary form-control">Create</button>
                    }
                </div>
                <div class="col-4">
                    <a asp-action="Index" class="btn btn-success form-control">Back to List</a>
                </div>
            </div>
        </div>
    </div>
</form>

@section Scripts{
    <partial name="_ValidationScriptsPartial" />
}