Skip to content

Commit 2cf3942

Browse files
committed
chore(/site/index): cleanup Togglz features.
Addressed to #605 No functional changes.
1 parent 0a97484 commit 2cf3942

File tree

2 files changed

+44
-81
lines changed

2 files changed

+44
-81
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,6 @@
2424

2525
public enum Features implements Feature {
2626

27-
@Label("/site/index: show list of recently added series")
28-
@EnabledByDefault
29-
SHOW_RECENT_SERIES_ON_INDEX_PAGE,
30-
31-
@Label("/site/index: show list of recently created collections")
32-
@EnabledByDefault
33-
SHOW_RECENT_COLLECTIONS_ON_INDEX_PAGE,
34-
35-
@Label("/site/index: show search panel")
36-
@EnabledByDefault
37-
SHOW_SEARCH_PANEL_ON_INDEX_PAGE,
38-
39-
@Label("/site/index: show link to list of categories")
40-
@EnabledByDefault
41-
LIST_CATEGORIES,
42-
43-
@Label("/site/index: show link to list of countries")
44-
@EnabledByDefault
45-
LIST_COUNTRIES,
46-
4727
@Label("/series/{id}: possibility to user to add series to collection")
4828
@EnabledByDefault
4929
ADD_SERIES_TO_COLLECTION,
@@ -76,10 +56,6 @@ public enum Features implements Feature {
7656
@EnabledByDefault
7757
SEND_ACTIVATION_MAIL,
7858

79-
@Label("View site events")
80-
@EnabledByDefault
81-
VIEW_SITE_EVENTS,
82-
8359
@Label("/series/add: show link with auto-suggestions")
8460
@EnabledByDefault
8561
SHOW_SUGGESTION_LINK;

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

Lines changed: 44 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
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"
6-
xmlns:togglz="https://github.com/heneke/thymeleaf-extras-togglz">
5+
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
76
<head>
87
<meta charset="utf-8" />
98
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -64,10 +63,10 @@
6463
<nav>
6564
<p th:text="|#{t_you_may}:|">You may:</p>
6665
<ul>
67-
<li togglz:active="LIST_CATEGORIES">
66+
<li>
6867
<a th:href="@{${GET_CATEGORIES_PAGE}}" th:text="#{t_show_categories_list}" href="../category/list.html">show list of categories</a>
6968
</li>
70-
<li togglz:active="LIST_COUNTRIES">
69+
<li>
7170
<a th:href="@{${GET_COUNTRIES_PAGE}}" th:text="#{t_show_countries_list}" href="../country/list.html">show list of countries</a>
7271
</li>
7372
<li sec:authorize="hasAuthority('IMPORT_SERIES')">
@@ -88,7 +87,7 @@
8887
<li sec:authorize="hasAuthority('ADD_PARTICIPANT')">
8988
<a th:href="@{${ADD_PARTICIPANT_PAGE}}" th:text="#{t_add_buyer_seller}" href="../participant/add.html">add buyer/seller</a>
9089
</li>
91-
<li togglz:active="VIEW_SITE_EVENTS" sec:authorize="hasAuthority('VIEW_SITE_EVENTS')">
90+
<li sec:authorize="hasAuthority('VIEW_SITE_EVENTS')">
9291
<a th:href="@{${SITE_EVENTS_PAGE}}" th:text="#{t_view_suspicious_activities}" href="events.html">view suspicious activities</a>
9392
</li>
9493
<li sec:authorize="hasAuthority('VIEW_DAILY_STATS')">
@@ -98,61 +97,49 @@
9897
</nav>
9998
</div>
10099
<div class="col-sm-3">
101-
<!--/*/
102-
<th:block togglz:active="SHOW_RECENT_COLLECTIONS_ON_INDEX_PAGE" th:if="${not #lists.isEmpty(recentlyAddedCollections)}">
103-
/*/-->
104-
<div class="panel panel-default">
105-
<div class="panel-heading">
106-
<h4 class="panel-title" th:text="#{t_recently_added_collections}">Recently created collections</h4>
107-
</div>
108-
<div class="panel-body">
109-
<ul class="list-unstyled" th:remove="all-but-first">
110-
<li th:each="collection : ${recentlyAddedCollections}">
111-
<a href="../collection/info.html" th:href="@{${INFO_COLLECTION_PAGE}(slug=${collection.slug})}" th:text="${collection.name}">John Doe</a>
112-
</li>
113-
<li><a href="../collection/info.html">Edith Roberts</a></li>
114-
<li><a href="../collection/info.html">Tyler Dean</a></li>
115-
<li><a href="../collection/info.html">Gwen Schultz</a></li>
116-
</ul>
117-
</div>
100+
<div class="panel panel-default" th:if="${not #lists.isEmpty(recentlyAddedCollections)}">
101+
<div class="panel-heading">
102+
<h4 class="panel-title" th:text="#{t_recently_added_collections}">Recently created collections</h4>
103+
</div>
104+
<div class="panel-body">
105+
<ul class="list-unstyled" th:remove="all-but-first">
106+
<li th:each="collection : ${recentlyAddedCollections}">
107+
<a href="../collection/info.html" th:href="@{${INFO_COLLECTION_PAGE}(slug=${collection.slug})}" th:text="${collection.name}">John Doe</a>
108+
</li>
109+
<li><a href="../collection/info.html">Edith Roberts</a></li>
110+
<li><a href="../collection/info.html">Tyler Dean</a></li>
111+
<li><a href="../collection/info.html">Gwen Schultz</a></li>
112+
</ul>
118113
</div>
119-
<!--/*/
120-
</th:block>
121-
/*/-->
114+
</div>
122115
</div>
123116
<div class="col-sm-4">
124-
<!--/*/
125-
<th:block togglz:active="SHOW_RECENT_SERIES_ON_INDEX_PAGE" th:if="${not #lists.isEmpty(recentlyAddedSeries)}">
126-
/*/-->
127-
<div class="panel panel-default">
128-
<div class="panel-heading">
129-
<h4 class="panel-title" th:text="#{t_recently_added_series}">Recently added series</h4>
130-
</div>
131-
<div class="panel-body">
132-
<ul class="list-unstyled" th:remove="all-but-first">
133-
<li th:each="series : ${recentlyAddedSeries}">
134-
<a href="../series/info.html" th:href="@{${INFO_SERIES_PAGE}(id=${series.id})}">
135-
<span th:remove="tag" th:if="${series.country != null}" th:text="|${series.country}, |">Italy, </span>
136-
<span th:remove="tag" th:if="${series.year != null}" th:text="|${series.year}, |">1999, </span>
137-
<span th:remove="tag" th:text="|${series.quantity}&nbsp;${series.quantity != 1 ? '__#{t_stamps}__' : '__#{t_stamp}__'}|">7&nbsp;stamps</span>
138-
<span th:remove="tag" th:if="${not series.perforated}" th:text="|(#{t_wo_perforation_short})|">(without perforation)</span>
139-
</a>
140-
</li>
141-
<li><a href="../series/info.html">Italy, 1997, 8&nbsp;stamps</a></li>
142-
<li><a href="../series/info.html">Italy, 2009, 10&nbsp;stamps</a></li>
143-
<li><a href="../series/info.html">Italy, 4&nbsp;stamps</a></li>
144-
<li><a href="../series/info.html">Italy, 2002, 12&nbsp;stamps</a></li>
145-
<li><a href="../series/info.html">Italy, 1993, 19&nbsp;stamps</a></li>
146-
<li><a href="../series/info.html">Italy, 4&nbsp;stamps</a></li>
147-
<li><a href="../series/info.html">Italy, 11&nbsp;stamps (without perforation)</a></li>
148-
<li><a href="../series/info.html">Italy, 2014, 1&nbsp;stamp</a></li>
149-
<li><a href="../series/info.html">Italy, 1996, 16&nbsp;stamps (without perforation)</a></li>
150-
</ul>
151-
</div>
117+
<div class="panel panel-default" th:if="${not #lists.isEmpty(recentlyAddedSeries)}">
118+
<div class="panel-heading">
119+
<h4 class="panel-title" th:text="#{t_recently_added_series}">Recently added series</h4>
152120
</div>
153-
<!--/*/
154-
</th:block>
155-
/*/-->
121+
<div class="panel-body">
122+
<ul class="list-unstyled" th:remove="all-but-first">
123+
<li th:each="series : ${recentlyAddedSeries}">
124+
<a href="../series/info.html" th:href="@{${INFO_SERIES_PAGE}(id=${series.id})}">
125+
<span th:remove="tag" th:if="${series.country != null}" th:text="|${series.country}, |">Italy, </span>
126+
<span th:remove="tag" th:if="${series.year != null}" th:text="|${series.year}, |">1999, </span>
127+
<span th:remove="tag" th:text="|${series.quantity}&nbsp;${series.quantity != 1 ? '__#{t_stamps}__' : '__#{t_stamp}__'}|">7&nbsp;stamps</span>
128+
<span th:remove="tag" th:if="${not series.perforated}" th:text="|(#{t_wo_perforation_short})|">(without perforation)</span>
129+
</a>
130+
</li>
131+
<li><a href="../series/info.html">Italy, 1997, 8&nbsp;stamps</a></li>
132+
<li><a href="../series/info.html">Italy, 2009, 10&nbsp;stamps</a></li>
133+
<li><a href="../series/info.html">Italy, 4&nbsp;stamps</a></li>
134+
<li><a href="../series/info.html">Italy, 2002, 12&nbsp;stamps</a></li>
135+
<li><a href="../series/info.html">Italy, 1993, 19&nbsp;stamps</a></li>
136+
<li><a href="../series/info.html">Italy, 4&nbsp;stamps</a></li>
137+
<li><a href="../series/info.html">Italy, 11&nbsp;stamps (without perforation)</a></li>
138+
<li><a href="../series/info.html">Italy, 2014, 1&nbsp;stamp</a></li>
139+
<li><a href="../series/info.html">Italy, 1996, 16&nbsp;stamps (without perforation)</a></li>
140+
</ul>
141+
</div>
142+
</div>
156143
</div>
157144
<div class="col-sm-2">
158145
<div class="panel panel-default">
@@ -167,7 +154,7 @@ <h4 class="panel-title" th:text="#{t_in_db}">In our database</h4>
167154
<p th:text="|#{t_collections_amount}: ${collectionsCounter}|">Collections: 3</p>
168155
</div>
169156
</div>
170-
<div togglz:active="SHOW_SEARCH_PANEL_ON_INDEX_PAGE" class="panel panel-default">
157+
<div class="panel panel-default">
171158
<div class="panel-heading">
172159
<h4 class="panel-title" th:text="#{t_search_by_catalog}">Search by catalog</h4>
173160
</div>

0 commit comments

Comments
 (0)