From d551b17d4e55f0d7fd0029b69ae40e0006878345 Mon Sep 17 00:00:00 2001 From: Mark Downie Date: Sat, 8 Aug 2020 20:01:59 -0400 Subject: [PATCH 1/4] Only show comments if they are enabled at the site config layer. --- .../Views/Shared/_CommentBlockPartial.cshtml | 2 +- .../Views/Shared/_CommentPartial.cshtml | 39 ++++++++++--------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/source/DasBlog.Web.UI/Views/Shared/_CommentBlockPartial.cshtml b/source/DasBlog.Web.UI/Views/Shared/_CommentBlockPartial.cshtml index c9c706cb..ce8f68f6 100644 --- a/source/DasBlog.Web.UI/Views/Shared/_CommentBlockPartial.cshtml +++ b/source/DasBlog.Web.UI/Views/Shared/_CommentBlockPartial.cshtml @@ -3,7 +3,7 @@ @model ListCommentsViewModel @inject IDasBlogSettings dasBlogSettings -@if (Model != null && Model.Comments != null) +@if (dasBlogSettings.SiteConfiguration.EnableComments && Model?.Comments != null) {

Comment Section

diff --git a/source/DasBlog.Web.UI/Views/Shared/_CommentPartial.cshtml b/source/DasBlog.Web.UI/Views/Shared/_CommentPartial.cshtml index 4640cbb2..3bcd5101 100644 --- a/source/DasBlog.Web.UI/Views/Shared/_CommentPartial.cshtml +++ b/source/DasBlog.Web.UI/Views/Shared/_CommentPartial.cshtml @@ -13,28 +13,31 @@ } } -