src/main/webapp/WEB-INF/jsp/issue-view.jsp

changeset 263
aa22103809cd
parent 231
dcb1d5a7ea3a
child 264
7d67245e5121
--- a/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Fri Dec 30 13:21:09 2022 +0100
+++ b/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Fri Dec 30 19:04:34 2022 +0100
@@ -155,7 +155,73 @@
     </a>
 </div>
 
-<hr class="comments-separator"/>
+<hr class="issue-view-separator"/>
+<h2>
+    <fmt:message key="issue.relations"/>
+</h2>
+<form id="relation-form" action="${issuesHref}${issue.id}/relation" method="post">
+<c:if test="${not empty viewmodel.relationError}">
+    <div class="error-box">
+        <fmt:message key="${viewmodel.relationError}"/>
+    </div>
+</c:if>
+<table class="issue-view relation-editor fullwidth">
+    <colgroup>
+        <col>
+        <col>
+        <col class="fullwidth">
+    </colgroup>
+    <thead>
+    <tr>
+        <th></th>
+        <th><fmt:message key="issue.relations.type"/></th>
+        <th><fmt:message key="issue.relations.issue"/></th>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>
+            <button type="submit"><fmt:message key="button.add"/></button>
+        </td>
+        <td>
+            <select name="type">
+                <c:forEach var="type" items="${viewmodel.relationTypes}">
+                    <option value="${type}"><fmt:message key="issue.relations.type.${type}"/></option>
+                    <c:if test="${not type.bidi}">
+                    <option value="!${type}"><fmt:message key="issue.relations.type.${type}.rev"/></option>
+                    </c:if>
+                </c:forEach>
+            </select>
+        </td>
+        <td>
+            <input name="issue" list="linkable-issues">
+            <datalist id="linkable-issues">
+                <c:forEach var="linkableIssue" items="${viewmodel.linkableIssues}">
+                    <option value="#${linkableIssue.id} - <c:out value="${linkableIssue.subject}"/> (<fmt:message key="issue.status.${linkableIssue.status}" />)"></option>
+                </c:forEach>
+            </datalist>
+        </td>
+    </tr>
+    <c:forEach var="relation" items="${viewmodel.currentRelations}">
+        <tr>
+            <td>
+                <a href="${issuesHref}${issue.id}/removeRelation?to=${relation.to.id}&type=${relation.type}&reverse=${relation.reverse}" class="button submit">
+                    <fmt:message key="button.remove"/>
+                </a>
+            </td>
+            <td><fmt:message key="issue.relations.type.${relation.type}${relation.reverse?'.rev':''}"/></td>
+            <td>
+                <a href="${issuesHref}${relation.to.id}">
+                    #${relation.to.id} - <c:out value="${relation.to.subject}"/> (<fmt:message key="issue.status.${relation.to.status}" />)
+                </a>
+            </td>
+        </tr>
+    </c:forEach>
+    </tbody>
+</table>
+</form>
+
+<hr class="issue-view-separator"/>
 <h2>
     <fmt:message key="issue.comments"/>
     <c:if test="${not empty viewmodel.comments}">

mercurial