mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Merge pull request #6015 from ryandrewburnett/dev
Fixed reply button and comment link and added useful CSS class.
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
@using Orchard.Comments.Models
|
||||
@using Orchard.ContentManagement
|
||||
@using Orchard.ContentManagement
|
||||
@using Orchard.Comments
|
||||
@using Orchard.Comments.Models
|
||||
|
||||
@{
|
||||
CommentPart comment = Model.ContentPart;
|
||||
CommentsPart comments = comment.CommentedOnContentItem.As<CommentsPart>();
|
||||
|
||||
var isAuthorized = AuthorizedFor(Permissions.AddComment, Model.ContentItem);
|
||||
|
||||
var children = New.List(Items: Model.Items);
|
||||
children.Classes.Add("comments");
|
||||
|
||||
if (Model.Items.Count > 0) {
|
||||
Model.Classes.Add("has-replies");
|
||||
}
|
||||
|
||||
Model.Classes.Add("comment");
|
||||
Model.Classes.Add("comment-"+comment.Id);
|
||||
|
||||
Model.Id = "comment" + comment.Id;
|
||||
var tag = Tag(Model, "article");
|
||||
}
|
||||
@tag.StartElement
|
||||
@@ -17,8 +24,8 @@
|
||||
<h4>
|
||||
<span class="who">@Display.CommentAuthor(ContentPart: comment)</span>
|
||||
<span class="when">@Display.CommentMetadata(ContentPart: comment)</span>
|
||||
@if (comments.ThreadedComments) {
|
||||
<span class="reply">@Display.CommentReplyButton(ContentPart: comment)</span>
|
||||
@if (comments.ThreadedComments && comments.CommentsActive && isAuthorized) {
|
||||
@Display.CommentReplyButton(ContentPart: comment)
|
||||
}
|
||||
</h4>
|
||||
</header>
|
||||
|
Reference in New Issue
Block a user