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

changeset 86
0a658e53177c
parent 85
3d16ad54b3dc
child 88
1438e5a22c55
equal deleted inserted replaced
85:3d16ad54b3dc 86:0a658e53177c
26 --%> 26 --%>
27 <%@page pageEncoding="UTF-8" %> 27 <%@page pageEncoding="UTF-8" %>
28 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 28 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
29 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 29 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
30 30
31 <jsp:useBean id="projects" type="java.util.List<de.uapcore.lightpit.entities.Project>" scope="request" /> 31 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.IssueEditView" scope="request"/>
32 <jsp:useBean id="versions" type="java.util.List<de.uapcore.lightpit.entities.Version>" scope="request" /> 32 <c:set var="issue" scope="page" value="${viewmodel.issue}" />
33 <jsp:useBean id="issue" type="de.uapcore.lightpit.entities.Issue" scope="request"/> 33 <c:set var="versions" value="${viewmodel.versions}" />
34 <jsp:useBean id="issueStatusEnum" type="de.uapcore.lightpit.entities.IssueStatus[]" scope="request"/>
35 <jsp:useBean id="issueCategoryEnum" type="de.uapcore.lightpit.entities.IssueCategory[]" scope="request"/>
36 <jsp:useBean id="users" type="java.util.List<de.uapcore.lightpit.entities.User>" scope="request"/>
37 34
38 <form action="./projects/issues/commit" method="post"> 35 <form action="./projects/issues/commit" method="post">
39 <table class="formtable"> 36 <table class="formtable">
40 <colgroup> 37 <colgroup>
41 <col> 38 <col>
43 </colgroup> 40 </colgroup>
44 <tbody> 41 <tbody>
45 <tr> 42 <tr>
46 <th><fmt:message key="issue.project"/></th> 43 <th><fmt:message key="issue.project"/></th>
47 <td> 44 <td>
48 <c:if test="${issue.project.id ge 0}"> 45 <c:choose>
49 <c:out value="${issue.project.name}" /> 46 <c:when test="${not empty issue.project}">
50 <input type="hidden" name="pid" value="${issue.project.id}" /> 47 <c:out value="${issue.project.name}" />
51 </c:if> 48 <input type="hidden" name="pid" value="${issue.project.id}" />
52 <c:if test="${empty issue.project or issue.project.id lt 0}"> 49 </c:when>
53 <select name="pid" required> 50 <c:otherwise>
54 <c:forEach var="project" items="${projects}"> 51 <select name="pid" required>
55 <option value="${project.id}"> 52 <c:forEach var="project" items="${viewmodel.projects}">
56 <c:out value="${project.name}" /> 53 <option value="${project.id}">
57 </option> 54 <c:out value="${project.name}" />
58 </c:forEach> 55 </option>
59 </select> 56 </c:forEach>
60 </c:if> 57 </select>
58 </c:otherwise>
59 </c:choose>
61 </td> 60 </td>
62 </tr> 61 </tr>
63 <tr> 62 <tr>
64 <th><fmt:message key="issue.category"/></th> 63 <th><fmt:message key="issue.category"/></th>
65 <td> 64 <td>
66 <select name="category"> 65 <select name="category">
67 <c:forEach var="category" items="${issueCategoryEnum}"> 66 <c:forEach var="category" items="${viewmodel.issueCategory}">
68 <option 67 <option
69 <c:if test="${category eq issue.category}">selected</c:if> 68 <c:if test="${category eq issue.category}">selected</c:if>
70 value="${category}"> 69 value="${category}">
71 <fmt:message key="issue.category.${category}" /> 70 <fmt:message key="issue.category.${category}" />
72 </option> 71 </option>
76 </tr> 75 </tr>
77 <tr> 76 <tr>
78 <th><fmt:message key="issue.status"/></th> 77 <th><fmt:message key="issue.status"/></th>
79 <td> 78 <td>
80 <select name="status"> 79 <select name="status">
81 <c:forEach var="status" items="${issueStatusEnum}"> 80 <c:forEach var="status" items="${viewmodel.issueStatus}">
82 <option 81 <option
83 <c:if test="${status eq issue.status}">selected</c:if> 82 <c:if test="${status eq issue.status}">selected</c:if>
84 value="${status}"> 83 value="${status}">
85 <fmt:message key="issue.status.${status}" /> 84 <fmt:message key="issue.status.${status}" />
86 </option> 85 </option>
93 <td><input name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td> 92 <td><input name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td>
94 </tr> 93 </tr>
95 <tr> 94 <tr>
96 <th class="vtop"><fmt:message key="issue.description"/></th> 95 <th class="vtop"><fmt:message key="issue.description"/></th>
97 <td> 96 <td>
98 <textarea name="description"><c:out value="${issue.description}"/></textarea> 97 <textarea name="description" rows="10"><c:out value="${issue.description}"/></textarea>
99 </td> 98 </td>
100 </tr> 99 </tr>
101 <tr> 100 <tr>
102 <th><fmt:message key="issue.assignee"/></th> 101 <th><fmt:message key="issue.assignee"/></th>
103 <td> 102 <td>
104 <select name="assignee"> 103 <select name="assignee">
105 <option value="-1"><fmt:message key="placeholder.null-assignee"/></option> 104 <option value="-1"><fmt:message key="placeholder.null-assignee"/></option>
106 <c:forEach var="user" items="${users}"> 105 <c:forEach var="user" items="${viewmodel.users}">
107 <option 106 <option
108 <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if> 107 <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if>
109 value="${user.id}"><c:out value="${user.displayname}"/></option> 108 value="${user.id}"><c:out value="${user.displayname}"/></option>
110 </c:forEach> 109 </c:forEach>
111 </select> 110 </select>
153 <tfoot> 152 <tfoot>
154 <tr> 153 <tr>
155 <td colspan="2"> 154 <td colspan="2">
156 <input type="hidden" name="id" value="${issue.id}"/> 155 <input type="hidden" name="id" value="${issue.id}"/>
157 <c:choose> 156 <c:choose>
158 <c:when test="${not empty issue.project and issue.project.id ge 0}"> 157 <c:when test="${not empty issue.project}">
159 <c:set var="cancelUrl">./projects/issues/?pid=${issue.project.id}</c:set> 158 <c:set var="cancelUrl">./projects/issues/?pid=${issue.project.id}</c:set>
160 </c:when> 159 </c:when>
161 <c:otherwise> 160 <c:otherwise>
162 <c:set var="cancelUrl">./projects/</c:set> 161 <c:set var="cancelUrl">./projects/</c:set>
163 </c:otherwise> 162 </c:otherwise>

mercurial