stacks.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <pstm-uri>/stacks</pstm-uri>
  5. <pstm-template>main</pstm-template>
  6. </head>
  7. <body>
  8. <div class="stack">
  9. <div class="cluster cluster-between">
  10. <h2>Stacks</h2>
  11. <button type="button" class="btn-primary"
  12. onclick="window.openAppDialog('stack-create-dialog')">+ New stack</button>
  13. </div>
  14. <p class="text-muted">Named bundles of reference projects — apply one to a project or a
  15. goal to attach its whole collection of links in a single click.</p>
  16. <p stm-if="stacks == null">Loading…</p>
  17. <div stm-if="stacks != null">
  18. <div class="table-wrap">
  19. <table stm-if="stacks.stacks.length >
  20. 0" class="table-hover">
  21. <thead><tr><th>#</th><th>Name</th><th>Projects</th><th>Summary</th><th>Created</th></tr></thead>
  22. <tbody>
  23. <tr stm-for-stack-in="stacks.stacks">
  24. <td stm-text="stack.id">id</td>
  25. <td><a stm-attribute.href="'/stacks/' + stack.id" stm-text="stack.name">name</a></td>
  26. <td stm-text="stack.member_count">0</td>
  27. <td class="text-muted" stm-text="stack.summary">summary</td>
  28. <td class="text-muted" stm-text="stack.created_display">when</td>
  29. </tr>
  30. </tbody>
  31. </table>
  32. </div>
  33. <p stm-if="stacks.stacks.length == 0" class="text-muted">No stacks yet.</p>
  34. </div>
  35. </div>
  36. <!-- Goal 41 T4: the create form moved from a collapsed expander
  37. into a Spry <dialog> behind the "+ New stack" button - same
  38. fields, same stm-action. -->
  39. <dialog id="stack-create-dialog" class="dialog-sm">
  40. <div class="dialog-titlebar">
  41. <p class="dialog-title">New stack</p>
  42. <button type="button" class="dialog-close" aria-label="Close"
  43. onclick="window.closeAppDialog('stack-create-dialog')">×</button>
  44. </div>
  45. <form stm-action="stacks.create">
  46. <div class="dialog-body form-rows">
  47. <div class="field"><label for="stack-name">Name</label>
  48. <input type="text" id="stack-name" name="name" required placeholder="Web stack references"></div>
  49. <div class="field"><label for="stack-summary">Summary <span class="text-muted">(optional)</span></label>
  50. <input type="text" id="stack-summary" name="summary" placeholder="What this collection is for"></div>
  51. </div>
  52. <div class="dialog-footer">
  53. <button type="button" class="btn-ghost"
  54. onclick="window.closeAppDialog('stack-create-dialog')">Cancel</button>
  55. <button type="submit" class="btn-primary">Create stack</button>
  56. </div>
  57. </form>
  58. </dialog>
  59. </body>
  60. </html>