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

@Html.Partial("~/Views/Shared/_TabNavigation.cshtml", new TabNavigationViewModel {
    Tabs = new List<NavigationtabViewModel>
    {
        new NavigationtabViewModel(Loc.Documents, Url.Action("Index", "Documents"),
            Html.IsActive("Index", "Documents") || Html.IsActive("Create", "Documents") || Html.IsActive("Edit", "Documents") ||
            Html.IsActive("RunWorkflow", "Documents"),
            (PantheonRA.BackOffice.CurrentUser.HasGranules() && !PantheonRA.BackOffice.CurrentUser.HasGranule(Granules.DocumentsTasksGranule)) ||
            !PantheonRA.BackOffice.CurrentUser.CanAccess(PantheonRA.WebApi.Contracts.Enums.Permissions.DOCUMENTS)),
        new NavigationtabViewModel(Loc.Tasks, Url.Action("Index", "Task"), Html.IsActive("Index", "Task") || Html.IsActive("Edit", "Task"),
            (PantheonRA.BackOffice.CurrentUser.HasGranules() && !PantheonRA.BackOffice.CurrentUser.HasGranule(Granules.DocumentsTasksGranule)) || 
            !PantheonRA.BackOffice.CurrentUser.CanAccess(PantheonRA.WebApi.Contracts.Enums.Permissions.TASKS))
    }
})
