highlight passed ETA - fixes #23

Fri, 23 Oct 2020 12:26:08 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 23 Oct 2020 12:26:08 +0200
changeset 144
7e06b75cf1b9
parent 143
4a391ffa30d3
child 145
6d2d69fd1c12

highlight passed ETA - fixes #23

src/main/java/de/uapcore/lightpit/entities/Issue.java file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jspf/issue-list.jspf file | annotate | diff | comparison | revisions
src/main/webapp/projects.css file | annotate | diff | comparison | revisions
--- a/src/main/java/de/uapcore/lightpit/entities/Issue.java	Fri Oct 23 11:44:02 2020 +0200
+++ b/src/main/java/de/uapcore/lightpit/entities/Issue.java	Fri Oct 23 12:26:08 2020 +0200
@@ -171,6 +171,15 @@
         this.eta = eta;
     }
 
+    /**
+     * An issue is overdue, if it is not done and the ETA is before the current time.
+     * @return true if this issue is overdue, false otherwise
+     */
+    public boolean isOverdue() {
+        return eta != null && status.getPhase() != IssueStatus.PHASE_DONE
+                && eta.before(new Date(System.currentTimeMillis()));
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
--- a/src/main/webapp/WEB-INF/jspf/issue-list.jspf	Fri Oct 23 11:44:02 2020 +0200
+++ b/src/main/webapp/WEB-INF/jspf/issue-list.jspf	Fri Oct 23 12:26:08 2020 +0200
@@ -1,7 +1,6 @@
 <%--
 issues: List<Issue>
 --%>
-
 <table class="fullwidth datatable medskip">
     <colgroup>
         <col width="auto" />
@@ -31,7 +30,9 @@
                 </div>
             </td>
             <td>
-                <fmt:formatDate value="${issue.eta}" />
+                <span class="<c:if test="${issue.overdue}">eta-overdue</c:if> ">
+                        <fmt:formatDate value="${issue.eta}" />
+                </span>
             </td>
         </tr>
     </c:forEach>
--- a/src/main/webapp/projects.css	Fri Oct 23 11:44:02 2020 +0200
+++ b/src/main/webapp/projects.css	Fri Oct 23 12:26:08 2020 +0200
@@ -149,3 +149,7 @@
 div.comment {
     margin-bottom: 1.25em;
 }
+
+span.eta-overdue {
+    color: red;
+}
\ No newline at end of file

mercurial