You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

  1. <article data-id="@Model.ID" itemscope itemtype="http://schema.org/UserComments" itemprop="comment" class="@(Model.IsAdmin ? "self" : null)">
  2. <img src="@Model.GravatarUrl(50)" width="50" height="50" alt="Comment by @Model.Author" />
  3. <div>
  4. @Date()
  5. <p itemprop="commentText">@Html.Raw(Model.ContentWithLinks())</p>
  6. @Author()
  7. @DeleteAndApproveButton()
  8. </div>
  9. @ApprovalMessage()
  10. </article>
  11. @helper Date()
  12. {
  13. var title = Model.PubDate.ToString("yyyy-MM-ddTHH:mm");
  14. var display = Model.PubDate.ToString("MMMM d. yyyy HH:mm");
  15. <time datetime="@title" itemprop="commentTime">@display</time>
  16. }
  17. @helper Author()
  18. {
  19. if (string.IsNullOrEmpty(Model.Website))
  20. {
  21. <strong itemprop="creator">@Model.Author</strong>
  22. }
  23. else
  24. {
  25. <strong itemprop="creator"><a href="@Model.Website" itemprop="url" rel="nofollow">@Model.Author</a></strong>
  26. }
  27. }
  28. @helper DeleteAndApproveButton()
  29. {
  30. if (User.Identity.IsAuthenticated)
  31. {
  32. <button class="deletecomment btn btn-link">Delete</button>
  33. if (Blog.ModerateComments && !Model.IsApproved)
  34. {
  35. <button class="approvecomment btn btn-link">Approve</button>
  36. }
  37. }
  38. }
  39. @helper ApprovalMessage()
  40. {
  41. if (Blog.ModerateComments && !Model.IsApproved && !User.Identity.IsAuthenticated)
  42. {
  43. <div itemprop="approvalWarning">! The comment will not be visible until a moderator approves it !</div>
  44. }
  45. }