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

@{ 
    var basicDataUrl = "#";
    if(Html.IsActive("Index", "Employees"))
    {
        basicDataUrl = Url.Action("Create", "Employees");
    }
}

@Html.Partial("~/Views/Shared/_TabNavigation.cshtml", new TabNavigationViewModel {
    Tabs = new List<NavigationtabViewModel>
    {       
        new NavigationtabViewModel(Loc.EmployeesList, Url.Action("Index", "Employees"),
            Html.IsActive("Index", "Employees"),
            !CurrentUser.CanAccess(Permissions.EMPLOYEES) && !CurrentUser.CanAccess(Permissions.EMPLOYEES_OWN_DATA)),

        new NavigationtabViewModel(Loc.BasicData, basicDataUrl,
            Html.IsActive("Create", "Employees") || Html.IsActive("Edit", "Employees"),
            Html.IsActive("Index", "Employees") && !CurrentUser.CanAccess(Permissions.EMPLOYEES) && CurrentUser.CanAccess(Permissions.EMPLOYEES_OWN_DATA)),

        //TODO: Uncomment when this is included
        //new NavigationtabViewModel(Loc.PaySlips, Url.Action("Salary", "Employees"), Html.IsActive("Salary", "Employees"),
        //    !PantheonRA.BackOffice.CurrentUser.CanAccess(PantheonRA.WebApi.Contracts.Enums.Permissions.EMPLOYEES_PAYCHECK))
    }
})
