mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
@@ -7,8 +7,8 @@
|
||||
CommentsPart commentsPart = Model.ContentPart;
|
||||
bool canStillCommentOn = Model.CanStillComment;
|
||||
var settings = commentsPart.TypePartDefinition.Settings.GetModel<CommentsPartSettings>();
|
||||
var isAuthorized = AuthorizedFor(Permissions.AddComment, Model.ContentItem);
|
||||
}
|
||||
|
||||
@if (!Model.ContentPart.CommentsActive || !canStillCommentOn) {
|
||||
if (Model.ContentPart.Comments.Count > 0) {
|
||||
<div id="comments">
|
||||
@@ -16,17 +16,16 @@
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else if (settings.MustBeAuthenticated && WorkContext.CurrentUser == null) {
|
||||
<div id="comments">
|
||||
<p class="comment-disabled">@T("You must be authenticated in order to add a comment.")</p>
|
||||
</div>
|
||||
}
|
||||
else if (WorkContext.CurrentUser == null && !AuthorizedFor(Permissions.AddComment)) {
|
||||
<h2 id="add-comment">@T("Add a Comment")</h2>
|
||||
else if ((settings.MustBeAuthenticated || !isAuthorized) && WorkContext.CurrentUser == null) {
|
||||
<p class="info message">@T("You must {0} to comment.", Html.ActionLink(T("log on").ToString(), "LogOn",
|
||||
new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = string.Format("{0}#addacomment", Context.Request.RawUrl) }))</p>
|
||||
}
|
||||
else {
|
||||
else if (WorkContext.CurrentUser != null && !isAuthorized) {
|
||||
<div id="comments">
|
||||
<p class="comment-disabled">@T("You are not authorized to add a comment.")</p>
|
||||
</div>
|
||||
}
|
||||
else if (isAuthorized) {
|
||||
@Html.ValidationSummary()
|
||||
<span id="comment-form-beacon"></span>
|
||||
using (Html.BeginFormAntiForgeryPost(Url.Action("Create", "Comment", new { Area = "Orchard.Comments", ReturnUrl = Context.Request.ToUrlString() }), FormMethod.Post, new { @class = "comment-form" })) {
|
||||
|
||||
Reference in New Issue
Block a user