Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

Index.cshtml

@model DashboardModel
@inject IPermissionService permissionService
@using Nop.Services.Security
@{
    //page title
    ViewBag.PageTitle = T("Admin.Dashboard").Text;

    var canManageOrders = await permissionService.AuthorizeAsync(StandardPermissionProvider.ManageOrders);
    var canManageCustomers = await permissionService.AuthorizeAsync(StandardPermissionProvider.ManageCustomers);
    var canManageProducts = await permissionService.AuthorizeAsync(StandardPermissionProvider.ManageProducts);
    var canManageReturnRequests = await permissionService.AuthorizeAsync(StandardPermissionProvider.ManageReturnRequests);

    //close configuration steps value
    const string closeCardAttributeName = "CloseConfigurationSteps";
    var closeConfigurationStepsCard = await genericAttributeService.GetAttributeAsync(await workContext.GetCurrentCustomerAsync(), closeCardAttributeName);

     //active menu item (system name)
    NopHtml.SetActiveMenuItemSystemName("Dashboard");
}




@T("Admin.Dashboard")

@if (!closeConfigurationStepsCard) {
@await Html.PartialAsync("_ConfigurationSteps")
} @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.DashboardTop, additionalData = Model }) @if (!Model.IsLoggedInAsVendor) {
@await Component.InvokeAsync(typeof(NopCommerceNewsViewComponent))
} @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.DashboardNewsAfter, additionalData = Model }) @if (!Model.IsLoggedInAsVendor && canManageOrders && canManageCustomers && canManageProducts && canManageReturnRequests) {
@await Component.InvokeAsync(typeof(CommonStatisticsViewComponent))
} @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.DashboardCommonstatisticsAfter, additionalData = Model }) @if (!Model.IsLoggedInAsVendor && (canManageOrders || canManageCustomers)) {
@if (!Model.IsLoggedInAsVendor && canManageOrders) {
@await Html.PartialAsync("_OrderStatistics")
} @if (!Model.IsLoggedInAsVendor && canManageCustomers) {
@await Html.PartialAsync("_CustomerStatistics")
}
} @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.DashboardCustomerorderchartsAfter, additionalData = Model }) @if (!Model.IsLoggedInAsVendor && canManageOrders) {
@await Html.PartialAsync("_OrderAverageReport")
@await Html.PartialAsync("_OrderIncompleteReport")
} @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.DashboardOrderreportsAfter, additionalData = Model }) @if (!Model.IsLoggedInAsVendor && (canManageOrders || canManageProducts)) {
@if (canManageOrders) {
@await Html.PartialAsync("_LatestOrders")
}
@if (canManageProducts) { @await Html.PartialAsync("_PopularSearchTermsReport") }
} @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.DashboardLatestordersSearchtermsAfter, additionalData = Model }) @if (canManageOrders) {
@await Html.PartialAsync("_BestsellersBriefReportByQuantity")
@await Html.PartialAsync("_BestsellersBriefReportByAmount")
} @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.DashboardBottom, additionalData = Model })