src/main/webapp/WEB-INF/jsp/issues-feed.jsp

changeset 242
b7f3e972b13c
parent 240
7303812a4424
child 311
bf67e0ff7131
--- a/src/main/webapp/WEB-INF/jsp/issues-feed.jsp	Sat Nov 27 12:12:20 2021 +0100
+++ b/src/main/webapp/WEB-INF/jsp/issues-feed.jsp	Sat Nov 27 13:03:57 2021 +0100
@@ -27,34 +27,50 @@
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.IssueFeed" scope="request"/>
 <channel>
-    <title><c:out value="${viewmodel.project.name}"/> | <fmt:message key="feed.issues.title"/></title>
+    <title>
+        <c:out value="${viewmodel.project.name}"/>
+        |<fmt:message key="feed.issues.title"/></title>
     <description><fmt:message key="feed.issues.description"/></description>
     <link>${baseHref}projects/${viewmodel.project.node}</link>
     <language>${pageContext.response.locale.language}</language>
-    <pubDate><fmt:formatDate value="${viewmodel.lastModified}" pattern="EEE, dd MMM yyyy HH:mm:ss zzz" /></pubDate>
-    <lastBuildDate><fmt:formatDate value="${viewmodel.lastModified}" pattern="EEE, dd MMM yyyy HH:mm:ss zzz" /></lastBuildDate>
+    <pubDate><fmt:formatDate value="${viewmodel.lastModified}" pattern="EEE, dd MMM yyyy HH:mm:ss zzz"/></pubDate>
+    <lastBuildDate><fmt:formatDate value="${viewmodel.lastModified}"
+                                   pattern="EEE, dd MMM yyyy HH:mm:ss zzz"/></lastBuildDate>
 
     <c:forEach items="${viewmodel.entries}" var="entry">
-        <c:set var="issue" value="${entry.issue}"/>
         <item>
-            <title>[<fmt:message key="feed.issues.type.${entry.type}"/>] #${issue.id} - <c:out value="${issue.currentSubject}"/></title>
-            <description><![CDATA[
-                <h1>#${issue.id} - ${issue.subject}</h1>
-                <div><b><fmt:message key="component"/></b>: ${issue.component}</div>
-                <div><b><fmt:message key="issue.category"/></b>: ${issue.category}</div>
-                <div><b><fmt:message key="issue.status"/></b>: ${issue.status}</div>
-                <div><b><fmt:message key="issue.resolved-versions"/></b>: ${issue.resolved}</div>
-                <div><b><fmt:message key="issue.affected-versions"/></b>: ${issue.affected}</div>
-                <div><b><fmt:message key="issue.assignee"/></b>: ${issue.assignee}</div>
-                <div><b><fmt:message key="issue.eta"/></b>: ${issue.eta}</div>
-                <h2><fmt:message key="issue.description"/></h2>
-                <div style="white-space: pre-wrap;">${issue.description}</div>
-            ]]></description>
-            <category><fmt:message key="issue.category.${issue.category}"/></category>
-            <c:set var="link" value="${baseHref}projects/${viewmodel.project.node}/issues/-/-/${issue.id}"/>
+            <c:choose>
+                <c:when test="${not empty entry.issue}">
+                    <c:set var="issue" value="${entry.issue}"/>
+                    <c:set var="link" value="${baseHref}projects/${viewmodel.project.node}/issues/-/-/${issue.id}"/>
+                    <title>[<fmt:message key="feed.issues.type.${entry.type}"/>] #${issue.id} - <c:out value="${issue.currentSubject}"/></title>
+                    <description><![CDATA[
+                        <h1>#${issue.id} - ${issue.subject}</h1>
+                        <div><b><fmt:message key="component"/></b>: ${issue.component}</div>
+                        <div><b><fmt:message key="issue.category"/></b>: ${issue.category}</div>
+                        <div><b><fmt:message key="issue.status"/></b>: ${issue.status}</div>
+                        <div><b><fmt:message key="issue.resolved-versions"/></b>: ${issue.resolved}</div>
+                        <div><b><fmt:message key="issue.affected-versions"/></b>: ${issue.affected}</div>
+                        <div><b><fmt:message key="issue.assignee"/></b>: ${issue.assignee}</div>
+                        <div><b><fmt:message key="issue.eta"/></b>: ${issue.eta}</div>
+                        <h2><fmt:message key="issue.description"/></h2>
+                        <div style="white-space: pre-wrap;">${issue.description}</div>
+                    ]]></description>
+                    <category><fmt:message key="issue.category.${issue.category}"/></category>
+                </c:when>
+                <c:when test="${not empty entry.comment}">
+                    <c:set var="comment" value="${entry.comment}"/>
+                    <c:set var="link" value="${baseHref}projects/${viewmodel.project.node}/issues/-/-/${comment.issueid}"/>
+                    <title>[<fmt:message key="feed.issues.type.${entry.type}"/>] #${comment.issueid} - <c:out value="${comment.currentSubject}"/></title>
+                    <description><![CDATA[
+                        <div style="white-space: pre-wrap;">${comment.comment}</div>
+                    ]]></description>
+                    <category><fmt:message key="feed.issues.type.${entry.type}"/></category>
+                </c:when>
+            </c:choose>
             <link>${link}</link>
             <guid isPermaLink="true">${link}</guid>
-            <pubDate><fmt:formatDate value="${entry.time}" pattern="EEE, dd MMM yyyy HH:mm:ss zzz" /></pubDate>
+            <pubDate><fmt:formatDate value="${entry.time}" pattern="EEE, dd MMM yyyy HH:mm:ss zzz"/></pubDate>
         </item>
     </c:forEach>
 </channel>

mercurial