@page "{handler?}"
@model ZpcBulletinBoard.Pages.Boards.AddEditModel

@{
    ViewData["Title"] = "Edit board";
    Layout = "~/Pages/Layouts/_Layout.cshtml";
}

<!-- Editor -->

<h4 class="d-flex justify-content-between align-items-center w-100 font-weight-bold py-1 mb-4">
    <span>
        <span class="text-muted font-weight-light">Nalog /</span> 
        @if (Model.Board.IdBulletinBoard > 0)
        {
            <span>Urejanje</span>
        }
        else
        {
            <span>Vnos</span>
        }
    </span>
</h4>

<div class="row">
    <div class="col-md-4">
        <div class="card">
            <div class="card-body">
                <form method="post">
                    <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                    <input type="hidden" asp-for="Board.IdBulletinBoard" />
                    <input type="hidden" asp-for="Board.Guid" />
                    <div class="form-group">
                        <label asp-for="Board.Name" class="control-label"></label>
                        <input asp-for="Board.Name" class="form-control" />
                        <span asp-validation-for="Board.Name" class="text-danger"></span>
                    </div>
                    <div class="form-group">
                        <label asp-for="Board.Ratio" class="control-label"></label>
                        <select asp-for="Board.Ratio" class="form-control" asp-items="Html.GetEnumSelectList<Models.Editor.BulletinBoard.RatioEnum>()"></select>
                        <span asp-validation-for="Board.Ratio" class="text-danger"></span>
                    </div>
                    <div class="form-group">
                        <input type="submit" value="Save" class="btn btn-primary" />
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div asp-validation-summary="ModelOnly" class="text-danger"></div>


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

    <!-- Editor -->

    <script>

    </script>
}