project_detail.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <pstm-uri>/projects/{project_id}</pstm-uri>
  5. <pstm-template>main</pstm-template>
  6. </head>
  7. <body>
  8. <section>
  9. <h2 stm-if="project != null && project.exists" stm-text="project.name">Project</h2>
  10. <p stm-if="project != null && !project.exists" class="muted">Project not found.</p>
  11. <div stm-if="project != null && project.exists">
  12. <p><a href="/projects">All projects</a></p>
  13. <div class="cards">
  14. <section class="card">
  15. <h3>Details</h3>
  16. <p><strong stm-text="project.git_url">git_url</strong> · branch
  17. <em stm-text="project.default_branch">main</em></p>
  18. <p class="muted" stm-if="project.summary.length > 0" stm-text="project.summary">summary</p>
  19. <p class="muted">Created <span stm-text="project.created_display">when</span></p>
  20. </section>
  21. <section class="card">
  22. <h3>Edit</h3>
  23. <form stm-action="project.update">
  24. <input type="hidden" name="project_id" stm-attribute.value="project.id">
  25. <div class="form-row"><label>Name</label>
  26. <input type="text" name="name" stm-attribute.value="project.name"></div>
  27. <div class="form-row"><label>Git URL</label>
  28. <input type="text" name="git_url" stm-attribute.value="project.git_url"></div>
  29. <div class="form-row"><label>Branch</label>
  30. <input type="text" name="default_branch" stm-attribute.value="project.default_branch"></div>
  31. <div class="form-row"><label>Summary</label>
  32. <input type="text" name="summary" stm-attribute.value="project.summary"></div>
  33. <button type="submit">Save</button>
  34. </form>
  35. </section>
  36. </div>
  37. <h3>Linked projects</h3>
  38. <table>
  39. <thead><tr><th>Project</th><th>Git URL</th><th>Relationship</th><th></th></tr></thead>
  40. <tbody>
  41. <tr stm-for-link-in="project.links">
  42. <td><a stm-attribute.href="'/projects/' + link.project_id" stm-text="link.name">name</a></td>
  43. <td stm-text="link.git_url">git_url</td>
  44. <td><span stm-attribute.class="'badge badge-' + link.relationship" stm-text="link.relationship">relationship</span></td>
  45. <td><button type="button" stm-action="link.remove" stm-confirm="Remove this link?">Remove</button></td>
  46. </tr>
  47. <tr stm-if="project.links.length == 0"><td colspan="4" class="muted">No linked projects.</td></tr>
  48. </tbody>
  49. </table>
  50. <form class="inline" stm-action="project.add_link">
  51. <label for="link-target">Link project</label>
  52. <select id="link-target" name="linked_project_id" required>
  53. <option stm-for-option-in="project.linkable" stm-attribute.value="option.id" stm-text="option.name">project</option>
  54. </select>
  55. <select name="relationship">
  56. <option value="co-developed">co-developed</option>
  57. <option value="reference">reference</option>
  58. </select>
  59. <button type="submit">Add link</button>
  60. </form>
  61. <form class="inline" stm-action="project.apply_stack" stm-if="project.stack_options.length > 0">
  62. <label for="stack-target">Apply stack</label>
  63. <select id="stack-target" name="stack_id" required>
  64. <option stm-for-stack-in="project.stack_options" stm-attribute.value="stack.id"
  65. stm-text="stack.name + ' (' + stack.member_count + ')'">stack</option>
  66. </select>
  67. <button type="submit">Apply</button>
  68. </form>
  69. <p class="muted" stm-if="project.stack_options.length == 0">Manage reference
  70. collections on the <a href="/stacks">stacks page</a> and apply them here.</p>
  71. <h3>Rules</h3>
  72. <p class="muted">Attached rules ride along with every task dispatched for this project.</p>
  73. <div stm-for-rule-in="project.rules" stm-key="rule.link_id" class="card">
  74. <h3 stm-text="rule.name">name</h3>
  75. <div class="md" stm-markdown="rule.body">body</div>
  76. <form class="inline">
  77. <button type="button" stm-action="rule.detach" stm-confirm="Detach this rule?">Detach</button>
  78. </form>
  79. </div>
  80. <p stm-if="project.rules.length == 0" class="muted">No rules attached.</p>
  81. <form class="inline" stm-action="project.attach_rule" stm-if="project.rule_options.length > 0">
  82. <label for="rule-target">Attach rule</label>
  83. <select id="rule-target" name="rule_id" required>
  84. <option stm-for-option-in="project.rule_options" stm-attribute.value="option.id"
  85. stm-text="option.name">rule</option>
  86. </select>
  87. <button type="submit">Attach</button>
  88. </form>
  89. <p class="muted" stm-if="project.rule_options.length == 0">Create rules on the <a href="/rules">rules page</a>.</p>
  90. <h3>Project notes</h3>
  91. <p class="muted">Written by agents via <code>saddle note</code>; curated here — delete what
  92. stops being useful. There is no manual create.</p>
  93. <div stm-for-note-in="project.notes" stm-key="note.id" class="card">
  94. <p><span class="badge" stm-text="note.project_name">project</span>
  95. <span class="muted" stm-text="note.created_display">when</span>
  96. <span class="muted" stm-if="note.source_task_id > 0"> · from task
  97. <a stm-attribute.href="'/tasks/' + note.source_task_id" stm-text="'#' + note.source_task_id">task</a></span></p>
  98. <div class="md" stm-markdown="note.body">body</div>
  99. <form class="inline">
  100. <button type="button" stm-action="note.delete" stm-confirm="Delete this note?">Delete</button>
  101. </form>
  102. </div>
  103. <p stm-if="project.notes.length == 0" class="muted">No notes yet — they appear as agents
  104. record them with <code>saddle note</code>.</p>
  105. <h3>Tasks in this project</h3>
  106. <table>
  107. <thead><tr><th>#</th><th>Title</th><th>Status</th><th>Priority</th></tr></thead>
  108. <tbody>
  109. <tr stm-for-task-in="project.tasks">
  110. <td stm-text="task.id">id</td>
  111. <td><a stm-attribute.href="'/tasks/' + task.id" stm-text="task.title">title</a>
  112. </td>
  113. <td><span stm-attribute.class="'badge badge-' + task.status" stm-text="task.display">status</span></td>
  114. <td stm-text="task.priority">priority</td>
  115. </tr>
  116. <tr stm-if="project.tasks.length == 0"><td colspan="4" class="muted">No tasks yet — create one from the <a href="/tasks">queue</a>.</td></tr>
  117. </tbody>
  118. </table>
  119. </div>
  120. </section>
  121. </body>
  122. </html>