src/main/webapp/WEB-INF/jsp/projects.jsp

changeset 86
0a658e53177c
parent 82
4ec7f2600c83
child 99
a369fb1b3aa2
--- a/src/main/webapp/WEB-INF/jsp/projects.jsp	Sat May 30 18:12:38 2020 +0200
+++ b/src/main/webapp/WEB-INF/jsp/projects.jsp	Mon Jun 01 14:46:58 2020 +0200
@@ -25,15 +25,12 @@
 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="viewmodel" type="de.uapcore.lightpit.viewmodel.ProjectIndexView" scope="request"/>
 
-<jsp:useBean id="projects" type="java.util.List<de.uapcore.lightpit.entities.Project>" scope="request"/>
-
-<c:if test="${empty projects}">
+<c:if test="${empty viewmodel.projects}">
     <div class="info-box">
         <fmt:message key="no-projects"/>
     </div>
@@ -43,30 +40,35 @@
     <a href="./projects/edit" class="button"><fmt:message key="button.create"/></a>
 </div>
 
-<c:if test="${not empty projects}">
+<c:if test="${not empty viewmodel.projects}">
     <table id="project-list" class="datatable medskip">
         <colgroup>
             <col>
             <col width="20%">
             <col width="50%">
-            <col width="10%">
-            <col width="10%">
-            <col width="10%">
+            <col width="6%">
+            <col width="6%">
+            <col width="6%">
+            <col width="6%">
+            <col width="6%">
         </colgroup>
         <thead>
         <tr>
             <th></th>
             <th><fmt:message key="name"/></th>
             <th><fmt:message key="repoUrl"/></th>
-            <th><fmt:message key="issues.open"/></th>
-            <th><fmt:message key="issues.active"/></th>
-            <th><fmt:message key="issues.done"/></th>
+            <th class="hcenter"><fmt:message key="version.latest"/></th>
+            <th class="hcenter"><fmt:message key="version.next"/></th>
+            <th class="hcenter"><fmt:message key="issues.open"/></th>
+            <th class="hcenter"><fmt:message key="issues.active"/></th>
+            <th class="hcenter"><fmt:message key="issues.done"/></th>
         </tr>
         </thead>
         <tbody>
-        <c:forEach var="project" items="${projects}">
+        <c:forEach var="projectInfo" items="${viewmodel.projects}">
+            <c:set var="project" scope="page" value="${projectInfo.project}"/>
             <tr class="nowrap">
-                <td style="width: 2em;"><a href="./projects/edit?id=${project.id}">&#x270e;</a></td>
+                <td style="width: 2em;"><a href="./projects/edit?pid=${project.id}">&#x270e;</a></td>
                 <td><a href="./projects/view?pid=${project.id}"><c:out value="${project.name}"/></a>
                 </td>
                 <td>
@@ -75,9 +77,19 @@
                                 value="${project.repoUrl}"/></a>
                     </c:if>
                 </td>
-                <td>${project.openIssues}</td>
-                <td>${project.activeIssues}</td>
-                <td>${project.doneIssues}</td>
+                <td class="hright">
+                    <c:if test="${not empty projectInfo.latestVersion}">
+                        <a href="./projects/versions/view?vid=${projectInfo.latestVersion.id}"><c:out value="${projectInfo.latestVersion.name}"/></a>
+                    </c:if>
+                </td>
+                <td class="hright">
+                    <c:if test="${not empty projectInfo.nextVersion}">
+                        <a href="./projects/versions/view?vid=${projectInfo.nextVersion.id}"><c:out value="${projectInfo.nextVersion.name}"/></a>
+                    </c:if>
+                </td>
+                <td class="hright">${projectInfo.issueSummary.open}</td>
+                <td class="hright">${projectInfo.issueSummary.active}</td>
+                <td class="hright">${projectInfo.issueSummary.done}</td>
             </tr>
         </c:forEach>
         </tbody>

mercurial