Browse Source

blog admin separation: web

pull/4236/head
Yunus Emre Kalkan 6 years ago
parent
commit
50f7ad93ca
  1. 7
      modules/blogging/Volo.Blogging.sln
  2. 30
      modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/FodyWeavers.xsd
  3. 30
      modules/blogging/src/Volo.Blogging.Admin.HttpApi/FodyWeavers.xsd
  4. 16
      modules/blogging/src/Volo.Blogging.Admin.Web/AbpBloggingAdminWebAutoMapperProfile.cs
  5. 15
      modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminMenuContributor.cs
  6. 53
      modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminWebModule.cs
  7. 3
      modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xml
  8. 30
      modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xsd
  9. 5
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml
  10. 17
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs
  11. 8
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml
  12. 20
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs
  13. 15
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml
  14. 10
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml.cs
  15. 0
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js
  16. 0
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js
  17. 8
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js
  18. 17
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPage.cs
  19. 12
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPageModel.cs
  20. 5
      modules/blogging/src/Volo.Blogging.Admin.Web/Pages/_ViewImports.cshtml
  21. 27
      modules/blogging/src/Volo.Blogging.Admin.Web/Properties/launchSettings.json
  22. 85
      modules/blogging/src/Volo.Blogging.Admin.Web/Volo.Blogging.Admin.Web.csproj
  23. 18
      modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json
  24. 49
      modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json.defaults
  25. 7
      modules/blogging/src/Volo.Blogging.Web/AbpBloggingWebAutoMapperProfile.cs
  26. 5
      modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs
  27. 3
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Index.cshtml.cs
  28. 6
      modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj

7
modules/blogging/Volo.Blogging.sln

@ -57,6 +57,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Blogging.Admin.HttpApi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Blogging.Admin.HttpApi.Client", "src\Volo.Blogging.Admin.HttpApi.Client\Volo.Blogging.Admin.HttpApi.Client.csproj", "{58A63CC9-C886-448B-AB4E-068600294D86}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Blogging.Admin.Web", "src\Volo.Blogging.Admin.Web\Volo.Blogging.Admin.Web.csproj", "{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -147,6 +149,10 @@ Global
{58A63CC9-C886-448B-AB4E-068600294D86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58A63CC9-C886-448B-AB4E-068600294D86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58A63CC9-C886-448B-AB4E-068600294D86}.Release|Any CPU.Build.0 = Release|Any CPU
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -176,6 +182,7 @@ Global
{CB5DEBB3-5C2E-48E9-AA42-497575BCC7A4} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
{59BBAF94-CC8E-4313-9143-F2F5C36A7C45} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
{58A63CC9-C886-448B-AB4E-068600294D86} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F2BAE819-78D4-407A-9201-22473B2850B0}

30
modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

30
modules/blogging/src/Volo.Blogging.Admin.HttpApi/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

16
modules/blogging/src/Volo.Blogging.Admin.Web/AbpBloggingAdminWebAutoMapperProfile.cs

@ -0,0 +1,16 @@
using AutoMapper;
using Volo.Blogging.Admin.Blogs;
using Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs;
using EditModel = Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs.EditModel;
namespace Volo.Blogging.Admin
{
public class AbpBloggingAdminWebAutoMapperProfile : Profile
{
public AbpBloggingAdminWebAutoMapperProfile()
{
CreateMap<CreateModel.BlogCreateModalView, CreateBlogDto>();
CreateMap<BlogDto, EditModel.BlogEditViewModel>();
}
}
}

15
modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs → modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminMenuContributor.cs

@ -1,13 +1,10 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Volo.Abp.UI.Navigation;
using Volo.Blogging.Localization;
namespace Volo.Blogging
namespace Volo.Blogging.Admin
{
public class BloggingMenuContributor : IMenuContributor
public class BloggingAdminMenuContributor : IMenuContributor
{
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
@ -21,14 +18,14 @@ namespace Volo.Blogging
{
var l = context.GetLocalizer<BloggingResource>();
if (await context.IsGrantedAsync(BloggingPermissions.Blogs.Management))
if (await context.IsGrantedAsync(BloggingAdminPermissions.Blogs.Management))
{
var managementRootMenuItem = new ApplicationMenuItem("BlogManagement", l["Menu:BlogManagement"]);
//TODO: Using the same permission. Reconsider.
if (await context.IsGrantedAsync(BloggingPermissions.Blogs.Management))
if (await context.IsGrantedAsync(BloggingAdminPermissions.Blogs.Management))
{
managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogManagement.Blogs", l["Menu:Blogs"], "~/Admin/Blogs"));
managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogManagement.Blogs", l["Menu:Blogs"], "~/Blogging/Admin/Blogs"));
}
context.Menu.AddItem(managementRootMenuItem);

53
modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminWebModule.cs

@ -0,0 +1,53 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
using Volo.Blogging.Localization;
namespace Volo.Blogging.Admin
{
[DependsOn(
typeof(BloggingAdminHttpApiModule),
typeof(AbpAspNetCoreMvcUiBootstrapModule),
typeof(AbpAspNetCoreMvcUiBundlingModule),
typeof(AbpAutoMapperModule)
)]
public class BloggingAdminWebModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(typeof(BloggingResource), typeof(BloggingAdminWebModule).Assembly);
});
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(BloggingAdminWebModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new BloggingAdminMenuContributor());
});
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<BloggingAdminWebModule>("Volo.Blogging");
});
context.Services.AddAutoMapperObjectMapper<BloggingAdminWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpBloggingAdminWebAutoMapperProfile>(validate: true);
});
}
}
}

3
modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

5
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml

@ -1,8 +1,7 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Blogging.Pages.Blog
@inherits BloggingPage
@model Volo.Blogging.Pages.Admin.Blogs.CreateModel
@inherits Volo.Blogging.Admin.Pages.Blogging.BloggingAdminPage
@model Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs.CreateModel
@{
Layout = null;
}

17
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs

@ -2,23 +2,20 @@ using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Blogging.Admin.Blogs;
using Volo.Blogging.Blogs;
using Volo.Blogging.Blogs.Dtos;
using Volo.Blogging.Pages.Blog;
namespace Volo.Blogging.Pages.Admin.Blogs
namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs
{
public class CreateModel : BloggingPageModel
public class CreateModel : BloggingAdminPageModel
{
private readonly IBlogAppService _blogAppService;
private readonly IBlogManagementAppService _blogAppService;
private readonly IAuthorizationService _authorization;
[BindProperty]
public BlogCreateModalView Blog { get; set; } = new BlogCreateModalView();
public CreateModel(IBlogAppService blogAppService, IAuthorizationService authorization)
public CreateModel(IBlogManagementAppService blogAppService, IAuthorizationService authorization)
{
_blogAppService = blogAppService;
_authorization = authorization;
@ -26,7 +23,7 @@ namespace Volo.Blogging.Pages.Admin.Blogs
public virtual async Task<ActionResult> OnGetAsync()
{
if (!await _authorization.IsGrantedAsync(BloggingPermissions.Blogs.Create))
if (!await _authorization.IsGrantedAsync(BloggingAdminPermissions.Blogs.Create))
{
return Redirect("/");
}
@ -59,4 +56,4 @@ namespace Volo.Blogging.Pages.Admin.Blogs
}
}
}
}

8
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml

@ -1,13 +1,11 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Blogging.Pages.Blog
@inherits BloggingPage
@model Volo.Blogging.Pages.Admin.Blogs.EditModel
@inherits Volo.Blogging.Admin.Pages.Blogging.BloggingAdminPage
@model Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs.EditModel
@{
Layout = null;
}
<abp-dynamic-form abp-model="Blog" asp-page="/Admin/Blogs/Edit">
<abp-modal size="@(AbpModalSize.Large)">
<abp-modal-header title="@L["Edit"].Value"></abp-modal-header>
@ -17,4 +15,4 @@
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)">
</abp-modal-footer>
</abp-modal>
</abp-dynamic-form>
</abp-dynamic-form>

20
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs

@ -1,20 +1,16 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Blogging.Admin.Blogs;
using Volo.Blogging.Blogs;
using Volo.Blogging.Blogs.Dtos;
using Volo.Blogging.Pages.Blog;
using Volo.Blogging.Posts;
namespace Volo.Blogging.Pages.Admin.Blogs
namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs
{
public class EditModel : BloggingPageModel
public class EditModel : BloggingAdminPageModel
{
private readonly IBlogAppService _blogAppService;
private readonly IBlogManagementAppService _blogAppService;
private readonly IAuthorizationService _authorization;
[BindProperty(SupportsGet = true)]
@ -23,7 +19,7 @@ namespace Volo.Blogging.Pages.Admin.Blogs
[BindProperty]
public BlogEditViewModel Blog { get; set; } = new BlogEditViewModel();
public EditModel(IBlogAppService blogAppService, IAuthorizationService authorization)
public EditModel(IBlogManagementAppService blogAppService, IAuthorizationService authorization)
{
_blogAppService = blogAppService;
_authorization = authorization;
@ -31,7 +27,7 @@ namespace Volo.Blogging.Pages.Admin.Blogs
public virtual async Task<ActionResult> OnGetAsync()
{
if (!await _authorization.IsGrantedAsync(BloggingPermissions.Blogs.Update))
if (!await _authorization.IsGrantedAsync(BloggingAdminPermissions.Blogs.Update))
{
return Redirect("/");
}
@ -74,5 +70,5 @@ namespace Volo.Blogging.Pages.Admin.Blogs
}
}
}
}

15
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml

@ -1,18 +1,17 @@
@page
@using Microsoft.AspNetCore.Authorization
@using Volo.Blogging
@using Volo.Blogging.Pages.Blog
@inherits BloggingPage
@model Volo.Blogging.Pages.Admin.Blogs.IndexModel
@using Volo.Blogging.Admin
@inherits Volo.Blogging.Admin.Pages.Blogging.BloggingAdminPage
@model Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs.IndexModel
@inject IAuthorizationService Authorization
@{
ViewBag.PageTitle = "Blogs";
}
@section scripts {
<abp-script src="/Pages/Admin/Blogs/index.js" />
<abp-script src="/Pages/Admin/Blogs/create.js" />
<abp-script src="/Pages/Admin/Blogs/edit.js" />
<abp-script src="/Pages/Blogging/Admin/Blogs/index.js" />
<abp-script src="/Pages/Blogging/Admin/Blogs/create.js" />
<abp-script src="/Pages/Blogging/Admin/Blogs/edit.js" />
}
<abp-card>
@ -22,7 +21,7 @@
<h2>@L["Blogs"]</h2>
</abp-column>
<abp-column size-md="_6" class="text-right">
@if (await Authorization.IsGrantedAsync(BloggingPermissions.Blogs.Create))
@if (await Authorization.IsGrantedAsync(BloggingAdminPermissions.Blogs.Create))
{
<abp-button icon="plus" text="@L["CreateANewBlog"].Value" button-type="Primary" id="CreateNewBlogButtonId"></abp-button>
}

10
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml.cs → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml.cs

@ -1,12 +1,10 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Blogging.Pages.Blog;
namespace Volo.Blogging.Pages.Admin.Blogs
namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs
{
public class IndexModel : BloggingPageModel
public class IndexModel : BloggingAdminPageModel
{
private readonly IAuthorizationService _authorization;
@ -17,7 +15,7 @@ namespace Volo.Blogging.Pages.Admin.Blogs
public virtual async Task<ActionResult> OnGetAsync()
{
if (!await _authorization.IsGrantedAsync(BloggingPermissions.Blogs.Management))
if (!await _authorization.IsGrantedAsync(BloggingAdminPermissions.Blogs.Management))
{
return Redirect("/");
}
@ -25,4 +23,4 @@ namespace Volo.Blogging.Pages.Admin.Blogs
return Page();
}
}
}
}

0
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/create.js → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js

0
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/edit.js → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js

8
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js → modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js

@ -1,8 +1,8 @@
$(function () {
var l = abp.localization.getResource('Blogging');
var _createModal = new abp.ModalManager(abp.appPath + 'Admin/Blogs/Create');
var _editModal = new abp.ModalManager(abp.appPath + 'Admin/Blogs/Edit');
var _createModal = new abp.ModalManager(abp.appPath + 'Blogging/Admin/Blogs/Create');
var _editModal = new abp.ModalManager(abp.appPath + 'Blogging/Admin/Blogs/Edit');
var _dataTable = $('#BlogsTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
@ -14,7 +14,7 @@
autoWidth: false,
scrollCollapse: true,
order: [[3, "desc"]],
ajax: abp.libs.datatables.createAjax(volo.blogging.blogs.getList),
ajax: abp.libs.datatables.createAjax(volo.blogging.admin.blogManagement.getList),
columnDefs: [
{
rowAction: {
@ -79,4 +79,4 @@
_dataTable.ajax.reload();
});
});
});

17
modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPage.cs

@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc.Localization;
using Microsoft.AspNetCore.Mvc.Razor.Internal;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Blogging.Localization;
namespace Volo.Blogging.Admin.Pages.Blogging
{
public abstract class BloggingAdminPage : AbpPage
{
[RazorInject]
public IHtmlLocalizer<BloggingResource> L { get; set; }
public const string DefaultTitle = "Blogging";
public const int MaxShortContentLength = 200;
}
}

12
modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPageModel.cs

@ -0,0 +1,12 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Blogging.Admin.Pages
{
public abstract class BloggingAdminPageModel : AbpPageModel
{
public BloggingAdminPageModel()
{
ObjectMapperContext = typeof(BloggingAdminWebModule);
}
}
}

5
modules/blogging/src/Volo.Blogging.Admin.Web/Pages/_ViewImports.cshtml

@ -0,0 +1,5 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
@addTagHelper *, Volo.Blogging.Web

27
modules/blogging/src/Volo.Blogging.Admin.Web/Properties/launchSettings.json

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:50000/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Volo.Blogging.Web": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:50014/"
}
}
}

85
modules/blogging/src/Volo.Blogging.Admin.Web/Volo.Blogging.Admin.Web.csproj

@ -0,0 +1,85 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Volo.Blogging.Admin.Web</AssemblyName>
<PackageId>Volo.Blogging.Admin.Web</PackageId>
<TypeScriptToolsVersion>2.8</TypeScriptToolsVersion>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<RootNamespace>Volo.Blogging.Admin</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Packages\Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Bundling\Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\Volo.Blogging.Admin.HttpApi\Volo.Blogging.Admin.HttpApi.csproj" />
<PackageReference Include="Markdig.Signed" Version="0.18.0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="compilerconfig.json" />
<Content Remove="Properties\launchSettings.json" />
<Content Update="Pages\Admin\Blogs\Create.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Update="Pages\Admin\Blogs\Edit.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Update="Pages\Admin\Blogs\Index.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<EmbeddedResource Update="Pages\Blogs\Posts\Index.min.css">
<DependentUpon>Index.css</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Pages\Blogs\Posts\new.min.css">
<DependentUpon>new.css</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Pages\Blogs\Shared\Styles\blog.min.css">
<DependentUpon>blog.css</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Pages\Blogs\Shared\Styles\_home.min.css">
<DependentUpon>_home.css</DependentUpon>
</EmbeddedResource>
<Content Update="Pages\_ViewImports.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="compilerconfig.json" />
<None Include="Properties\launchSettings.json" />
<None Update="Pages\Blogs\Posts\new.css.map">
<DependentUpon>new.css</DependentUpon>
</None>
<None Update="Pages\Blogs\Shared\Styles\blog.css.map">
<DependentUpon>blog.css</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<Compile Update="Pages\Admin\Blogs\Create.cshtml.cs">
<DependentUpon>Create.cshtml</DependentUpon>
</Compile>
<Compile Update="Pages\Admin\Blogs\Edit.cshtml.cs">
<DependentUpon>Edit.cshtml</DependentUpon>
</Compile>
<Compile Update="Pages\Admin\Blogs\Index.cshtml.cs">
<DependentUpon>Index.cshtml</DependentUpon>
</Compile>
</ItemGroup>
</Project>

18
modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json

@ -0,0 +1,18 @@
[
{
"outputFile": "Pages/Blog/Shared/Styles/blog.css",
"inputFile": "Pages/Blog/Shared/Styles/blog.scss"
},
{
"outputFile": "Pages/Blog/Shared/Styles/_home.css",
"inputFile": "Pages/Blog/Shared/Styles/_home.scss"
},
{
"outputFile": "Pages/Blog/Posts/Index.css",
"inputFile": "Pages/Blog/Posts/Index.scss"
},
{
"outputFile": "Pages/Blogs/Shared/Styles/blog.css",
"inputFile": "Pages/Blogs/Shared/Styles/blog.scss"
}
]

49
modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json.defaults

@ -0,0 +1,49 @@
{
"compilers": {
"less": {
"autoPrefix": "",
"cssComb": "none",
"ieCompat": true,
"strictMath": false,
"strictUnits": false,
"relativeUrls": true,
"rootPath": "",
"sourceMapRoot": "",
"sourceMapBasePath": "",
"sourceMap": false
},
"sass": {
"includePath": "",
"indentType": "space",
"indentWidth": 2,
"outputStyle": "nested",
"Precision": 5,
"relativeUrls": true,
"sourceMapRoot": "",
"sourceMap": false
},
"stylus": {
"sourceMap": false
},
"babel": {
"sourceMap": false
},
"coffeescript": {
"bare": false,
"runtimeMode": "node",
"sourceMap": false
}
},
"minifiers": {
"css": {
"enabled": true,
"termSemicolons": true,
"gzip": false
},
"javascript": {
"enabled": true,
"termSemicolons": true,
"gzip": false
}
}
}

7
modules/blogging/src/Volo.Blogging.Web/AbpBloggingWebAutoMapperProfile.cs

@ -1,12 +1,7 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Volo.Blogging.Blogs;
using Volo.Blogging.Blogs.Dtos;
using Volo.Blogging.Pages.Admin.Blogs;
using Volo.Blogging.Pages.Blog.Posts;
using Volo.Blogging.Posts;
using EditModel = Volo.Blogging.Pages.Admin.Blogs.EditModel;
using IndexModel = Volo.Blogging.Pages.Blog.IndexModel;
namespace Volo.Blogging
{
@ -16,8 +11,6 @@ namespace Volo.Blogging
{
CreateMap<PostWithDetailsDto, EditPostViewModel>().Ignore(x=>x.Tags);
CreateMap<NewModel.CreatePostViewModel, CreatePostDto>();
CreateMap<CreateModel.BlogCreateModalView, CreateBlogDto>();
CreateMap<BlogDto, EditModel.BlogEditViewModel>();
}
}
}

5
modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs

@ -37,11 +37,6 @@ namespace Volo.Blogging
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new BloggingMenuContributor());
});
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<BloggingWebModule>("Volo.Blogging");

3
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Index.cshtml.cs

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
@ -34,4 +33,4 @@ namespace Volo.Blogging.Pages.Blog
return Page();
}
}
}
}

6
modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj

@ -33,4 +33,10 @@
<None Include="Properties\launchSettings.json" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="Pages\Admin\Blogs\Create.cshtml" />
<_ContentIncludedByDefault Remove="Pages\Admin\Blogs\Edit.cshtml" />
<_ContentIncludedByDefault Remove="Pages\Admin\Blogs\Index.cshtml" />
</ItemGroup>
</Project>

Loading…
Cancel
Save