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

changeset 83
24a3596b8f98
parent 82
4ec7f2600c83
child 85
3d16ad54b3dc
--- a/src/main/webapp/WEB-INF/jsp/issue-form.jsp	Sat May 30 15:28:27 2020 +0200
+++ b/src/main/webapp/WEB-INF/jsp/issue-form.jsp	Sat May 30 18:05:06 2020 +0200
@@ -29,6 +29,7 @@
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 
 <jsp:useBean id="projects" type="java.util.List<de.uapcore.lightpit.entities.Project>" scope="request" />
+<jsp:useBean id="versions" type="java.util.List<de.uapcore.lightpit.entities.Version>" scope="request" />
 <jsp:useBean id="issue" type="de.uapcore.lightpit.entities.Issue" scope="request"/>
 <jsp:useBean id="issueStatusEnum" type="de.uapcore.lightpit.entities.IssueStatus[]" scope="request"/>
 <jsp:useBean id="issueCategoryEnum" type="de.uapcore.lightpit.entities.IssueCategory[]" scope="request"/>
@@ -44,13 +45,19 @@
         <tr>
             <th><fmt:message key="issue.project"/></th>
             <td>
+                <c:if test="${issue.project.id ge 0}">
+                    <c:out value="${issue.project.name}" />
+                    <input type="hidden" name="pid" value="${issue.project.id}" />
+                </c:if>
+                <c:if test="${empty issue.project or issue.project.id lt 0}">
                 <select name="pid" required>
                     <c:forEach var="project" items="${projects}">
-                        <option value="${project.id}" <c:if test="${project eq issue.project}">selected</c:if> >
+                        <option value="${project.id}">
                             <c:out value="${project.name}" />
                         </option>
                     </c:forEach>
                 </select>
+                </c:if>
             </td>
         </tr>
         <tr>
@@ -104,45 +111,32 @@
                 </select>
             </td>
         </tr>
+        <c:if test="${issue.project.id ge 0}">
         <tr>
-            <th>
-                <c:choose>
-                    <c:when test="${issue.affectedVersions.size() gt 1}">
-                        <fmt:message key="issue.affected-versions"/>
-                    </c:when>
-                    <c:otherwise>
-                        <fmt:message key="issue.affected-version"/>
-                    </c:otherwise>
-                </c:choose>
-            </th>
-            <td>TODO</td>
+            <th class="vtop"><fmt:message key="issue.affected-versions"/></th>
+            <td>
+                <c:set var="fieldname" value="affected"/>
+                <c:set var="data" value="${issue.affectedVersions}" />
+                <%@include file="../jspf/version-list.jsp"%>
+            </td>
         </tr>
         <tr>
-            <th>
-                <c:choose>
-                    <c:when test="${issue.scheduledVersions.size() gt 1}">
-                        <fmt:message key="issue.scheduled-versions"/>
-                    </c:when>
-                    <c:otherwise>
-                        <fmt:message key="issue.scheduled-version"/>
-                    </c:otherwise>
-                </c:choose>
-            </th>
-            <td>TODO</td>
+            <th class="vtop"><fmt:message key="issue.scheduled-versions"/></th>
+            <td>
+                <c:set var="fieldname" value="scheduled"/>
+                <c:set var="data" value="${issue.scheduledVersions}" />
+                <%@include file="../jspf/version-list.jsp"%>
+            </td>
         </tr>
         <tr>
-            <th>
-                <c:choose>
-                    <c:when test="${issue.resolvedVersions.size() gt 1}">
-                        <fmt:message key="issue.resolved-versions"/>
-                    </c:when>
-                    <c:otherwise>
-                        <fmt:message key="issue.resolved-version"/>
-                    </c:otherwise>
-                </c:choose>
-            </th>
-            <td>TODO</td>
+            <th class="vtop"><fmt:message key="issue.resolved-versions"/></th>
+            <td>
+                <c:set var="fieldname" value="resolved"/>
+                <c:set var="data" value="${issue.resolvedVersions}" />
+                <%@include file="../jspf/version-list.jsp"%>
+            </td>
         </tr>
+        </c:if>
         <tr>
             <th><fmt:message key="issue.eta"/></th>
             <td><input name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td>

mercurial