From 2bdaea9a441d7c8ad87863e8e2ef6b5d1f7e7482 Mon Sep 17 00:00:00 2001 From: Mark Downie Date: Wed, 10 Mar 2021 22:06:15 -0500 Subject: [PATCH 1/3] Added IP address --- source/DasBlog.Web.UI/Mappers/ProfilePost.cs | 3 ++- .../BlogViewModels/CommentAdminViewModel.cs | 1 + .../Views/Admin/ManageComments.cshtml | 17 +++++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/source/DasBlog.Web.UI/Mappers/ProfilePost.cs b/source/DasBlog.Web.UI/Mappers/ProfilePost.cs index 8a416653..9bc91ebd 100644 --- a/source/DasBlog.Web.UI/Mappers/ProfilePost.cs +++ b/source/DasBlog.Web.UI/Mappers/ProfilePost.cs @@ -78,7 +78,8 @@ public ProfilePost(IDasBlogSettings dasBlogSettings) .ForMember(dest => dest.CommentId, opt => opt.MapFrom(src => src.EntryId)) .ForMember(dest => dest.SpamState, opt => opt.MapFrom(src => src.SpamState)) .ForMember(dest => dest.IsPublic, opt => opt.MapFrom(src => src.IsPublic)) - .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.AuthorEmail)); + .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.AuthorEmail)) + .ForMember(dest => dest.AuthorIPAddress, opt => opt.MapFrom(src => src.AuthorIPAddress)); CreateMap() .ForMember(dest => dest.Author, opt => opt.MapFrom(src => src.Name)) diff --git a/source/DasBlog.Web.UI/Models/BlogViewModels/CommentAdminViewModel.cs b/source/DasBlog.Web.UI/Models/BlogViewModels/CommentAdminViewModel.cs index 038ed09c..7c2d94c9 100644 --- a/source/DasBlog.Web.UI/Models/BlogViewModels/CommentAdminViewModel.cs +++ b/source/DasBlog.Web.UI/Models/BlogViewModels/CommentAdminViewModel.cs @@ -9,5 +9,6 @@ public class CommentAdminViewModel : CommentViewModel { public string Title { get; set; } public string Email { get; set; } + public string AuthorIPAddress { get; set; } } } diff --git a/source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml b/source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml index 989edb1c..544e2160 100644 --- a/source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml +++ b/source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml @@ -28,14 +28,15 @@ @foreach (var comment in Model) { - - @comment.Title - @comment.Name - @comment.SpamState - @comment.Text - - - + + @comment.Title + @comment.Name + @comment.AuthorIPAddress + @comment.SpamState + @comment.Text + + + } From 0f1b23f4153d50ecdbc7a0eea0f7e69d4a731759 Mon Sep 17 00:00:00 2001 From: Mark Downie Date: Wed, 10 Mar 2021 22:09:41 -0500 Subject: [PATCH 2/3] Update the version --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 57ffea24..4ff75a04 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,7 +10,7 @@ pool: variables: buildConfiguration: 'Release' - version: 2.31 + version: 2.32 steps: - task: UseDotNet@2 From 56642ae91a3f0f0b39ecd65222cf3c14fdf307c1 Mon Sep 17 00:00:00 2001 From: Mark Downie Date: Wed, 10 Mar 2021 22:40:49 -0500 Subject: [PATCH 3/3] Better formatting for IP address --- source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml | 9 +++++---- source/DasBlog.Web.UI/wwwroot/css/site.css | 3 +++ source/DasBlog.Web.UI/wwwroot/css/site.min.css | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml b/source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml index 544e2160..fff474f5 100644 --- a/source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml +++ b/source/DasBlog.Web.UI/Views/Admin/ManageComments.cshtml @@ -19,19 +19,20 @@ Blog Title Name + IP Address Status Comment Text Approval Delete - + @foreach (var comment in Model) { - @comment.Title - @comment.Name - @comment.AuthorIPAddress + @comment.Title + @comment.Name + @comment.AuthorIPAddress @comment.SpamState @comment.Text diff --git a/source/DasBlog.Web.UI/wwwroot/css/site.css b/source/DasBlog.Web.UI/wwwroot/css/site.css index 3bab0a9d..3432fc52 100644 --- a/source/DasBlog.Web.UI/wwwroot/css/site.css +++ b/source/DasBlog.Web.UI/wwwroot/css/site.css @@ -150,3 +150,6 @@ height: 100%; } +tbody.dbc-admin-comment-table td { + word-break: break-all; +} \ No newline at end of file diff --git a/source/DasBlog.Web.UI/wwwroot/css/site.min.css b/source/DasBlog.Web.UI/wwwroot/css/site.min.css index cd46e1ee..ef351ebe 100644 --- a/source/DasBlog.Web.UI/wwwroot/css/site.min.css +++ b/source/DasBlog.Web.UI/wwwroot/css/site.min.css @@ -1 +1 @@ -.clearfix::after,.dbc-calendar ol::after{content:".";display:block;height:0;clear:both;visibility:hidden}.dbc-calendar{border-radius:10px}.month{font-size:2rem}@media(min-width:992px){.month{font-size:3.5rem}}.dbc-calendar ol li{float:left;width:14.28571%}.dbc-calendar .day-names{border-bottom:1px solid #eee}.dbc-calendar .day-names li{text-transform:uppercase;margin-bottom:.5rem}.dbc-calendar .days li{border-bottom:1px solid #eee;min-height:10rem}.dbc-calendar .days li .date{margin:.5rem 0}.dbc-calendar .days li .event{font-size:.75rem;padding:.2rem .1rem .2rem .1rem;overflow:hidden;text-overflow:ellipsis;margin-bottom:1px}.dbc-calendar .days li .event.span-2{width:200%}.dbc-calendar .days li .event.begin{border-radius:1rem 0 0 1rem}.dbc-calendar .days li .event.end{border-radius:0 1rem 1rem 0}.dbc-calendar .days li .event.clear{background:none}.dbc-calendar .days li:nth-child(n+29){border-bottom:none}.dbc-calendar .days li.outside .date{color:#ddd}.dbc-activity-table-column{border:solid 1px;padding:3px;margin-top:3px;margin-bottom:3px}.dbc-activity-table-header-column{border-left:solid 1px;border-right:solid 1px;border-bottom:solid 2px;border-top:solid 1px;padding:3px;font-size:105%;font-weight:bold}.dbc-activity-table{margin-top:10px;margin-bottom:10px;border:solid 1px;width:100%;border-collapse:collapse}.dbc-activity-rable-row-error{BACKGROUND-COLOR:lightpink}.dbc-activity-table-row-blocked{BACKGROUND-COLOR:lightgoldenrodyellow}.dbc-activity-table-row-security-failure{BACKGROUND-COLOR:lightsalmon}.dbc-blogpost-fields-allignment-compatibility{padding-left:15px;padding-right:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}.dbc-form-check{position:relative;display:block}.dbc-form-group{margin-bottom:1rem}.dbc-col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.dbc-post-content img{width:100%;height:100%} \ No newline at end of file +.clearfix::after,.dbc-calendar ol::after{content:".";display:block;height:0;clear:both;visibility:hidden}.dbc-calendar{border-radius:10px}.month{font-size:2rem}@media(min-width:992px){.month{font-size:3.5rem}}.dbc-calendar ol li{float:left;width:14.28571%}.dbc-calendar .day-names{border-bottom:1px solid #eee}.dbc-calendar .day-names li{text-transform:uppercase;margin-bottom:.5rem}.dbc-calendar .days li{border-bottom:1px solid #eee;min-height:10rem}.dbc-calendar .days li .date{margin:.5rem 0}.dbc-calendar .days li .event{font-size:.75rem;padding:.2rem .1rem .2rem .1rem;overflow:hidden;text-overflow:ellipsis;margin-bottom:1px}.dbc-calendar .days li .event.span-2{width:200%}.dbc-calendar .days li .event.begin{border-radius:1rem 0 0 1rem}.dbc-calendar .days li .event.end{border-radius:0 1rem 1rem 0}.dbc-calendar .days li .event.clear{background:none}.dbc-calendar .days li:nth-child(n+29){border-bottom:none}.dbc-calendar .days li.outside .date{color:#ddd}.dbc-activity-table-column{border:solid 1px;padding:3px;margin-top:3px;margin-bottom:3px}.dbc-activity-table-header-column{border-left:solid 1px;border-right:solid 1px;border-bottom:solid 2px;border-top:solid 1px;padding:3px;font-size:105%;font-weight:bold}.dbc-activity-table{margin-top:10px;margin-bottom:10px;border:solid 1px;width:100%;border-collapse:collapse}.dbc-activity-rable-row-error{BACKGROUND-COLOR:lightpink}.dbc-activity-table-row-blocked{BACKGROUND-COLOR:lightgoldenrodyellow}.dbc-activity-table-row-security-failure{BACKGROUND-COLOR:lightsalmon}.dbc-blogpost-fields-allignment-compatibility{padding-left:15px;padding-right:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}.dbc-form-check{position:relative;display:block}.dbc-form-group{margin-bottom:1rem}.dbc-col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.dbc-post-content img{width:100%;height:100%}tbody.dbc-admin-comment-table td{word-break:break-all} \ No newline at end of file