ASP Classic blog framework - BrainOrdure
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.

94 lines
3.2KB

  1. <article class="card shadow-sm mb-4">
  2. <div class="card-body">
  3. <div class="mb-3">
  4. <a href="/posts" class="small text-decoration-none">&larr; Back to posts</a>
  5. </div>
  6. <h1 class="h2 mb-2"><%= H(post.Title) %></h1>
  7. <%
  8. Dim publishedText
  9. publishedText = ""
  10. If IsDate(post.PublishedDate) Then
  11. If CDate(post.PublishedDate) > #1/1/1970# Then
  12. publishedText = FormatDateTime(post.PublishedDate, vbLongDate)
  13. End If
  14. End If
  15. If Len(publishedText) > 0 Then
  16. %>
  17. <p class="text-muted"><%= H(publishedText) %></p>
  18. <%
  19. End If
  20. Dim postBody
  21. postBody = H(post.Body)
  22. postBody = Replace(postBody, vbCrLf, "<br>")
  23. postBody = Replace(postBody, vbCr, "<br>")
  24. postBody = Replace(postBody, vbLf, "<br>")
  25. %>
  26. <div class="fs-5 lh-lg"><%= postBody %></div>
  27. </div>
  28. </article>
  29. <!-- Comments -->
  30. <section class="mt-2">
  31. <h2 class="h4 mb-3">Comments (<%= comments.Count %>)</h2>
  32. <% If comments.Count = 0 Then %>
  33. <p class="text-muted mb-4">No comments yet. Be the first to leave one below.</p>
  34. <% Else %>
  35. <%
  36. Dim commentIter, commentItem
  37. Set commentIter = comments.Iterator()
  38. Do While commentIter.HasNext
  39. Set commentItem = commentIter.GetNext()
  40. %>
  41. <div class="card shadow-sm mb-3">
  42. <div class="card-body">
  43. <div class="d-flex justify-content-between mb-2">
  44. <strong class="small"><%= H(commentItem.AuthorName) %></strong>
  45. <span class="small text-muted"><%= H(FormatDateTime(commentItem.CreatedDate, vbLongDate)) %></span>
  46. </div>
  47. <%
  48. Dim commentBody
  49. commentBody = H(commentItem.Body)
  50. commentBody = Replace(commentBody, vbCrLf, "<br>")
  51. commentBody = Replace(commentBody, vbCr, "<br>")
  52. commentBody = Replace(commentBody, vbLf, "<br>")
  53. %>
  54. <p class="mb-0"><%= commentBody %></p>
  55. </div>
  56. </div>
  57. <%
  58. Loop
  59. %>
  60. <% End If %>
  61. <!-- Comment form -->
  62. <div class="card shadow-sm mt-4">
  63. <div class="card-body">
  64. <h3 class="h5 mb-3">Leave a Comment</h3>
  65. <form method="post" action="/comments">
  66. <input type="hidden" name="PostID" value="<%= H(post.PostID) %>">
  67. <input type="hidden" name="PostSlug" value="<%= H(post.Slug) %>">
  68. <div class="mb-3">
  69. <label class="form-label" for="AuthorName">Name <span class="text-danger">*</span></label>
  70. <input class="form-control" type="text" id="AuthorName" name="AuthorName" required>
  71. </div>
  72. <div class="mb-3">
  73. <label class="form-label" for="AuthorEmail">Email <span class="text-muted small">(optional, not displayed)</span></label>
  74. <input class="form-control" type="email" id="AuthorEmail" name="AuthorEmail">
  75. </div>
  76. <div class="mb-3">
  77. <label class="form-label" for="Body">Comment <span class="text-danger">*</span></label>
  78. <textarea class="form-control" id="Body" name="Body" rows="4" required></textarea>
  79. </div>
  80. <button class="btn btn-primary" type="submit">Submit Comment</button>
  81. <p class="small text-muted mt-2 mb-0">Comments are reviewed before appearing.</p>
  82. </form>
  83. </div>
  84. </div>
  85. </section>

Powered by TurnKey Linux.