--- a/src/main/webapp/WEB-INF/jsp/project-details.jsp Sat May 30 18:12:38 2020 +0200 +++ b/src/main/webapp/WEB-INF/jsp/project-details.jsp Mon Jun 01 14:46:58 2020 +0200 @@ -28,66 +28,46 @@ <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<jsp:useBean id="project" type="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="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"/> +<jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.ProjectView" scope="request" /> -<div id="project-attributes"> - <div class="row"> - <div class="caption"><fmt:message key="name"/>:</div> - <div><c:out value="${project.name}"/></div> - <div class="caption"><fmt:message key="description"/>:</div> - <div><c:out value="${project.description}"/></div> - </div> - <div class="row"> - <div class="caption"><fmt:message key="owner"/>:</div> - <div> - <c:if test="${not empty project.owner}"><c:out value="${project.owner.displayname}"/></c:if> - </div> - <div class="caption"><fmt:message key="repoUrl"/>:</div> - <div> - <c:if test="${not empty project.repoUrl}"> - <a target="_blank" href="<c:out value="${project.repoUrl}"/>"><c:out - value="${project.repoUrl}"/></a> - </c:if> - </div> - </div> -</div> +<c:set var="project" scope="page" value="${viewmodel.project}"/> +<%@include file="../jspf/project-header.jsp"%> <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> + <a href="./projects/issues/edit?pid=${project.id}" class="button"><fmt:message key="button.issue.create"/></a> </div> -<div id="version-stats"> -<c:forEach var="version" items="${versions}" varStatus="iter"> +<h2><fmt:message key="progress" /></h2> + +<c:set var="summary" value="${viewmodel.issuesTotal}" /> +<%@include file="../jspf/issue-summary.jsp"%> + +<h2><fmt:message key="issue.without-version" /></h2> + +<c:set var="issues" value="${viewmodel.issuesWithoutVersion}"/> +<c:set var="summary" value="${viewmodel.issuesWithoutVersionTotal}" /> +<%@include file="../jspf/issue-summary.jsp"%> +<%@include file="../jspf/issue-list.jsp"%> + +<c:forEach var="versionInfo" items="${viewmodel.versionInfos}"> <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}">✎</a> + <fmt:message key="version.label" /> <c:out value="${versionInfo.version.name}" /> - <fmt:message key="version.status.${versionInfo.version.status}"/> + (<a href="./projects/versions/view?vid=${versionInfo.version.id}">open</a>) </h2> - <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="issues.reported"/> </h3> + <c:set var="summary" value="${versionInfo.reportedTotal}"/> + <c:set var="issues" value="${versionInfo.reported}"/> + <%@include file="../jspf/issue-summary.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="issues.scheduled"/> </h3> + <c:set var="summary" value="${versionInfo.scheduledTotal}"/> + <c:set var="issues" value="${versionInfo.scheduled}"/> + <%@include file="../jspf/issue-summary.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> + <h3><fmt:message key="issues.resolved"/> </h3> + <c:set var="summary" value="${versionInfo.resolvedTotal}"/> + <c:set var="issues" value="${versionInfo.resolved}"/> + <%@include file="../jspf/issue-summary.jsp"%> +</c:forEach> \ No newline at end of file