Skip to content

Commit ffe5715

Browse files
committed
Add togglz feature for adding additional images.
1 parent de2f0a0 commit ffe5715

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/main/java/ru/mystamps/web/support/togglz/Features.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ public enum Features implements Feature {
4646

4747
@Label("Possibility to user to add series to collection")
4848
@EnabledByDefault
49-
ADD_SERIES_TO_COLLECTION;
49+
ADD_SERIES_TO_COLLECTION,
50+
51+
@Label("Possibility of user to add additional images to series")
52+
@EnabledByDefault
53+
ADD_ADDITIONAL_IMAGES_TO_SERIES;
5054

5155
public boolean isActive() {
5256
return FeatureContext.getFeatureManager().isActive(this);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ <h3 th:text="#{t_add_series_ucfirst}">
379379
</label>
380380
<div class="col-sm-7">
381381
<input type="file" id="image" class="form-control" style="box-shadow: none; border: 0px;" required="required" accept="image/png,image/jpeg" th:field="*{image}" />
382-
<small>
382+
<small togglz:active="ADD_ADDITIONAL_IMAGES_TO_SERIES">
383383
<span class="hint-block" th:text="#{t_add_more_images_hint}">
384384
You will be able to add additional images on the series page
385385
</span>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<img src="../../../../../test/resources/test.png" class="img-responsive series-images" th:src="@{${GET_IMAGE_PAGE}(id=${image.id})}" />
5757
</div>
5858
</div>
59-
<div class="row">
59+
<div class="row" togglz:active="ADD_ADDITIONAL_IMAGES_TO_SERIES">
6060
<div class="col-sm-6 col-sm-offset-3">
6161
<form method="post" class="form-horizontal" enctype="multipart/form-data" th:action="@{${INFO_SERIES_PAGE}(id=${series.id})} + '?' + ${_csrf.parameterName} + '=' + ${_csrf.token}" th:object="${addImageForm}">
6262
<div class="form-group" th:classappend="${#fields.hasErrors('image') ? 'has-error' : ''}">

0 commit comments

Comments
 (0)