From 18c3ac98e9aaf34cd096af7949f3448d98b008d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 23 Feb 2017 17:21:06 +0300 Subject: [PATCH] Moved Users controller to Identity area --- src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs | 4 ++++ src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewImports.cshtml | 4 ++++ src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewStart.cshtml | 3 +++ .../AbpIdentityWebMainMenuContributor.cs | 2 +- src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs | 4 ++-- .../{ => Areas/Identity}/Controllers/UsersController.cs | 4 ++-- .../{ => Areas/Identity}/Views/Users/Index.cshtml | 0 src/Volo.Abp.Identity.Web/project.json | 2 +- 8 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewImports.cshtml create mode 100644 src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewStart.cshtml rename src/Volo.Abp.Identity.Web/{ => Areas/Identity}/Controllers/UsersController.cs (84%) rename src/Volo.Abp.Identity.Web/{ => Areas/Identity}/Views/Users/Index.cshtml (100%) diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs b/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs index 96ad48ea03..4e8bb2b92a 100644 --- a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs +++ b/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs @@ -60,6 +60,10 @@ namespace AbpDesk.Web.Mvc app.UseMvc(routes => { + routes.MapRoute( + name: "defaultWithArea", + template: "{area}/{controller=Home}/{action=Index}/{id?}"); + routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewImports.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewImports.cshtml new file mode 100644 index 0000000000..38710b38a2 --- /dev/null +++ b/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, AbpDesk.Web.Mvc \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewStart.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewStart.cshtml new file mode 100644 index 0000000000..f4d75cd962 --- /dev/null +++ b/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_AppLayout.cshtml"; +} diff --git a/src/Volo.Abp.Identity.Web/AbpIdentityWebMainMenuContributor.cs b/src/Volo.Abp.Identity.Web/AbpIdentityWebMainMenuContributor.cs index 58f7ab7ee6..a53bfc60d9 100644 --- a/src/Volo.Abp.Identity.Web/AbpIdentityWebMainMenuContributor.cs +++ b/src/Volo.Abp.Identity.Web/AbpIdentityWebMainMenuContributor.cs @@ -15,7 +15,7 @@ namespace Volo.Abp.Identity.Web context.Menu .AddItem( new ApplicationMenuItem("Identity", "Identity") - .AddItem(new ApplicationMenuItem("Users", "Users", url: "/Users")) + .AddItem(new ApplicationMenuItem("Users", "Users", url: "/Identity/Users")) ); return Task.CompletedTask; diff --git a/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs b/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs index 6cfebf4e88..d4237de1c0 100644 --- a/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs +++ b/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs @@ -23,9 +23,9 @@ namespace Volo.Abp.Identity.Web { options.Sources.Add( new EmbeddedFileSet( - "/Views/", + "/Areas/", GetType().GetTypeInfo().Assembly, - "Volo.Abp.Identity.Web.Views" + "Volo.Abp.Identity.Web.Areas" ) ); }); diff --git a/src/Volo.Abp.Identity.Web/Controllers/UsersController.cs b/src/Volo.Abp.Identity.Web/Areas/Identity/Controllers/UsersController.cs similarity index 84% rename from src/Volo.Abp.Identity.Web/Controllers/UsersController.cs rename to src/Volo.Abp.Identity.Web/Areas/Identity/Controllers/UsersController.cs index f32e01a873..07b7e86730 100644 --- a/src/Volo.Abp.Identity.Web/Controllers/UsersController.cs +++ b/src/Volo.Abp.Identity.Web/Areas/Identity/Controllers/UsersController.cs @@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; -namespace Volo.Abp.Identity.Web.Controllers +namespace Volo.Abp.Identity.Web.Areas.Identity.Controllers { - //TODO: to a seperated area, named Identity! + [Area("Identity")] public class UsersController : AbpController { private readonly IUserAppService _userAppService; diff --git a/src/Volo.Abp.Identity.Web/Views/Users/Index.cshtml b/src/Volo.Abp.Identity.Web/Areas/Identity/Views/Users/Index.cshtml similarity index 100% rename from src/Volo.Abp.Identity.Web/Views/Users/Index.cshtml rename to src/Volo.Abp.Identity.Web/Areas/Identity/Views/Users/Index.cshtml diff --git a/src/Volo.Abp.Identity.Web/project.json b/src/Volo.Abp.Identity.Web/project.json index 835498161f..658c95f28c 100644 --- a/src/Volo.Abp.Identity.Web/project.json +++ b/src/Volo.Abp.Identity.Web/project.json @@ -16,7 +16,7 @@ "buildOptions": { "embed": { "include": [ - "Views/**/*.*" + "Areas/**/*.*" ] } }