@{
    ViewData["Title"] = "Shop addons";
}

@model EditProductCategoryIndexModel

<partial name="_TempDataPartial" />

<div class="container-fluid">
    <div class="d-sm-flex align-items-center justify-content-between mb-4">
        <h1 class="h3 mb-0 text-gray-800">Shop Center - Edit product category</h1>
    </div>
    <hr />

    <div class="d-sm-flex align-items-center justify-content-between mb-4">
        <h1 class="h5 mb-0 text-gray-800">Edit product category - please select category name and edit it</h1>
    </div>
    <div class="row">
        <div class="col-xl-12 col-md-12 mb-4">
            <select class="form-control" onchange="selectedName(this)">
                <option value="" disabled selected>Select Category...</option>
                @foreach (var name in Model.AllCategoriesNames)
                {
                    <option value=@name>@name</option>
                }
            </select>
        </div>
    </div>
    <hr />

    <form method="post" enctype="multipart/form-data" id="contentForm" style="display: none">
        <div class="row">
            <div class="col-xl-12 col-md-12 mb-4">
                <label asp-for="@Model.InputModel.Title"></label>
                <input asp-for="@Model.InputModel.Title" class="form-control" placeholder="Name" id="categoryTitle" />
                <span asp-validation-for="@Model.InputModel.Title" class="text-danger"></span>
            </div>
            <div class="col-xl-12 col-md-12 mb-4">
                <label asp-for="@Model.InputModel.Description"></label>
                <textarea asp-for="@Model.InputModel.Description" class="form-control edit-with-tinymce" id="categoryDescription"></textarea>
                <span asp-validation-for="@Model.InputModel.Description" class="text-danger"></span>
            </div>
            <input asp-for="@Model.InputModel.Id" id="categoryId" type="hidden" />
            <div class="col-xl-3 col-md-6 mb-4">
                <button asp-area="Administration" asp-controller="Shop" asp-action="EditProductCategory" class="btn btn-success btn-icon-split">
                    <span class="icon text-white-50">
                        <i class="fas fa-edit"></i>
                    </span>
                    <span class="text">Edit Category</span>
                </button>
            </div>
        </div>
    </form>
    <hr />
    <input type="hidden" />
</div>
@section Scripts {
    <partial name="_ValidationScriptsPartial" />
    <script src="~/lib/tinymce/tinymce.min.js" type="text/javascript"></script>
    <script src="~/lib/tinymce/visualizer.js" type="text/javascript"></script>
    <script src="~/administration/js/editProductCategory.js"></script>
}