src/main/webapp/WEB-INF/jsp/project-details.jsp

changeset 80
27a25f32048e
parent 78
bb4c52bf3439
child 81
1a2e7b5d48f7
--- a/src/main/webapp/WEB-INF/jsp/project-details.jsp	Sat May 23 14:13:09 2020 +0200
+++ b/src/main/webapp/WEB-INF/jsp/project-details.jsp	Sun May 24 15:30:43 2020 +0200
@@ -25,87 +25,46 @@
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 --%>
 <%@page pageEncoding="UTF-8" %>
-<%@page import="de.uapcore.lightpit.modules.ProjectsModule" %>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 
-<c:set scope="page" var="selectedProject" value="${sessionScope[ProjectsModule.SESSION_ATTR_SELECTED_PROJECT]}"/>
-
 <jsp:useBean id="versions" type="java.util.List<de.uapcore.lightpit.entities.Version>" scope="request"/>
-<jsp:useBean id="issues" type="java.util.List<de.uapcore.lightpit.entities.Issue>" scope="request"/>
+<jsp:useBean id="statsAffected" type="java.util.List<de.uapcore.lightpit.entities.VersionStatistics>" scope="request"/>
+<jsp:useBean id="statsScheduled" type="java.util.List<de.uapcore.lightpit.entities.VersionStatistics>" scope="request"/>
+<jsp:useBean id="statsResolved" type="java.util.List<de.uapcore.lightpit.entities.VersionStatistics>" 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"/>
+<jsp:useBean id="statsHideZeros" type="java.lang.Boolean" scope="request"/>
 
 <div id="tool-area">
     <a href="./projects/versions/edit" class="button"><fmt:message key="button.version.create"/></a>
     <a href="./projects/issues/edit" class="button"><fmt:message key="button.issue.create"/></a>
+    <a href="./projects/issues/" class="button"><fmt:message key="button.issue.list"/></a>
+    <c:if test="${not statsHideZeros}">
+    <a href="./projects/view?reduced=1" class="button"><fmt:message key="button.stats.hidezeros"/></a>
+    </c:if>
+    <c:if test="${statsHideZeros}">
+    <a href="./projects/view?reduced=0" class="button"><fmt:message key="button.stats.showzeros"/></a>
+    </c:if>
 </div>
 
-<c:if test="${not empty versions}">
-    <table id="version-list" class="datatable medskip">
-        <thead>
-        <tr>
-            <th></th>
-            <th><fmt:message key="thead.version.name"/></th>
-            <th><fmt:message key="thead.version.status"/></th>
-        </tr>
-        </thead>
-        <tbody>
-        <c:forEach var="version" items="${versions}">
-            <tr class="nowrap">
-                <td style="width: 2em;"><a href="./projects/versions/edit?id=${version.id}">&#x270e;</a>
-                </td>
-                <td><c:out value="${version.name}"/></td>
-                <td><fmt:message key="version.status.${version.status}"/></td>
-            </tr>
-        </c:forEach>
-        </tbody>
-    </table>
-</c:if>
+<div id="version-stats">
+<c:forEach var="version" items="${versions}" varStatus="iter">
+    <h2>
+        <fmt:message key="version.label" /> <c:out value="${version.name}" /> - <fmt:message key="version.status.${version.status}"/>
+        <a href="./projects/versions/edit?id=${version.id}">&#x270e;</a>
+    </h2>
 
-<table id="issue-list" class="datatable medskip">
-    <thead>
-    <tr>
-        <th><fmt:message key="thead.issue.subject"/></th>
-        <th><fmt:message key="thead.issue.assignee"/></th>
-        <th><fmt:message key="thead.issue.category"/></th>
-        <th><fmt:message key="thead.issue.status"/></th>
-        <th><fmt:message key="thead.issue.created"/></th>
-        <th><fmt:message key="thead.issue.updated"/></th>
-        <th><fmt:message key="thead.issue.eta"/></th>
-        <!-- TODO: add other information -->
-    </tr>
-    </thead>
-    <tbody>
-    <c:forEach var="issue" items="${issues}">
-        <tr>
-            <td>
-                <a href="./projects/issues/edit?id=${issue.id}">
-                <c:out value="${issue.subject}" />
-                </a>
-            </td>
-            <td>
-                <c:if test="${not empty issue.assignee}">
-                    <c:out value="${issue.assignee.shortDisplayname}" />
-                </c:if>
-                <c:if test="${empty issue.assignee}">
-                    <fmt:message key="placeholder.null-assignee" />
-                </c:if>
-            </td>
-            <td>
-                <fmt:message key="issue.category.${issue.category}" />
-            </td>
-            <td>
-                <fmt:message key="issue.status.${issue.status}" />
-            </td>
-            <td>
-                <fmt:formatDate value="${issue.created}" type="BOTH"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${issue.updated}" type="BOTH"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${issue.eta}" />
-            </td>
-        </tr>
-    </c:forEach>
-    </tbody>
-</table>
+    <h3><fmt:message key="version.statistics.affected" /></h3>
+    <c:set var="stats" value="${statsAffected[iter.index]}" />
+    <%@include file="../jspf/version-stats.jsp" %>
+
+    <h3><fmt:message key="version.statistics.scheduled" /></h3>
+    <c:set var="stats" value="${statsScheduled[iter.index]}" />
+    <%@include file="../jspf/version-stats.jsp" %>
+
+    <h3><fmt:message key="version.statistics.resolved" /></h3>
+    <c:set var="stats" value="${statsResolved[iter.index]}" />
+    <%@include file="../jspf/version-stats.jsp" %>
+</c:forEach>
+</div>

mercurial