Skip to content

Commit 32829ec

Browse files
committed
task(/series/{id}): show a form for adding a series even when user already has this series.
Part of #1123
1 parent 42a1ef5 commit 32829ec

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/java/ru/mystamps/web/feature/series/SeriesController.java

-1
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ private static void addImageFormToModel(Model model) {
689689
}
690690

691691
private static void addStampsToCollectionForm(Model model, SeriesDto series) {
692-
// FIXME: only add when isSeriesInCollection
693692
if (model.containsAttribute("addToCollectionForm")) {
694693
return;
695694
}

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,17 @@ <h5 class="text-center" th:text="#{t_similar_series}">
361361
<div class="col-sm-4">
362362

363363
<div class="row">
364-
<div class="col-sm-12" th:if="${not isSeriesInCollection}" sec:authorize="hasAuthority('UPDATE_COLLECTION')">
364+
<div class="col-sm-12" sec:authorize="hasAuthority('UPDATE_COLLECTION')">
365365
<form id="add-series-form" method="post" action="../collection/info.html"
366366
th:action="@{${INFO_SERIES_PAGE}(id=${series.id})}"
367367
th:object="${addToCollectionForm}">
368-
<p th:text="#{t_series_not_in_collection}">
368+
369+
<!--/*/
370+
<p th:if="${not isSeriesInCollection}" th:text="#{t_series_not_in_collection}">
369371
Series isn't part of your collection
370372
</p>
373+
/*/-->
374+
371375
<p id="number-of-stamps-block" th:if="${series.quantity != 1}">
372376
<span th:text="#{t_i_have}" th:remove="tag">I have</span>
373377
<input id="number-of-stamps"
@@ -435,7 +439,6 @@ <h5 class="text-center" th:text="#{t_similar_series}">
435439
</form>
436440
</div>
437441

438-
<!--/*/
439442
<div class="col-sm-12" th:if="${isSeriesInCollection}" sec:authorize="hasAuthority('UPDATE_COLLECTION')">
440443
<form id="remove-series-form" method="post" action="../collection/info.html" th:action="@{${INFO_SERIES_PAGE}(id=${series.id})}">
441444
<p th:text="#{t_series_in_collection}">
@@ -448,6 +451,7 @@ <h5 class="text-center" th:text="#{t_similar_series}">
448451
</form>
449452
</div>
450453

454+
<!--/*/
451455
<div class="col-sm-12" sec:authorize="isAnonymous()">
452456
<p th:utext="#{t_need_authentication_to_add_series_to_collection(@{${REGISTRATION_PAGE}}, @{${AUTHENTICATION_PAGE}})}">
453457
In order to add this series to your collection you should <a href="../account/register.html">register</a>

0 commit comments

Comments
 (0)