ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Areas/Admin/Views/ReturnRequest/_CreateOrUpdate.cshtml
@model ReturnRequestModel
@inject AdminAreaSettings adminAreaSettings
@inject OrderSettings orderSettings
@inject Grand.Services.Security.IPermissionService permissionService
@{
    //has "Manage Documents" permission?
    var canManageDocuments = await permissionService.Authorize(Grand.Services.Security.StandardPermissionProvider.ManageDocuments);
    //has "Manage Generic attributes" permission?
    var canManageGenericAttributes = await permissionService.Authorize(Grand.Services.Security.StandardPermissionProvider.ManageGenericAttributes);
}
<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />
<admin-tabstrip name="returnrequest-edit">
    <items>
        <tabstrip-item text="@T("Admin.ReturnRequests.Info")" tab-index="0">
            <content>
                <div>
                    <partial name="_CreateOrUpdate.TabInfo" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        @if (orderSettings.ReturnRequests_AllowToSpecifyPickupAddress)
        {
            <tabstrip-item text="@T("Admin.ReturnRequests.Address")" tab-index="1">
                <content>
                    <div>
                        <partial name="_CreateOrUpdate.TabAddress" model="Model" />
                    </div>
                </content>
            </tabstrip-item>
        }
        @if (canManageDocuments)
        {
            <tabstrip-item text="@T("Admin.ReturnRequests.Documents")" tab-index="2">
                <content>
                    <div>
                        <partial name="_CreateOrUpdate.TabDocuments" model="Model" />
                    </div>
                </content>
            </tabstrip-item>
        }
        <tabstrip-item text="@T("Admin.ReturnRequests.ReturnRequestNotes")" tab-index="3">
            <content>
                <div>
                    <partial name="_ReturnRequestNotes" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        @if (canManageGenericAttributes)
        {
            <tabstrip-item text="@T("Admin.Common.GenericAttributes.Tab")" tab-index="4">
                <content>
                    <div>
                        <div class="form-horizontal">
                            @{
                                ViewData["ObjectType"] = "ReturnRequest";
                                ViewData["TabIndex"] = 4;
                            }
                            <partial name="_GenericAttributes" model="Model" view-data="ViewData" />
                        </div>
                    </div>
                </content>
            </tabstrip-item>
        }
        <vc:admin-widget widget-zone="returnrequest_details_tabs" additional-data="Model" />
    </items>
</admin-tabstrip>