Skip to content

Commit 856438d

Browse files
committed
Cleanup in comment view
1 parent 7d1797a commit 856438d

File tree

15 files changed

+84
-111
lines changed

15 files changed

+84
-111
lines changed

BlogEngine/BlogEngine.Core/Data/Models/Settings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ public Settings() { }
168168
public bool ShowLivePreview { get; set; }
169169

170170
public BlogSettings.CommentsBy CommentProvider { get; set; }
171-
public bool UseDisqus { get; set; }
172171
public bool DisqusDevMode { get; set; }
173172
public bool DisqusAddCommentsToPages { get; set; }
174173
public string DisqusWebsiteName { get; set; }

BlogEngine/BlogEngine.Core/Data/SettingsRepository.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ public Settings Get()
115115
ns.ShowLivePreview = bs.ShowLivePreview;
116116

117117
ns.CommentProvider = bs.CommentProvider;
118-
ns.UseDisqus = bs.CommentProvider == BlogSettings.CommentsBy.Disqus;
119118
ns.DisqusDevMode = bs.DisqusDevMode;
120119
ns.DisqusAddCommentsToPages = bs.DisqusAddCommentsToPages;
121120
ns.DisqusWebsiteName = bs.DisqusWebsiteName;

BlogEngine/BlogEngine.Core/Web/Scripting/Helpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static void AddTrackingScript(System.Web.UI.Page page)
114114
{
115115
var sb = new StringBuilder();
116116

117-
if (BlogSettings.Instance.CommentProvider == BlogSettings.CommentsBy.Disqus)
117+
if (BlogSettings.Instance.CommentProvider == BlogSettings.CommentsBy.Disqus && BlogSettings.Instance.IsCommentsEnabled)
118118
{
119119
sb.Append("<script type=\"text/javascript\"> \n");
120120
sb.Append("//<![CDATA[ \n");

BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@
18001800
<Content Include="Custom\Themes\TitaniumX\theme.png" />
18011801
<Content Include="Custom\Themes\TitaniumX\theme.xml" />
18021802
<Content Include="Custom\Themes\TitaniumX\WidgetContainer.ascx" />
1803-
<Content Include="Custom\Controls\CommentView.ascx" />
1803+
<Content Include="Custom\Controls\CommentList.ascx" />
18041804
<Content Include="Custom\Controls\Defaults\CommentForm.ascx" />
18051805
<Content Include="Custom\Controls\Defaults\PostNavigation.ascx" />
18061806
<Content Include="Custom\Controls\PostList.ascx" />
@@ -2341,12 +2341,12 @@
23412341
<Compile Include="Custom\Themes\TitaniumX\site.master.designer.cs">
23422342
<DependentUpon>site.master</DependentUpon>
23432343
</Compile>
2344-
<Compile Include="Custom\Controls\CommentView.ascx.cs">
2345-
<DependentUpon>CommentView.ascx</DependentUpon>
2344+
<Compile Include="Custom\Controls\CommentList.ascx.cs">
2345+
<DependentUpon>CommentList.ascx</DependentUpon>
23462346
<SubType>ASPXCodeBehind</SubType>
23472347
</Compile>
2348-
<Compile Include="Custom\Controls\CommentView.ascx.designer.cs">
2349-
<DependentUpon>CommentView.ascx</DependentUpon>
2348+
<Compile Include="Custom\Controls\CommentList.ascx.designer.cs">
2349+
<DependentUpon>CommentList.ascx</DependentUpon>
23502350
</Compile>
23512351
<Compile Include="Custom\Controls\PostList.ascx.cs">
23522352
<DependentUpon>PostList.ascx</DependentUpon>

BlogEngine/BlogEngine.NET/Custom/Controls/CommentView.ascx renamed to BlogEngine/BlogEngine.NET/Custom/Controls/CommentList.ascx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
<%@ Control Language="C#" AutoEventWireup="true" Inherits="UserControls.CommentView" Codebehind="CommentView.ascx.cs" %>
1+
<%@ Control Language="C#" AutoEventWireup="true" Inherits="UserControls.CommentList" Codebehind="CommentList.ascx.cs" %>
22
<%@ Import Namespace="BlogEngine.Core" %>
33

44
<div class="well-global">
55
<% if (CommentCounter > 0){ %>
66
<h3 id="comment" class="well-global-title">
77
<%=Resources.labels.comments %> (<%=CommentCounter%>)
8-
<a id="commenttoggle" style="float: right; width: 20px; height: 20px; border: 1px solid #ccc; text-decoration: none; text-align: center" href="javascript:toggle_visibility('commentlist', 'commenttoggle');">-</a>
8+
<a id="commenttoggle" style="float: right; width: 20px; height: 20px; border: 1px solid #ccc; text-decoration: none; text-align: center" href="javascript:toggle_visibility('commentlist', 'commenttoggle');">-</a>
99
</h3>
1010
<%} %>
1111

12-
<div id="commentlist" style="display: block" >
13-
<asp:PlaceHolder runat="server" ID="phComments" />
14-
12+
<div id="commentlist" style="display: block">
13+
<asp:PlaceHolder runat="server" ID="phComments" />
1514
</div>
16-
1715
</div>
1816

1917
<asp:PlaceHolder runat="server" ID="phTrckbacks"></asp:PlaceHolder>
2018

2119
<asp:PlaceHolder runat="Server" ID="phAddComment">
22-
2320
<div id="comment-form">
2421
<img src="<%=Utils.RelativeWebRoot %>Content/images/blog/ajax-loader.gif" width="24" height="24" alt="Saving the comment" style="display: none" id="ajaxLoader" />
2522
<span id="status"></span>
@@ -34,12 +31,10 @@
3431
<blog:RecaptchaControl ID="recaptcha" runat="server" />
3532
<asp:HiddenField runat="server" ID="hfCaptcha" />
3633
</div>
37-
3834
<script type="text/javascript">
39-
<!--//
40-
BlogEngine.comments.flagImage = BlogEngine.$("imgFlag");
41-
BlogEngine.comments.contentBox = BlogEngine.$("txtContent");
42-
BlogEngine.comments.moderation = <%=BlogSettings.Instance.EnableCommentsModeration.ToString().ToLowerInvariant() %>;
35+
BlogEngine.comments.flagImage = BlogEngine.$("imgFlag");
36+
BlogEngine.comments.contentBox = BlogEngine.$("txtContent");
37+
BlogEngine.comments.moderation = <%=BlogSettings.Instance.EnableCommentsModeration.ToString().ToLowerInvariant() %>;
4338
BlogEngine.comments.checkName = <%=(!Security.IsAuthenticated).ToString().ToLowerInvariant() %>;
4439
BlogEngine.comments.postAuthor = "<%=Post.Author %>";
4540
BlogEngine.comments.nameBox = BlogEngine.$("txtName");
@@ -49,7 +44,6 @@
4944
BlogEngine.comments.controlId = '<%=UniqueID %>';
5045
BlogEngine.comments.captchaField = BlogEngine.$('<%=hfCaptcha.ClientID %>');
5146
BlogEngine.comments.replyToId = BlogEngine.$("<%=hiddenReplyTo.ClientID %>");
52-
//-->
5347
</script>
5448
</asp:PlaceHolder>
5549

BlogEngine/BlogEngine.NET/Custom/Controls/CommentView.ascx.cs renamed to BlogEngine/BlogEngine.NET/Custom/Controls/CommentList.ascx.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/// <summary>
2121
/// The comment view.
2222
/// </summary>
23-
public partial class CommentView : UserControl, ICallbackEventHandler
23+
public partial class CommentList : UserControl, ICallbackEventHandler
2424
{
2525
#region Constants and Fields
2626

@@ -35,9 +35,9 @@ public partial class CommentView : UserControl, ICallbackEventHandler
3535
private bool? nestingSupported;
3636

3737
/// <summary>
38-
/// Initializes a new instance of the <see cref = "CommentView" /> class.
38+
/// Initializes a new instance of the <see cref = "CommentList" /> class.
3939
/// </summary>
40-
public CommentView()
40+
public CommentList()
4141
{
4242
NameInputId = string.Empty;
4343
DefaultName = string.Empty;

BlogEngine/BlogEngine.NET/Custom/Controls/CommentView.ascx.designer.cs renamed to BlogEngine/BlogEngine.NET/Custom/Controls/CommentList.ascx.designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BlogEngine/BlogEngine.NET/Custom/Themes/Standard/PostView.ascx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" Inherits="BlogEngine.Core.Web.Controls.PostViewBase" %>
2-
<% if (Location != BlogEngine.Core.ServingLocation.SinglePost)
3-
{%>
2+
<%@ Import Namespace="BlogEngine.Core"%>
3+
<% if (Location != ServingLocation.SinglePost){%>
44
<article class="post post-home" id="post<%=Index %>">
5-
<%} %>
6-
<% if (Location == BlogEngine.Core.ServingLocation.SinglePost)
7-
{%>
5+
<%} %>
6+
<% if (Location == ServingLocation.SinglePost){%>
87
<article class="post" id="post<%=Index %>">
9-
<%} %>
8+
<%} %>
109
<header class="post-header">
1110
<h2 class="post-title">
1211
<a href="<%=Post.RelativeOrAbsoluteLink %>"><%=Server.HtmlEncode(Post.Title) %></a>
1312
</h2>
1413
<div class="post-info clearfix">
1514
<span class="post-date"><i class="icon-calendar"></i><%=Post.DateCreated.ToString("dd MMMM yyyy hh:mm") %></span>
16-
<span class="post-author"><i class=" icon-user"></i><a href="<%=BlogEngine.Core.Utils.AbsoluteWebRoot + "author/" + BlogEngine.Core.Utils.RemoveIllegalCharacters(Post.Author) + BlogEngine.Core.BlogConfig.FileExtension %>"><%=Post.AuthorProfile != null ? Post.AuthorProfile.DisplayName : Post.Author %></a></span>
15+
<span class="post-author"><i class=" icon-user"></i><a href="<%=Utils.AbsoluteWebRoot + "author/" + Utils.RemoveIllegalCharacters(Post.Author) + BlogConfig.FileExtension %>"><%=Post.AuthorProfile != null ? Post.AuthorProfile.DisplayName : Post.Author %></a></span>
1716
<span class="post-category"><i class=" icon-folder"></i><%=CategoryLinks(", ") %></span>
17+
18+
<% if (BlogSettings.Instance.CommentProvider == BlogSettings.CommentsBy.BlogEngine){ %>
1819
<a rel="nofollow" class="pull-right " href="<%=Post.RelativeOrAbsoluteLink %>#comment"><i class="icon-comment"></i>(<%=Post.ApprovedComments.Count %>)</a>
20+
<%} else {%>
21+
<a rel="nofollow" class="pull-right " href="<%=Post.RelativeOrAbsoluteLink %>#comment">
22+
<i class="icon-comment"></i>
23+
</a>
24+
<%} %>
1925
</div>
2026
</header>
2127
<section class="post-body text">
2228
<asp:PlaceHolder ID="BodyContent" runat="server" />
2329
<%=AdminLinks %>
2430
</section>
25-
<% if (Location == BlogEngine.Core.ServingLocation.SinglePost)
26-
{%>
31+
<% if (Location == ServingLocation.SinglePost){%>
2732
<footer class="post-footer">
2833
<div class="post-tags">
2934
<%=Resources.labels.tags %> : <%=TagLinks(", ") %>

BlogEngine/BlogEngine.NET/Custom/Themes/Standard/site.master

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<nav class="header-nav float-right">
2828
<ul>
2929
<li><a href="<%=Utils.AbsoluteWebRoot %>"><%=Resources.labels.home %></a></li>
30-
<li><a href="<%=Utils.AbsoluteWebRoot %>archive<%= BlogEngine.Core.BlogConfig.FileExtension %>"><%=Resources.labels.archive %></a></li>
31-
<li><a href="<%=Utils.AbsoluteWebRoot %>contact<%= BlogEngine.Core.BlogConfig.FileExtension %>"><%=Resources.labels.contact %></a></li>
30+
<li><a href="<%=Utils.AbsoluteWebRoot %>archive<%= BlogConfig.FileExtension %>"><%=Resources.labels.archive %></a></li>
31+
<li><a href="<%=Utils.AbsoluteWebRoot %>contact<%= BlogConfig.FileExtension %>"><%=Resources.labels.contact %></a></li>
3232
<li><a runat="server" id="aLogin"></a></li>
3333
</ul>
3434
</nav>

BlogEngine/BlogEngine.NET/Custom/Themes/Standard/site.master.designer.cs

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)