Exemplo n.º 1
0
        public async Task <IActionResult> GetMenuSections(Guid menuId)
        {
            PaginatedEntitiesResult <SidebarMenuSectionItemViewModel> entitiesResult = await this.adminMenuService.GetAllMenuSectionsAsync <SidebarMenuSectionItemViewModel>(menuId);

            AllEntitiesViewModel model = new AllEntitiesViewModel();

            model.SingleEntityName = "Sidebar Section";
            model.Title            = "Menu Sidebar Sections";
            this.ViewData[BreadcrumbPageTitlePlaceholder] = model.Title;

            List <TableRowActionViewModel> actions = new List <TableRowActionViewModel>();

            actions.Add(TableMapper.CreateAction("Link Items", MaterialDesignIcons.ViewList, Color.DarkSlateBlue, TableRowActionMethod.Get, $"/admin/system/navigation-menus/sidebar-menu-link-items/sections/{{0}}/link-items", "[Id]"));
            actions.Add(TableMapper.DetailsAction($"/admin/system/navigation-menus/sidebar-menu-section-items/{{0}}", "[Id]"));
            actions.Add(TableMapper.EditAction($"/admin/system/navigation-menus/sidebar-menu-section-items/{{0}}/edit", "[Id]"));
            actions.Add(TableMapper.DeleteAction($"/admin/system/navigation-menus/sidebar-menu-section-items/{{0}}/delete", "[Id]"));

            model.Table = TableMapper.DtoMapper <SidebarMenuSectionItemViewModel>(entitiesResult, actions.ToArray());
            model.Table.SetPaginationRedirection("Admin", this.GetType().Name.Replace("Controller", string.Empty), nameof(this.GetAll));

            model.NavigationActions.Add(new NavigationActionViewModel
            {
                Name      = $"Create {model.SingleEntityName}",
                ActionUrl = $"/admin/system/navigation-menus/sidebar-menu-section-items/create?SchemeId={menuId}",
                Icon      = MaterialDesignIcons.Plus,
                Method    = HttpMethod.Get,
            });

            return(this.View("AbstractViews/GetAll", model));
        }
Exemplo n.º 2
0
        protected override void TableViewActionsInit(ref List <TableRowActionViewModel> actions)
        {
            base.TableViewActionsInit(ref actions);
            actions.Insert(1, TableMapper.CreateAction("Send Email", MaterialDesignIcons.Email, Color.ForestGreen, TableRowActionMethod.Get, $"/{this.ControllerRoute}{{0}}/send-email", "[Id]"));
            var resetRefreshTokenAction = TableMapper.CreateAction("Reset Refresh Token", MaterialDesignIcons.Refresh, Color.PaleVioletRed, TableRowActionMethod.Post, $"/{this.ControllerRoute}{{0}}/reset-refresh-token", "[Id]");

            resetRefreshTokenAction.SetConfirmation("Reset Refresh Token", "Are you sure you want to reset refresh token of this user?");
            actions.Insert(2, resetRefreshTokenAction);
        }
Exemplo n.º 3
0
 protected override void TableViewActionsInit()
 {
     base.TableViewActionsInit();
     this.TableRowActions.Insert(1, TableMapper.CreateAction(
                                     "Resend Email",
                                     MaterialDesignIcons.Send,
                                     Color.ForestGreen,
                                     TableRowActionMethod.Post,
                                     $"/{this.ControllerRoute}{{0}}/resend",
                                     "[Id]"));
 }
Exemplo n.º 4
0
        protected override void TableViewActionsInit()
        {
            base.TableViewActionsInit();
            this.TableRowActions.Insert(1, TableMapper.CreateAction("Reset MFA", MaterialDesignIcons.Qrcode, Color.MediumVioletRed, TableRowActionMethod.Post, $"/{this.ControllerRoute}{{0}}/reset-mfa", "[Id]"));
            this.TableRowActions.Insert(2, TableMapper.EditAction($"/{this.ControllerRoute}{{0}}/edit-user", "[Id]"));
            this.TableRowActions.Insert(3, TableMapper.CreateAction("Send Email", MaterialDesignIcons.Email, Color.ForestGreen, TableRowActionMethod.Get, $"/{this.ControllerRoute}{{0}}/send-email", "[Id]"));

            var resetPasswordAction = TableMapper.CreateAction("Reset Password", MaterialDesignIcons.Account, Color.Coral, TableRowActionMethod.Post, $"/{this.ControllerRoute}{{0}}/send-reset-password-mail", "[Id]");

            resetPasswordAction.SetConfirmation("Reset Password", "Are you sure you want to reset password of this user?");
            this.TableRowActions.Insert(4, resetPasswordAction);

            var resetRefreshTokenAction = TableMapper.CreateAction("Reset Refresh Token", MaterialDesignIcons.Refresh, Color.PaleVioletRed, TableRowActionMethod.Post, $"/{this.ControllerRoute}{{0}}/reset-refresh-token", "[Id]");

            resetRefreshTokenAction.SetConfirmation("Reset Refresh Token", "Are you sure you want to reset refresh token of this user?");
            this.TableRowActions.Insert(5, resetRefreshTokenAction);
        }
 protected override void TableViewActionsInit(ref List <TableRowActionViewModel> actions)
 {
     base.TableViewActionsInit(ref actions);
     actions.Insert(1, TableMapper.CreateAction(
                        "Translations",
                        MaterialDesignIcons.Translate,
                        Color.ForestGreen,
                        TableRowActionMethod.Get,
                        $"/{this.ControllerRoute}translations/all?q={{0}}",
                        "[Id]"));
     actions.Insert(2, TableMapper.CreateAction(
                        "Generate Translation Json",
                        MaterialDesignIcons.Json,
                        Color.DimGray,
                        TableRowActionMethod.Post,
                        $"/{this.ControllerName}{{0}}/generate-translation-file",
                        "[Id]"));
 }
        protected override void TableViewActionsInit()
        {
            this.TableRowActions.Add(TableMapper.CreateAction("Sections", MaterialDesignIcons.ViewList, Color.DarkSlateBlue, TableRowActionMethod.Get, $"/admin/system/navigation-menus/sidebar-menu-section-items/{{0}}/sections", "[Id]"));

            base.TableViewActionsInit();
        }
        protected override void TableViewActionsInit(ref List <TableRowActionViewModel> actions)
        {
            actions.Add(TableMapper.CreateAction("Sections", MaterialDesignIcons.ViewList, Color.DarkSlateBlue, TableRowActionMethod.Get, $"/admin/system/navigation-menus/{{0}}/sections", "[Id]"));

            base.TableViewActionsInit(ref actions);
        }