Skip to content

Commit 2b6c5d1

Browse files
committed
show field
1 parent cec09fc commit 2b6c5d1

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

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

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

8484
// MUST be updated when any of our resources were modified
85-
public static final String RESOURCES_VERSION = "v0.3.2";
85+
public static final String RESOURCES_VERSION = "v0.3.3";
8686

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

src/main/javascript/series/add.js

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ function initPage(suggestCountryUrl) {
1717
.find('.glyphicon')
1818
.toggleClass('glyphicon-chevron-down glyphicon-chevron-right');
1919
});
20+
21+
$('.collapse').not(".has-error, .js-has-data").collapse('hide');
2022

2123
$('.js-with-tooltip').tooltip({
2224
'placement': 'right'

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

+9-10
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ <h3 th:text="${#strings.capitalize(add_series)}">
123123
yvertHasValues=${addSeriesForm.yvertNumbers != null or addSeriesForm.yvertPrice != null},
124124
gibbonsHasErrors=${#fields.hasErrors('gibbonsNumbers') or #fields.hasErrors('gibbonsPrice')},
125125
gibbonsHasValues=${addSeriesForm.gibbonsNumbers != null or addSeriesForm.gibbonsPrice != null},
126-
showCatalogsInfo=${michelHasErrors or michelHasValues or scottHasErrors or scottHasValues or yvertHasErrors or yvertHasValues or gibbonsHasErrors or gibbonsHasValues},
127126
issueDateHasErrors=${#fields.hasErrors('day') or #fields.hasErrors('month') or #fields.hasErrors('year')},
128127
issueDateHasValues=${addSeriesForm.day != null or addSeriesForm.month != null or addSeriesForm.year != null}">
129128

@@ -279,11 +278,11 @@ <h3 th:text="${#strings.capitalize(add_series)}">
279278

280279
<div class="form-group js-collapse-toggle-header">
281280
<div class="col-sm-offset-3 col-sm-5">
282-
<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>
281+
<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>
283282
</div>
284283
</div>
285284

286-
<div class="form-group form-group-sm collapse js-issue-date" th:classappend="|${issueDateHasErrors ? 'has-error in' : ''} ${issueDateHasValues ? 'in' : ''}|">
285+
<div class="form-group form-group-sm js-issue-date collapse in" th:classappend="|${issueDateHasErrors ? 'has-error' : ''} ${issueDateHasValues ? 'js-has-data' : ''}|">
287286
<label for="year" class="control-label col-sm-3">
288287
<span class="field-label" th:text="#{t_issue_date}">
289288
Date of release
@@ -371,11 +370,11 @@ <h3 th:text="${#strings.capitalize(add_series)}">
371370

372371
<div class="form-group js-collapse-toggle-header">
373372
<div class="col-sm-offset-3 col-sm-7">
374-
<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>
373+
<span class="glyphicon glyphicon-chevron-down"></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>
375374
</div>
376375
</div>
377376

378-
<div class="form-group form-group-sm collapse js-catalogs-info" th:classappend="|${michelHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}|">
377+
<div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${michelHasErrors ? 'has-error' : ''} ${michelHasValues ? 'js-has-data' : ''}|">
379378
<label for="michelNumbers" class="control-label col-sm-3">
380379
<span class="field-label" th:text="#{t_michel}">
381380
Michel
@@ -400,7 +399,7 @@ <h3 th:text="${#strings.capitalize(add_series)}">
400399
</div>
401400
</div>
402401

403-
<div class="form-group form-group-sm collapse js-catalogs-info" th:classappend="|${scottHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}|">
402+
<div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${scottHasErrors ? 'has-error' : ''} ${scottHasValues ? 'js-has-data' : ''}|">
404403
<label for="scottNumbers" class="control-label col-sm-3">
405404
<span class="field-label" th:text="#{t_scott}">
406405
Scott
@@ -425,7 +424,7 @@ <h3 th:text="${#strings.capitalize(add_series)}">
425424
</div>
426425
</div>
427426

428-
<div class="form-group form-group-sm collapse js-catalogs-info" th:classappend="|${yvertHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}|">
427+
<div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${yvertHasErrors ? 'has-error' : ''} ${yvertHasValues ? 'js-has-data' : ''}|">
429428
<label for="yvertNumbers" class="control-label col-sm-3">
430429
<span class="field-label" th:text="#{t_yvert}">
431430
Yvert
@@ -450,7 +449,7 @@ <h3 th:text="${#strings.capitalize(add_series)}">
450449
</div>
451450
</div>
452451

453-
<div class="form-group form-group-sm collapse js-catalogs-info" th:classappend="|${gibbonsHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}|">
452+
<div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${gibbonsHasErrors ? 'has-error' : ''} ${gibbonsHasValues ? 'js-has-data' : ''}|">
454453
<label for="gibbonsNumbers" class="control-label col-sm-3">
455454
<span class="field-label" th:text="#{t_sg}">
456455
Gibbons
@@ -477,11 +476,11 @@ <h3 th:text="${#strings.capitalize(add_series)}">
477476

478477
<div class="form-group js-collapse-toggle-header" sec:authorize="hasAuthority('ADD_COMMENTS_TO_SERIES')">
479478
<div class="col-sm-offset-3 col-sm-5">
480-
<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>
479+
<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>
481480
</div>
482481
</div>
483482

484-
<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')">
483+
<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')">
485484
<label for="comment" class="control-label col-sm-3">
486485
<span class="field-label" th:text="#{t_comment}">
487486
Comment

0 commit comments

Comments
 (0)