ASP Classic blog framework - BrainOrdure
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.9KB

  1. <div class="d-flex align-items-center justify-content-between mb-4">
  2. <div>
  3. <h1 class="h3 mb-1">Manage Posts</h1>
  4. <p class="text-muted mb-0">All posts &mdash; publish, edit, or delete.</p>
  5. </div>
  6. <a class="btn btn-primary" href="<%= PostNewUrl() %>">New Post</a>
  7. </div>
  8. <% If posts.Count = 0 Then %>
  9. <div class="alert alert-secondary">No posts yet. <a href="<%= PostNewUrl() %>">Create the first one.</a></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>Title</th>
  16. <th>Status</th>
  17. <th>Created</th>
  18. <th class="text-end">Actions</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. <%
  23. Dim adminPostIter, adminPostItem
  24. Set adminPostIter = posts.Iterator()
  25. Do While adminPostIter.HasNext
  26. Set adminPostItem = adminPostIter.GetNext()
  27. %>
  28. <tr>
  29. <td>
  30. <strong><%= H(adminPostItem.Title) %></strong>
  31. <% If Len(Trim(CStr(adminPostItem.Summary))) > 0 Then %>
  32. <div class="small text-muted"><%= H(adminPostItem.Summary) %></div>
  33. <% End If %>
  34. </td>
  35. <td class="text-nowrap">
  36. <% If adminPostItem.IsPublished = 1 Then %>
  37. <span class="badge bg-success">Published</span>
  38. <% Else %>
  39. <span class="badge bg-secondary">Draft</span>
  40. <% End If %>
  41. </td>
  42. <td class="small text-muted text-nowrap">
  43. <%= H(FormatDateTime(adminPostItem.CreatedDate, vbShortDate)) %>
  44. </td>
  45. <td class="text-end text-nowrap">
  46. <a class="btn btn-sm btn-outline-secondary" href="<%= PostEditUrl(adminPostItem.PostID) %>">Edit</a>
  47. <form class="d-inline" method="post" action="<%= AdminPostAIUrl(adminPostItem.PostID) %>">
  48. <button class="btn btn-sm btn-outline-info" type="submit">AI Content</button>
  49. </form>
  50. <% If adminPostItem.IsPublished = 1 Then %>
  51. <form class="d-inline" method="post" action="<%= AdminPostUnpublishUrl(adminPostItem.PostID) %>">
  52. <button class="btn btn-sm btn-outline-warning" type="submit">Unpublish</button>
  53. </form>
  54. <% Else %>
  55. <form class="d-inline" method="post" action="<%= AdminPostPublishUrl(adminPostItem.PostID) %>">
  56. <button class="btn btn-sm btn-success" type="submit">Publish</button>
  57. </form>
  58. <% End If %>
  59. <form class="d-inline" method="post" action="<%= PostDeleteUrl(adminPostItem.PostID) %>">
  60. <button class="btn btn-sm btn-outline-danger" type="submit" onclick="return confirm('Delete this post?')">Delete</button>
  61. </form>
  62. </td>
  63. </tr>
  64. <%
  65. Loop
  66. %>
  67. </tbody>
  68. </table>
  69. </div>
  70. <% End If %>

Powered by TurnKey Linux.