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

changeset 184
e8eecee6aadf
parent 181
502a10e24b85
child 185
5ec9fcfbdf9c
--- a/src/main/webapp/WEB-INF/jsp/issue-form.jsp	Sat Jan 23 14:47:59 2021 +0100
+++ b/src/main/webapp/WEB-INF/jsp/issue-form.jsp	Fri Apr 02 11:59:14 2021 +0200
@@ -29,10 +29,15 @@
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 
 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.IssueEditView" scope="request"/>
-<c:set var="issue" scope="page" value="${viewmodel.issue}" />
 
-<%-- TODO: change to ./issues/commit --%>
-<form action="./projects/commit-issue" method="post">
+<c:set var="issue" scope="page" value="${viewmodel.issue}" />
+<c:set var="project" scope="page" value="${viewmodel.project}"/>
+<c:set var="component" scope="page" value="${viewmodel.component}"/>
+<c:set var="version" scope="page" value="${viewmodel.version}"/>
+
+<c:set var="issuesHref" value="./projects/${project.node}/issues/${empty version ? '-' : version.node }/${empty component ? '-' : component.node}/"/>
+
+<form action="${issuesHref}-/commit-issue" method="post">
     <table class="formtable fullwidth">
         <colgroup>
             <col>
@@ -49,12 +54,12 @@
             <th><fmt:message key="project"/></th>
             <td>
                 <c:choose>
-                    <c:when test="${not empty issue.project}">
+                    <c:when test="${issue.project.id ge 0}">
                         <c:out value="${issue.project.name}" />
-                        <input type="hidden" name="pid" value="${issue.project.id}" />
+                        <input type="hidden" name="project" value="${issue.project.id}" />
                     </c:when>
                     <c:otherwise>
-                        <select name="pid" required>
+                        <select name="project" required>
                             <c:forEach var="project" items="${viewmodel.projects}">
                                 <option value="${project.id}">
                                     <c:out value="${project.name}" />
@@ -179,13 +184,12 @@
                 <label for="create-another"><fmt:message key="button.issue.create.another"/> </label>
                 <input type="hidden" name="id" value="${issue.id}"/>
                 <c:if test="${issue.id ge 0}">
-                <a href="./projects/${issue.project.node}/issues/${issue.id}/view" class="button">
+                <a href="${issuesHref}${issue.id}" class="button">
                     <fmt:message key="button.cancel"/>
                 </a>
                 </c:if>
                 <c:if test="${issue.id lt 0}">
-                    <%-- TODO: fix #14 --%>
-                    <a href="./projects/${issue.project.node}/all-components/all-versions/issues/" class="button">
+                    <a href="${issuesHref}" class="button">
                         <fmt:message key="button.cancel"/>
                     </a>
                 </c:if>

mercurial