@using PantheonRA.BackOffice.Models;
@using PantheonRA.WebApi.Contracts.Enums
@model Dictionary<string, bool>
@{
    var isCalendar = Model["IsOrderCalendar"];
    var calendarUrl = Model["IsIndexView"] ? Url.Action("CreateBuyerOrder", "Order", new { calendarTab = true }) : "#";
}

@Html.Partial("~/Views/Shared/_TabNavigation.cshtml", new TabNavigationViewModel
{
    Tabs = new List<NavigationtabViewModel>
    {
        new NavigationtabViewModel(Loc.NewOrdersBuyer, Url.Action("CreateBuyerOrder", "Order"),
            Html.IsActive("CreateBuyerOrder", "Order") || Html.IsActive("EditBuyerOrder", "Order"),
            !PantheonRA.BackOffice.CurrentUser.CanAccess(PantheonRA.WebApi.Contracts.Enums.Permissions.PAW_ORDERS_BUYER)),

        new NavigationtabViewModel(Loc.Calendar, calendarUrl,
        Html.IsActive("GetOrdersByDate", "Order"),
        (!PantheonRA.BackOffice.CurrentUser.CanAccess(PantheonRA.WebApi.Contracts.Enums.Permissions.PAW_ORDERS_BUYER) || !isCalendar)),

        new NavigationtabViewModel(Loc.OrdersBuyersList, Url.Action("BuyerOrdersReport", "Order"),
        Html.IsActive("BuyerOrdersReport", "Order"),
        !PantheonRA.BackOffice.CurrentUser.CanAccess(PantheonRA.WebApi.Contracts.Enums.Permissions.PAW_ORDERS_BUYER)),
    }
})
