Skip to content

Commit cd54a7b

Browse files
committed
add
1 parent 00d021f commit cd54a7b

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

src/main/java/ru/mystamps/web/Url.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public final class Url {
8383
public static final String ADD_SERIES_WITH_COUNTRY_PAGE = "/series/add/country/{slug}";
8484

8585
// MUST be updated when any of our resources were modified
86-
public static final String RESOURCES_VERSION = "v0.3.4";
86+
public static final String RESOURCES_VERSION = "v0.3.5";
8787

8888
// CheckStyle: ignore LineLength for next 4 lines
8989
public static final String MAIN_CSS = "/static/" + RESOURCES_VERSION + "/styles/main.min.css";

src/main/javascript/series/add.js

+5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@ function initPage(suggestCountryUrl) {
1010
return CatalogUtils.expandNumbers(val);
1111
});
1212
});
13+
14+
$('.js-collapse-toggle-header').show();
1315

1416
$('.collapse').on('show.bs.collapse hide.bs.collapse', function toggleChevron() {
1517
$(this)
1618
.prev('.js-collapse-toggle-header')
1719
.find('.glyphicon')
1820
.toggleClass('glyphicon-chevron-down glyphicon-chevron-right');
1921
});
22+
23+
// emulates collapse('hide') but hides elements faster
24+
$('.collapse').not('.has-error, .js-has-data').height(0).removeClass('in').trigger('hide.bs.collapse');
2025

2126
$('.js-with-tooltip').tooltip({
2227
'placement': 'right'

src/main/webapp/WEB-INF/static/styles/main.css

+3
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,6 @@ label {
102102
.link-vcenter {
103103
line-height: 34px;
104104
}
105+
.js-collapse-toggle-header {
106+
display: none;
107+
}

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

+10-9
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ <h3 th:text="${#strings.capitalize(add_series)}">
242242

243243
<div class="form-group js-collapse-toggle-header">
244244
<div class="col-sm-offset-3 col-sm-5">
245-
<span class="glyphicon glyphicon-chevron-right" th:class="${issueDateHasErrors or issueDateHasValues ? 'glyphicon glyphicon-chevron-down' : 'glyphicon glyphicon-chevron-right'}"></span>&nbsp;<a href="javascript:void(0)" id="specify-issue-date-link" data-toggle="collapse" data-target=".js-issue-date" th:text="#{t_specify_issue_date}">Specify date of release</a>
245+
<span class="glyphicon glyphicon-chevron-down"></span>&nbsp;<a href="javascript:void(0)" id="specify-issue-date-link" data-toggle="collapse" data-target=".js-issue-date" th:text="#{t_specify_issue_date}">Specify date of release</a>
246246
</div>
247247
</div>
248248

249-
<div class="form-group form-group-sm collapse js-issue-date" th:classappend="|${issueDateHasErrors ? 'has-error in' : ''} ${issueDateHasValues ? 'in' : ''}|">
249+
<div class="form-group form-group-sm js-issue-date collapse in" th:classappend="|${issueDateHasErrors ? 'has-error' : ''} ${issueDateHasValues ? 'js-has-data' : ''}|">
250250
<label for="year" class="control-label col-sm-3">
251251
<span th:remove="tag" th:text="#{t_issue_date}">
252252
Date of release
@@ -334,11 +334,12 @@ <h3 th:text="${#strings.capitalize(add_series)}">
334334

335335
<div class="form-group js-collapse-toggle-header">
336336
<div class="col-sm-offset-3 col-sm-7">
337-
<span class="glyphicon glyphicon-chevron-right" th:class="${showCatalogsInfo ? 'glyphicon glyphicon-chevron-down' : 'glyphicon glyphicon-chevron-right'}"></span>&nbsp;<a href="javascript:void(0)" id="add-catalog-numbers-link" data-toggle="collapse" data-target=".js-catalogs-info" th:text="#{t_add_catalogs_info}">Add information from stamps catalogues</a>
337+
<span class="glyphicon glyphicon-chevron-down"></span>&nbsp;
338+
<a href="javascript:void(0)" id="add-catalog-numbers-link" data-toggle="collapse" data-target=".js-catalogs-info" th:text="#{t_add_catalogs_info}">Add information from stamps catalogues</a>
338339
</div>
339340
</div>
340341

341-
<div class="form-group form-group-sm collapse js-catalogs-info" th:classappend="|${michelHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}|">
342+
<div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${michelHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'js-has-data' : ''}|">
342343
<label for="michelNumbers" class="control-label col-sm-3">
343344
<span th:remove="tag" th:text="#{t_michel}">
344345
Michel
@@ -363,7 +364,7 @@ <h3 th:text="${#strings.capitalize(add_series)}">
363364
</div>
364365
</div>
365366

366-
<div class="form-group form-group-sm collapse js-catalogs-info" th:classappend="|${scottHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}|">
367+
<div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${scottHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'js-has-data' : ''}|">
367368
<label for="scottNumbers" class="control-label col-sm-3">
368369
<span th:remove="tag" th:text="#{t_scott}">
369370
Scott
@@ -388,7 +389,7 @@ <h3 th:text="${#strings.capitalize(add_series)}">
388389
</div>
389390
</div>
390391

391-
<div class="form-group form-group-sm collapse js-catalogs-info" th:classappend="|${yvertHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}|">
392+
<div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${yvertHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'js-has-data' : ''}|">
392393
<label for="yvertNumbers" class="control-label col-sm-3">
393394
<span th:remove="tag" th:text="#{t_yvert}">
394395
Yvert
@@ -413,7 +414,7 @@ <h3 th:text="${#strings.capitalize(add_series)}">
413414
</div>
414415
</div>
415416

416-
<div class="form-group form-group-sm collapse js-catalogs-info" th:classappend="|${gibbonsHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}|">
417+
<div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${gibbonsHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'js-has-data' : ''}|">
417418
<label for="gibbonsNumbers" class="control-label col-sm-3">
418419
<span th:remove="tag" th:text="#{t_sg}">
419420
Gibbons
@@ -440,11 +441,11 @@ <h3 th:text="${#strings.capitalize(add_series)}">
440441

441442
<div class="form-group js-collapse-toggle-header" sec:authorize="hasAuthority('ADD_COMMENTS_TO_SERIES')">
442443
<div class="col-sm-offset-3 col-sm-5">
443-
<span class="glyphicon glyphicon-chevron-right" th:class="${#fields.hasErrors('comment') or addSeriesForm.comment != null ? 'glyphicon glyphicon-chevron-down' : 'glyphicon glyphicon-chevron-right'}"></span>&nbsp;<a href="javascript:void(0)" id="add-comment-link" data-toggle="collapse" data-target=".js-comment" th:text="#{t_add_comment}">Add comment</a>
444+
<span class="glyphicon glyphicon-chevron-down"></span>&nbsp;<a href="javascript:void(0)" id="add-comment-link" data-toggle="collapse" data-target=".js-comment" th:text="#{t_add_comment}">Add comment</a>
444445
</div>
445446
</div>
446447

447-
<div class="form-group collapse js-comment" th:classappend="|${#fields.hasErrors('comment') ? 'has-error in' : ''} ${addSeriesForm.comment != null ? 'in' : ''}|" sec:authorize="hasAuthority('ADD_COMMENTS_TO_SERIES')">
448+
<div class="form-group js-comment collapse in" th:classappend="|${#fields.hasErrors('comment') ? 'has-error' : ''} ${addSeriesForm.comment != null ? 'js-has-data' : ''}|" sec:authorize="hasAuthority('ADD_COMMENTS_TO_SERIES')">
448449
<label for="comment" class="control-label col-sm-3">
449450
<span th:remove="tag" th:text="#{t_comment}">
450451
Comment

0 commit comments

Comments
 (0)