stack_detail.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <pstm-uri>/stacks/{stack_id}</pstm-uri>
  5. <pstm-template>main</pstm-template>
  6. </head>
  7. <body>
  8. <section>
  9. <h2 stm-if="stack != null && stack.exists" stm-text="stack.name">Stack</h2>
  10. <p stm-if="stack != null && !stack.exists" class="muted">Stack not found.</p>
  11. <div stm-if="stack != null && stack.exists">
  12. <p><a href="/stacks">All stacks</a></p>
  13. <div class="cards">
  14. <section class="card">
  15. <h3>Details</h3>
  16. <p class="muted" stm-if="stack.summary.length > 0" stm-text="stack.summary">summary</p>
  17. <p class="muted">Created <span stm-text="stack.created_display">when</span></p>
  18. </section>
  19. <section class="card">
  20. <h3>Edit</h3>
  21. <form stm-action="stack.update">
  22. <input type="hidden" name="stack_id" stm-attribute.value="stack.id">
  23. <div class="form-row"><label>Name</label>
  24. <input type="text" name="name" stm-attribute.value="stack.name"></div>
  25. <div class="form-row"><label>Summary</label>
  26. <input type="text" name="summary" stm-attribute.value="stack.summary"></div>
  27. <button type="submit">Save</button>
  28. </form>
  29. </section>
  30. </div>
  31. <h3>Projects in this stack</h3>
  32. <p class="muted">Applying the stack adds each of these to a project's or a goal's
  33. linked projects with the relationship shown here.</p>
  34. <table>
  35. <thead><tr><th>Project</th><th>Git URL</th><th>Relationship</th><th></th></tr></thead>
  36. <tbody>
  37. <tr stm-for-member-in="stack.members">
  38. <td><a stm-attribute.href="'/projects/' + member.project_id" stm-text="member.name">name</a></td>
  39. <td stm-text="member.git_url">git_url</td>
  40. <td><span stm-attribute.class="'badge badge-' + member.relationship" stm-text="member.relationship">relationship</span></td>
  41. <td><button type="button" stm-action="member.remove" stm-confirm="Remove this project from the stack?">Remove</button></td>
  42. </tr>
  43. <tr stm-if="stack.members.length == 0"><td colspan="4" class="muted">No projects in this stack yet.</td></tr>
  44. </tbody>
  45. </table>
  46. <form class="inline" stm-action="stack.add_member" stm-if="stack.options.length > 0">
  47. <label for="member-target">Add project</label>
  48. <select id="member-target" name="project_id" required>
  49. <option stm-for-option-in="stack.options" stm-attribute.value="option.id" stm-text="option.name">project</option>
  50. </select>
  51. <select name="relationship">
  52. <option value="reference" selected>reference</option>
  53. <option value="co-developed">co-developed</option>
  54. </select>
  55. <button type="submit">Add</button>
  56. </form>
  57. <form class="inline">
  58. <button type="button" stm-action="stack.delete" stm-confirm="Delete this stack? Its projects keep any links already applied.">Delete stack</button>
  59. </form>
  60. </div>
  61. </section>
  62. </body>
  63. </html>