mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Reply button only displays if user has permission to post comments.
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
@using Orchard.Comments.Models
|
@using Orchard.ContentManagement
|
||||||
@using Orchard.ContentManagement
|
@using Orchard.Comments
|
||||||
|
@using Orchard.Comments.Models
|
||||||
|
|
||||||
@{
|
@{
|
||||||
CommentPart comment = Model.ContentPart;
|
CommentPart comment = Model.ContentPart;
|
||||||
CommentsPart comments = comment.CommentedOnContentItem.As<CommentsPart>();
|
CommentsPart comments = comment.CommentedOnContentItem.As<CommentsPart>();
|
||||||
|
var isAuthorized = AuthorizedFor(Permissions.AddComment, Model.ContentItem);
|
||||||
|
|
||||||
var children = New.List(Items: Model.Items);
|
var children = New.List(Items: Model.Items);
|
||||||
children.Classes.Add("comments");
|
children.Classes.Add("comments");
|
||||||
@@ -22,7 +24,7 @@
|
|||||||
<h4>
|
<h4>
|
||||||
<span class="who">@Display.CommentAuthor(ContentPart: comment)</span>
|
<span class="who">@Display.CommentAuthor(ContentPart: comment)</span>
|
||||||
<span class="when">@Display.CommentMetadata(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)
|
@Display.CommentReplyButton(ContentPart: comment)
|
||||||
}
|
}
|
||||||
</h4>
|
</h4>
|
||||||
|
Reference in New Issue
Block a user