From 981c76d7c7a32c65b4275d94c4db26db859b2dc1 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 7 Mar 2019 11:58:31 +0300 Subject: [PATCH] Remove blog menu item --- .../Blog/Controllers/CommentsController.cs | 2 ++ .../Areas/Blog/Controllers/PostsController.cs | 2 ++ .../BloggingMenuContributor.cs | 22 +++++++------------ .../Resources/Blogging/Web/en.json | 2 +- .../Resources/Blogging/Web/pt-BR.json | 2 +- .../Resources/Blogging/Web/tr.json | 2 +- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/CommentsController.cs b/modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/CommentsController.cs index 89ed0f1968..80ef132c21 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/CommentsController.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/CommentsController.cs @@ -7,6 +7,8 @@ using Volo.Blogging.Comments.Dtos; namespace Volo.Blogging.Areas.Blog.Controllers { + //TODO: Is that being used? + [Area("Blog")] [Route("Blog/[controller]/[action]")] public class CommentsController : AbpController diff --git a/modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/PostsController.cs b/modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/PostsController.cs index 55a96f6ccc..383f08284f 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/PostsController.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/PostsController.cs @@ -6,6 +6,8 @@ using Volo.Blogging.Posts; namespace Volo.Blogging.Areas.Blog.Controllers { + //TODO: Is that being used? + [Area("Blog")] [Route("Blog/[controller]/[action]")] public class PostsController : AbpController diff --git a/modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs b/modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs index f20c946232..cf1f12ed02 100644 --- a/modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs +++ b/modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs @@ -1,7 +1,7 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; +using System.Threading.Tasks; using Volo.Abp.UI.Navigation; using Volo.Blogging.Localization; @@ -22,23 +22,17 @@ namespace Volo.Blogging var authorizationService = context.ServiceProvider.GetRequiredService(); var l = context.ServiceProvider.GetRequiredService>(); - if (await authorizationService.IsGrantedAsync(BloggingPermissions.Blogs.Default)) + if (await authorizationService.IsGrantedAsync(BloggingPermissions.Blogs.Management)) { - var rootMenuItem = new ApplicationMenuItem("Blogs", l["Menu:Blogs"], "/Blog"); - - context.Menu.AddItem(rootMenuItem); + var managementRootMenuItem = new ApplicationMenuItem("BlogManagement", l["Menu:BlogManagement"]); + //TODO: Using the same permission. Reconsider. if (await authorizationService.IsGrantedAsync(BloggingPermissions.Blogs.Management)) { - var managementRootMenuItem = new ApplicationMenuItem("BlogManagement", l["Menu:BlogManagement"]); - - if (await authorizationService.IsGrantedAsync(BloggingPermissions.Blogs.Management)) - { - managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogsAdmin", l["Menu:Blogs"], "/Admin/Blogs")); - } - - context.Menu.AddItem(managementRootMenuItem); + managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogManagement.Blogs", l["Menu:Blogs"], "/Admin/Blogs")); } + + context.Menu.AddItem(managementRootMenuItem); } } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/en.json b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/en.json index b9e7b543b9..444c3d80af 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/en.json +++ b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/en.json @@ -1,7 +1,7 @@ { "culture": "en", "texts": { - "Menu:Blogs": "Blog", + "Menu:Blogs": "Blogs", "Menu:BlogManagement": "Blog Management", "Title": "Title", "Delete": "Delete", diff --git a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/pt-BR.json b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/pt-BR.json index 81740c65db..cf98e56b06 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/pt-BR.json +++ b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/pt-BR.json @@ -1,7 +1,7 @@ { "culture": "pt-BR", "texts": { - "Menu:Blogs": "Blog", + "Menu:Blogs": "Blogs", "Menu:BlogManagement": "Gerenciar Blog", "Title": "Título", "Delete": "Excluir", diff --git a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/tr.json b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/tr.json index a5a705d506..7d8386e517 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/tr.json +++ b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/tr.json @@ -1,7 +1,7 @@ { "culture": "tr", "texts": { - "Menu:Blogs": "Blog", + "Menu:Blogs": "Bloglar", "Title": "Başlık", "Delete": "Sil", "Reply": "Yanıtla",