ASP Classic blog framework - BrainOrdure
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

89 行
3.6KB

  1. <div class="d-flex align-items-center justify-content-between mb-4">
  2. <div>
  3. <h1 class="h3 mb-1">Manage Comments</h1>
  4. <p class="text-muted mb-0">Approve comments before they appear on posts.</p>
  5. </div>
  6. <a class="btn btn-outline-secondary" href="<%= AdminUrl() %>">&larr; Back to dashboard</a>
  7. </div>
  8. <% If comments.Count = 0 Then %>
  9. <div class="alert alert-secondary">No comments yet.</div>
  10. <% Else %>
  11. <div class="table-responsive">
  12. <table class="table table-hover align-middle">
  13. <thead class="table-light">
  14. <tr>
  15. <th>Comment</th>
  16. <th>Post</th>
  17. <th>Status</th>
  18. <th>Created</th>
  19. <th class="text-end">Actions</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <%
  24. Dim adminCommentIter, adminCommentItem, adminCommentPost, adminCommentPostTitle, adminCommentPostUrl
  25. Set adminCommentIter = comments.Iterator()
  26. Do While adminCommentIter.HasNext
  27. Set adminCommentItem = adminCommentIter.GetNext()
  28. adminCommentPostTitle = "Post #" & CStr(adminCommentItem.PostID)
  29. adminCommentPostUrl = ""
  30. Set adminCommentPost = Nothing
  31. On Error Resume Next
  32. Set adminCommentPost = PostsRepository().FindByID(adminCommentItem.PostID)
  33. If Err.Number = 0 Then
  34. adminCommentPostTitle = adminCommentPost.Title
  35. adminCommentPostUrl = PostUrl(adminCommentPost.Slug)
  36. End If
  37. Err.Clear
  38. On Error GoTo 0
  39. %>
  40. <tr>
  41. <td style="min-width: 320px;">
  42. <strong><%= H(adminCommentItem.AuthorName) %></strong>
  43. <% If Len(Trim(CStr(adminCommentItem.AuthorEmail))) > 0 Then %>
  44. <div class="small text-muted"><%= H(adminCommentItem.AuthorEmail) %></div>
  45. <% End If %>
  46. <div class="mt-2"><%= H(adminCommentItem.Body) %></div>
  47. </td>
  48. <td class="text-nowrap">
  49. <% If Len(adminCommentPostUrl) > 0 Then %>
  50. <a href="<%= adminCommentPostUrl %>"><%= H(adminCommentPostTitle) %></a>
  51. <% Else %>
  52. <%= H(adminCommentPostTitle) %>
  53. <% End If %>
  54. </td>
  55. <td class="text-nowrap">
  56. <% If adminCommentItem.IsApproved = 1 Then %>
  57. <span class="badge bg-success">Approved</span>
  58. <% Else %>
  59. <span class="badge bg-secondary">Pending</span>
  60. <% End If %>
  61. </td>
  62. <td class="small text-muted text-nowrap">
  63. <%= H(FormatDateTime(adminCommentItem.CreatedDate, vbShortDate)) %>
  64. </td>
  65. <td class="text-end text-nowrap">
  66. <% If adminCommentItem.IsApproved = 1 Then %>
  67. <form class="d-inline" method="post" action="<%= AdminCommentUnapproveUrl(adminCommentItem.CommentID) %>">
  68. <button class="btn btn-sm btn-outline-warning" type="submit">Unapprove</button>
  69. </form>
  70. <% Else %>
  71. <form class="d-inline" method="post" action="<%= AdminCommentApproveUrl(adminCommentItem.CommentID) %>">
  72. <button class="btn btn-sm btn-success" type="submit">Approve</button>
  73. </form>
  74. <% End If %>
  75. <form class="d-inline" method="post" action="<%= AdminCommentDeleteUrl(adminCommentItem.CommentID) %>">
  76. <button class="btn btn-sm btn-outline-danger" type="submit" onclick="return confirm('Delete this comment?')">Delete</button>
  77. </form>
  78. </td>
  79. </tr>
  80. <%
  81. Loop
  82. %>
  83. </tbody>
  84. </table>
  85. </div>
  86. <% End If %>

Powered by TurnKey Linux.