Skip to content

Commit 8fe74c9

Browse files
committed
Show special 'New' label near just added series at collection page.
1 parent 030d971 commit 8fe74c9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/main/java/ru/mystamps/web/controller/SeriesController.java

+1
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ public String addToCollection(
187187
.toString();
188188

189189
redirectAttributes.addFlashAttribute("justAddedSeries", true);
190+
redirectAttributes.addFlashAttribute("justAddedSeriesId", series.getId());
190191

191192
return "redirect:" + dstUrl;
192193
}

src/main/webapp/WEB-INF/views/collection/info.html

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ <h3 class="text-center" th:text="#{t_collection_of(${ownerName})}">
9494
<span th:remove="tag" th:text="|${series.quantity}&nbsp;#{t_items}|">7&nbsp;item(s)</span>
9595
<span th:remove="tag" th:if="${not series.perforated}" th:text="|(#{t_wo_perforation_short})|">(without perforation)</span>
9696
</a>
97+
<span th:if="${justAddedSeriesId != null and justAddedSeriesId == series.id}" class="label label-success">New</span>
9798
</li>
9899
<li>
99100
<a href="../category/info.html">Animals</a>&nbsp;&raquo;

0 commit comments

Comments
 (0)