@using PantheonRA.BackOffice;
@using PantheonRA.BackOffice.Models;
@using PAW.Contracts.Enums;
@using PantheonRA.WebApi.Contracts.Enums

@Html.Partial("~/Views/Shared/_TabNavigation.cshtml", new TabNavigationViewModel
{
    Tabs = new List<NavigationtabViewModel>
    {
        new NavigationtabViewModel(Loc.Company, Url.Action("Index", "Company"),
            Html.IsActive("Index", "Company") || Html.IsActive("Upload", "Certificate") || Html.IsActive("Index", "Certificate"),
            PantheonRA.BackOffice.CurrentUser.HasGranules() || !PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.SETTINGS)),
         new NavigationtabViewModel(CurrentUser.Localization == Localization.Code.ME ? Loc.ListENU : Loc.CompanyUnitsShort, Url.Action("Index", "CompanyUnits"),
            Html.IsActive("Index", "CompanyUnits") || Html.IsActive("Create", "CompanyUnits") || Html.IsActive("Edit", "CompanyUnits"),
            PantheonRA.BackOffice.CurrentUser.HasGranules() || (!PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.SETTINGS) ||
            Localization.IsInFiscalPrinterLocalization(PantheonRA.BackOffice.CurrentUser.DatabaseLocalization, PantheonRA.BackOffice.CurrentUser.IsInServerFiscalization) ||
            PantheonRA.BackOffice.CurrentUser.IsDemo  || PantheonRA.BackOffice.CurrentUser.Localization == Localization.Code.RS)),
         new NavigationtabViewModel(Loc.DocumentType, Url.Action("Index", "DocumentType"),
            Html.IsActive("Index", "DocumentType") || Html.IsActive("Create", "DocumentType") || Html.IsActive("Edit", "DocumentType"),
            PantheonRA.BackOffice.CurrentUser.HasGranules()
            || !PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.SETTINGS)),
          new NavigationtabViewModel(Loc.FiscalPrinters, Url.Action("Index", "FiscalDevice"),
            Html.IsActive("Index", "FiscalDevice") || Html.IsActive("Create", "FiscalDevice") || Html.IsActive("Edit", "FiscalDevice"),
            PantheonRA.BackOffice.CurrentUser.HasGranules() ||
            !Localization.IsInFiscalPrinterLocalization(PantheonRA.BackOffice.CurrentUser.DatabaseLocalization, PantheonRA.BackOffice.CurrentUser.IsInServerFiscalization)),
         new NavigationtabViewModel(Loc.Retail, Url.Action("CashRegisterSettings", "Settings"), Html.IsActive("CashRegisterSettings", "Settings"),
            PantheonRA.BackOffice.CurrentUser.HasGranules() || !PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.SETTINGS)),
         new NavigationtabViewModel(Loc.Wholesale, Url.Action("WholesaleSettings", "Settings"), Html.IsActive("WholesaleSettings", "Settings"),
            PantheonRA.BackOffice.CurrentUser.HasGranules() || !PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.SETTINGS)),
         new NavigationtabViewModel(Loc.SetWhTabName, Url.Action("Index", "SetCalendarEntryTypeGroups"),
            Html.IsActive("Index", "SetWorkHours")
             || Html.IsActive("Create", "SetWorkHours") || Html.IsActive("Edit", "SetWorkHours")
             || Html.IsActive("Index", "SetCalendarEntryTypes") || Html.IsActive("Index", "SetCalendarEntryTypeGroups"),
            PantheonRA.BackOffice.CurrentUser.HasGranules() || !PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.SETTINGS)),
         new NavigationtabViewModel(Loc.Documentation, Url.Action("Index", "Settings"), Html.IsActive("Index", "Settings")
            || Html.IsActive("Create", "Mailbox") || Html.IsActive("Edit", "Mailbox"),
            PantheonRA.BackOffice.CurrentUser.HasGranules() || !PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.SETTINGS)),
         new NavigationtabViewModel(Loc.Users, Url.Action("Index", "Users"),
            Html.IsActive("Index", "Users") || Html.IsActive("Create", "Users") || Html.IsActive("Edit", "Users"),
            PantheonRA.BackOffice.CurrentUser.HasGranules() || !PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.SETTINGS))
    }
})