Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

1.0 KB
Raw Blame
@using System.Text.Json
@using Grand.Infrastructure.Configuration
@model string[]
@inject AccessControlConfig AccessControlConfig
@{
    var area = ViewContext.RouteData.Values["area"]?.ToString();
    var warnings = true;
    if (ViewData["DisableIgnoreStoreWarnings"] != null)
    {
        warnings = !(bool)ViewData["DisableIgnoreStoreWarnings"];
    }
    //GrandAdmin.select (adminapp/src/ui/select.js, Tom Select) in place of the Kendo
    //MultiSelect: this list box keeps its name, so the form posts what it posted before
    var options = JsonSerializer.Serialize(new {
        mode = "multiple",
        url = Url.Action("Stores", "Search", new { area, stores = Model }),
        textField = "Name",
        valueField = "Id",
        filter = "startswith",
        values = Model ?? []
    });
}
@Html.ListBoxFor(model => model, new List<SelectListItem>(), new { data_grand_select = options })

@if (AccessControlConfig.IgnoreStoreLimitations && warnings)
{
    <div class="note note-info">@Loc["Admin.System.Warnings.IgnoreStoreLimitations"]</div>
}