1.1 --- a/src/main/webapp/WEB-INF/jsp/projects.jsp Sat May 30 18:12:38 2020 +0200 1.2 +++ b/src/main/webapp/WEB-INF/jsp/projects.jsp Mon Jun 01 14:46:58 2020 +0200 1.3 @@ -25,15 +25,12 @@ 1.4 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.5 --%> 1.6 <%@page pageEncoding="UTF-8" %> 1.7 -<%@page import="de.uapcore.lightpit.modules.ProjectsModule" %> 1.8 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 1.9 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 1.10 1.11 -<c:set scope="page" var="selectedProject" value="${sessionScope[ProjectsModule.SESSION_ATTR_SELECTED_PROJECT]}"/> 1.12 +<jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.ProjectIndexView" scope="request"/> 1.13 1.14 -<jsp:useBean id="projects" type="java.util.List<de.uapcore.lightpit.entities.Project>" scope="request"/> 1.15 - 1.16 -<c:if test="${empty projects}"> 1.17 +<c:if test="${empty viewmodel.projects}"> 1.18 <div class="info-box"> 1.19 <fmt:message key="no-projects"/> 1.20 </div> 1.21 @@ -43,30 +40,35 @@ 1.22 <a href="./projects/edit" class="button"><fmt:message key="button.create"/></a> 1.23 </div> 1.24 1.25 -<c:if test="${not empty projects}"> 1.26 +<c:if test="${not empty viewmodel.projects}"> 1.27 <table id="project-list" class="datatable medskip"> 1.28 <colgroup> 1.29 <col> 1.30 <col width="20%"> 1.31 <col width="50%"> 1.32 - <col width="10%"> 1.33 - <col width="10%"> 1.34 - <col width="10%"> 1.35 + <col width="6%"> 1.36 + <col width="6%"> 1.37 + <col width="6%"> 1.38 + <col width="6%"> 1.39 + <col width="6%"> 1.40 </colgroup> 1.41 <thead> 1.42 <tr> 1.43 <th></th> 1.44 <th><fmt:message key="name"/></th> 1.45 <th><fmt:message key="repoUrl"/></th> 1.46 - <th><fmt:message key="issues.open"/></th> 1.47 - <th><fmt:message key="issues.active"/></th> 1.48 - <th><fmt:message key="issues.done"/></th> 1.49 + <th class="hcenter"><fmt:message key="version.latest"/></th> 1.50 + <th class="hcenter"><fmt:message key="version.next"/></th> 1.51 + <th class="hcenter"><fmt:message key="issues.open"/></th> 1.52 + <th class="hcenter"><fmt:message key="issues.active"/></th> 1.53 + <th class="hcenter"><fmt:message key="issues.done"/></th> 1.54 </tr> 1.55 </thead> 1.56 <tbody> 1.57 - <c:forEach var="project" items="${projects}"> 1.58 + <c:forEach var="projectInfo" items="${viewmodel.projects}"> 1.59 + <c:set var="project" scope="page" value="${projectInfo.project}"/> 1.60 <tr class="nowrap"> 1.61 - <td style="width: 2em;"><a href="./projects/edit?id=${project.id}">✎</a></td> 1.62 + <td style="width: 2em;"><a href="./projects/edit?pid=${project.id}">✎</a></td> 1.63 <td><a href="./projects/view?pid=${project.id}"><c:out value="${project.name}"/></a> 1.64 </td> 1.65 <td> 1.66 @@ -75,9 +77,19 @@ 1.67 value="${project.repoUrl}"/></a> 1.68 </c:if> 1.69 </td> 1.70 - <td>${project.openIssues}</td> 1.71 - <td>${project.activeIssues}</td> 1.72 - <td>${project.doneIssues}</td> 1.73 + <td class="hright"> 1.74 + <c:if test="${not empty projectInfo.latestVersion}"> 1.75 + <a href="./projects/versions/view?vid=${projectInfo.latestVersion.id}"><c:out value="${projectInfo.latestVersion.name}"/></a> 1.76 + </c:if> 1.77 + </td> 1.78 + <td class="hright"> 1.79 + <c:if test="${not empty projectInfo.nextVersion}"> 1.80 + <a href="./projects/versions/view?vid=${projectInfo.nextVersion.id}"><c:out value="${projectInfo.nextVersion.name}"/></a> 1.81 + </c:if> 1.82 + </td> 1.83 + <td class="hright">${projectInfo.issueSummary.open}</td> 1.84 + <td class="hright">${projectInfo.issueSummary.active}</td> 1.85 + <td class="hright">${projectInfo.issueSummary.done}</td> 1.86 </tr> 1.87 </c:forEach> 1.88 </tbody>