Skip to content

Commit 9778afa

Browse files
mukeshkphp-coder
authored andcommitted
task(/site/index): add a checkbox for searching by a catalog in user's collection.
Part of #673 Fix #1087
1 parent 23c30c2 commit 9778afa

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ public enum Features implements Feature {
5151

5252
@Label("/series/add: show link with auto-suggestions")
5353
@EnabledByDefault
54-
SHOW_SUGGESTION_LINK;
54+
SHOW_SUGGESTION_LINK,
55+
56+
@Label("/site/index: search by catalog in collection")
57+
SEARCH_IN_COLLECTION;
5558

5659
public boolean isActive() {
5760
return FeatureContext.getFeatureManager().isActive(this);

src/main/resources/ru/mystamps/i18n/Messages.properties

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ t_catalog = Catalog
7777
t_search = Search
7878
t_view_suspicious_activities = view suspicious activities
7979
t_view_daily_statistics = view daily statistics
80+
t_in_my_collection = In my collection
8081

8182
# account/register.html
8283
t_registration_on_site = Register on site

src/main/resources/ru/mystamps/i18n/Messages_ru.properties

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ t_catalog = Каталог
7777
t_search = Найти
7878
t_view_suspicious_activities = посмотреть подозрительные события
7979
t_view_daily_statistics = посмотреть дневную статистику
80+
t_in_my_collection = В моей коллекции
8081

8182
# account/register.html
8283
t_registration_on_site = Регистрация на сайте

src/main/webapp/WEB-INF/views/site/index.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<html lang="en" th:lang="${#locale.language == 'ru' ? 'ru' : 'en'}"
33
xmlns="http://www.w3.org/1999/xhtml"
44
xmlns:th="http://www.thymeleaf.org"
5-
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
5+
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
6+
xmlns:togglz="https://github.com/heneke/thymeleaf-extras-togglz">
67
<head>
78
<meta charset="utf-8" />
89
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -181,6 +182,11 @@ <h4 class="panel-title" th:text="#{t_search_by_catalog}">Search by catalog</h4>
181182
<option value="zagorski" th:text="#{t_zagorski}">Zagorski</option>
182183
</select>
183184
</div>
185+
<!-- @todo #673 Add integration tests for search by a catalog in user's collection -->
186+
<div class="form-group" sec:authorize="isAuthenticated()" togglz:active="SEARCH_IN_COLLECTION">
187+
<input id="in-collection" name="inCollection" type="checkbox" />
188+
<label for="in-collection" th:text="#{t_in_my_collection}">In my collection</label>
189+
</div>
184190
<div class="form-group">
185191
<input type="submit" value="Search" th:value="#{t_search}" class="btn btn-primary" />
186192
</div>

0 commit comments

Comments
 (0)