Browse Source

CmsKit - Add missing TagsFeature check to BlogPost

pull/7745/head
enisn 6 years ago
parent
commit
7807dcf650
  1. 11
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml
  2. 7
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml.cs

11
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml

@ -26,11 +26,14 @@
@if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>()) @if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{ {
@await Component.InvokeAsync(typeof(TagViewComponent), new if (Model.TagsFeature?.IsEnabled == true)
{ {
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, @await Component.InvokeAsync(typeof(TagViewComponent), new
entityId = Model.BlogPost.Id.ToString() {
}) entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.BlogPost.Id.ToString()
})
}
} }
@if (GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>()) @if (GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>())

7
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml.cs

@ -28,6 +28,8 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Blogs
public BlogFeatureDto RatingsFeature { get; private set; } public BlogFeatureDto RatingsFeature { get; private set; }
public BlogFeatureDto TagsFeature { get; private set; }
protected IBlogPostPublicAppService BlogPostPublicAppService { get; } protected IBlogPostPublicAppService BlogPostPublicAppService { get; }
protected IBlogFeatureAppService BlogFeatureAppService { get; } protected IBlogFeatureAppService BlogFeatureAppService { get; }
@ -58,6 +60,11 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Blogs
{ {
RatingsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, BlogPostConsts.RatingsFeatureName); RatingsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, BlogPostConsts.RatingsFeatureName);
} }
if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{
TagsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, BlogPostConsts.TagsFeatureName);
}
} }
} }
} }

Loading…
Cancel
Save