@model CollectionModel
@inject Grand.Business.Core.Interfaces.Common.Security.IPermissionService permissionService
@{
    //has "Manage Documents" permission?
    var canManageDocuments = await permissionService.Authorize(Grand.Business.Core.Utilities.Common.Security.StandardPermission.ManageDocuments);
}
<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />
<admin-tabstrip name="collection-edit" BindGrid="true">
    <items>
        <tabstrip-item text="@Loc["Admin.Catalog.Collections.Info"]" tab-index="0">
            <content>
                <div>
                    <partial name="Partials/CreateOrUpdate.TabInfo" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@Loc["Admin.Common.SEO"]" tab-index="1">
            <content>
                <div>
                    <partial name="Partials/CreateOrUpdate.TabSeo" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@Loc["Admin.Catalog.Collections.Products"]" tab-index="2">
            <content>
                <div>
                    <partial name="Partials/CreateOrUpdate.TabProducts" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@Loc["Admin.Catalog.Collections.Discounts"]" tab-index="3">
            <content>
                <div>
                    <partial name="Partials/CreateOrUpdate.TabDiscounts" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        @if (canManageDocuments)
        {
            <tabstrip-item text="@Loc["Admin.Catalog.Collections.Documents"]" tab-index="4">
                <content>
                    <div>
                        <partial name="Partials/CreateOrUpdate.TabDocuments" model="Model" />
                    </div>
                </content>
            </tabstrip-item>
        }
        <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="5">
            <content>
                <div>
                    <partial name="Partials/UserFields" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@Loc["Admin.Catalog.Collections.ActivityLog"]" tab-index="6">
            <content>
                <div>
                    <partial name="Partials/CreateOrUpdate.TabActivityLog" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <vc:admin-widget widget-zone="collection_details_tabs" additional-data="Model" />
    </items>
</admin-tabstrip>
