ASP Classic blog framework - BrainOrdure
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

69 行
2.7KB

  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="/posts/new">New Post</a>
  7. </div>
  8. <% If posts.Count = 0 Then %>
  9. <div class="alert alert-secondary">No posts yet. <a href="/posts/new">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="/posts/<%= Server.URLEncode(CStr(adminPostItem.PostID)) %>/edit">Edit</a>
  47. <% If adminPostItem.IsPublished = 1 Then %>
  48. <form class="d-inline" method="post" action="/admin/posts/<%= H(adminPostItem.PostID) %>/unpublish">
  49. <button class="btn btn-sm btn-outline-warning" type="submit">Unpublish</button>
  50. </form>
  51. <% Else %>
  52. <form class="d-inline" method="post" action="/admin/posts/<%= H(adminPostItem.PostID) %>/publish">
  53. <button class="btn btn-sm btn-success" type="submit">Publish</button>
  54. </form>
  55. <% End If %>
  56. <form class="d-inline" method="post" action="/posts/<%= H(adminPostItem.PostID) %>/delete">
  57. <button class="btn btn-sm btn-outline-danger" type="submit" onclick="return confirm('Delete this post?')">Delete</button>
  58. </form>
  59. </td>
  60. </tr>
  61. <%
  62. Loop
  63. %>
  64. </tbody>
  65. </table>
  66. </div>
  67. <% End If %>

Powered by TurnKey Linux.