@using Microsoft.AspNetCore.Builder
@using Microsoft.Extensions.Options

@model IEnumerable<Category>
@inject IOptions<RequestLocalizationOptions> LocOptions

@{
    var cultures = LocOptions.Value.SupportedUICultures
        .Skip(1)
        .Select(culture => new { Culture = culture.Name, Name = culture.EnglishName })
        .ToArray();
}

<h2>Global categories</h2>

<table class="table">
    <thead>
        <tr>
            <th>Default name</th>
            @foreach (var culture in cultures)
            {
                <th>@culture.Name translate</th>
            }
        </tr>
    </thead>
    <tbody>
        @foreach (var category in Model)
        {
            <tr>
                <td>
                    @category.Name
                    <div class="input-group colorpicker colorpicker-component" data-id="@category.Id">
                        <input type="text" value="name" class="form-control" />
                        <input type="hidden" value="#@category.Color.ToString("X6")" />
                        <span class="input-group-addon"><i></i></span>
                    </div>
                </td>
                @foreach (var culture in cultures)
                {
                    var locName = category.Localizations.SingleOrDefault(loc => loc.Culture == culture.Culture);
                    if (locName != null)
                    {
                        <td>@locName.Name</td>
                    }
                    else
                    {
                        <td class="empty">@category.Name</td>
                    }
                }
            </tr>
        }
    </tbody>
</table>
@using Microsoft.AspNetCore.Builder
@using Microsoft.Extensions.Options

@model IEnumerable<Category>
@inject IOptions<RequestLocalizationOptions> LocOptions

@{
    var cultures = LocOptions.Value.SupportedUICultures
        .Skip(1)
        .Select(culture => new { Culture = culture.Name, Name = culture.EnglishName })
        .ToArray();
}

<h2>Global categories</h2>

<table class="table">
    <thead>
        <tr>
            <th class="fit"></th>
            <th>Default name</th>
            @foreach (var culture in cultures)
            {
                <th>@culture.Name translate</th>
            }
        </tr>
    </thead>
    <tbody>
        @foreach (var category in Model)
        {
            <tr>
                <td>
                    <span class="label category-color" style="background-color: #@(category.Color.ToString("X6"))">&nbsp;</span>
                </td>
                <td>
                    @category.Name
                </td>
                @foreach (var culture in cultures)
                {
                    var locName = category.Localizations.SingleOrDefault(loc => loc.Culture == culture.Culture);
                    if (locName != null)
                    {
                        <td>@locName.Name</td>
                    }
                    else
                    {
                        <td class="empty">@category.Name</td>
                    }
                }
            </tr>
        }
    </tbody>
</table>
Make global categories colors are display only
Make global categories colors are display only
