mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Reply button only displays if user has permission to post comments.
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
@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");
|
||||
|
||||
@@ -22,7 +24,7 @@
|
||||
<h4>
|
||||
<span class="who">@Display.CommentAuthor(ContentPart: comment)</span>
|
||||
<span class="when">@Display.CommentMetadata(ContentPart: comment)</span>
|
||||
@if (comments.ThreadedComments && comments.CommentsActive) {
|
||||
@if (comments.ThreadedComments && comments.CommentsActive && isAuthorized) {
|
||||
@Display.CommentReplyButton(ContentPart: comment)
|
||||
}
|
||||
</h4>
|
||||
|
Reference in New Issue
Block a user