@@ -63,7 +63,14 @@ <h3 th:text="#{t_add_series_ucfirst}">
63
63
</ small >
64
64
</ div >
65
65
66
- < form method ="post " enctype ="multipart/form-data " class ="form-horizontal " action ="info.html " th:action ="@{${ADD_SERIES_PAGE}} + '?' + ${_csrf.parameterName} + '=' + ${_csrf.token} " th:object ="${addSeriesForm} ">
66
+ < form method ="post " enctype ="multipart/form-data " class ="form-horizontal " action ="info.html "
67
+ th:action ="@{${ADD_SERIES_PAGE}} + '?' + ${_csrf.parameterName} + '=' + ${_csrf.token} "
68
+ th:object ="${addSeriesForm} "
69
+ th:with ="michelHasErrors=${#fields.hasErrors('michelNumbers') or #fields.hasErrors('michelPrice') or #fields.hasErrors('michelCurrency')},
70
+ scottHasErrors=${#fields.hasErrors('scottNumbers') or #fields.hasErrors('scottPrice') or #fields.hasErrors('scottCurrency')},
71
+ yvertHasErrors=${#fields.hasErrors('yvertNumbers') or #fields.hasErrors('yvertPrice') or #fields.hasErrors('yvertCurrency')},
72
+ gibbonsHasErrors=${#fields.hasErrors('gibbonsNumbers') or #fields.hasErrors('gibbonsPrice') or #fields.hasErrors('gibbonsCurrency')},
73
+ showCatalogsInfo=${michelHasErrors or scottHasErrors or yvertHasErrors or gibbonsHasErrors} ">
67
74
68
75
< div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('category') ? 'has-error' : ''} ">
69
76
< label for ="category " class ="control-label col-sm-3 ">
@@ -110,7 +117,15 @@ <h3 th:text="#{t_add_series_ucfirst}">
110
117
</ div >
111
118
</ div >
112
119
113
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('day') or #fields.hasErrors('month') or #fields.hasErrors('year') ? 'has-error' : ''} ">
120
+ < div class ="form-group js-collapse-toggle-header ">
121
+ < div class ="col-sm-offset-3 col-sm-5 ">
122
+ < span class ="glyphicon glyphicon-chevron-right " th:class ="${#fields.hasErrors('day') or #fields.hasErrors('month') or #fields.hasErrors('year') ? 'glyphicon glyphicon-chevron-down' : 'glyphicon glyphicon-chevron-right'} "> </ span > < a href ="javascript:void(0) " data-toggle ="collapse " data-target =".js-issue-date " th:text ="#{t_specify_issue_date} ">
123
+ Specify date of release
124
+ </ a >
125
+ </ div >
126
+ </ div >
127
+
128
+ < div class ="form-group form-group-sm collapse js-issue-date " th:classappend ="${#fields.hasErrors('day') or #fields.hasErrors('month') or #fields.hasErrors('year') ? 'has-error in' : ''} ">
114
129
< label for ="year " class ="control-label col-sm-3 ">
115
130
< span class ="field-label " th:text ="#{t_issue_date} ">
116
131
Date of release
@@ -227,7 +242,15 @@ <h3 th:text="#{t_add_series_ucfirst}">
227
242
</ div >
228
243
</ div >
229
244
230
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('michelNumbers') or #fields.hasErrors('michelPrice') or #fields.hasErrors('michelCurrency') ? 'has-error' : ''} ">
245
+ < div class ="form-group js-collapse-toggle-header ">
246
+ < div class ="col-sm-offset-3 col-sm-7 ">
247
+ < span class ="glyphicon glyphicon-chevron-right " th:class ="${showCatalogsInfo ? 'glyphicon glyphicon-chevron-down' : 'glyphicon glyphicon-chevron-right'} "> </ span > < a href ="javascript:void(0) " data-toggle ="collapse " data-target =".js-catalogs-info " th:text ="#{t_add_catalogs_info} ">
248
+ Add information from stamps catalogues
249
+ </ a >
250
+ </ div >
251
+ </ div >
252
+
253
+ < div class ="form-group form-group-sm collapse js-catalogs-info " th:classappend ="|${michelHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in' : ''}| ">
231
254
< label for ="michelNumbers " class ="control-label col-sm-3 ">
232
255
< span class ="field-label " th:text ="#{t_michel} ">
233
256
Michel
@@ -260,7 +283,7 @@ <h3 th:text="#{t_add_series_ucfirst}">
260
283
</ div >
261
284
</ div >
262
285
263
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('scottNumbers') or #fields.hasErrors('scottPrice') or #fields.hasErrors('scottCurrency') ? 'has-error ' : ''} ">
286
+ < div class ="form-group form-group-sm collapse js-catalogs-info " th:classappend ="|${scottHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in ' : ''}| ">
264
287
< label for ="scottNumbers " class ="control-label col-sm-3 ">
265
288
< span class ="field-label " th:text ="#{t_scott} ">
266
289
Scott
@@ -293,7 +316,7 @@ <h3 th:text="#{t_add_series_ucfirst}">
293
316
</ div >
294
317
</ div >
295
318
296
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('yvertNumbers') or #fields.hasErrors('yvertPrice') or #fields.hasErrors('yvertCurrency') ? 'has-error ' : ''} ">
319
+ < div class ="form-group form-group-sm collapse js-catalogs-info " th:classappend ="|${yvertHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in ' : ''}| ">
297
320
< label for ="yvertNumbers " class ="control-label col-sm-3 ">
298
321
< span class ="field-label " th:text ="#{t_yvert} ">
299
322
Yvert
@@ -326,7 +349,7 @@ <h3 th:text="#{t_add_series_ucfirst}">
326
349
</ div >
327
350
</ div >
328
351
329
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('gibbonsNumbers') or #fields.hasErrors('gibbonsPrice') or #fields.hasErrors('gibbonsCurrency') ? 'has-error ' : ''} ">
352
+ < div class ="form-group form-group-sm collapse js-catalogs-info " th:classappend ="|${gibbonsHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in ' : ''}| ">
330
353
< label for ="gibbonsNumbers " class ="control-label col-sm-3 ">
331
354
< span class ="field-label " th:text ="#{t_sg} ">
332
355
Gibbons
@@ -359,7 +382,15 @@ <h3 th:text="#{t_add_series_ucfirst}">
359
382
</ div >
360
383
</ div >
361
384
362
- < div class ="form-group " th:classappend ="${#fields.hasErrors('comment') ? 'has-error' : ''} " sec:authorize ="hasAuthority('ADD_COMMENTS_TO_SERIES') ">
385
+ < div class ="form-group js-collapse-toggle-header " sec:authorize ="hasAuthority('ADD_COMMENTS_TO_SERIES') ">
386
+ < div class ="col-sm-offset-3 col-sm-5 ">
387
+ < span class ="glyphicon glyphicon-chevron-right " th:class ="${#fields.hasErrors('comment') ? 'glyphicon glyphicon-chevron-down' : 'glyphicon glyphicon-chevron-right'} "> </ span > < a href ="javascript:void(0) " data-toggle ="collapse " data-target =".js-comment " th:text ="#{t_add_comment} ">
388
+ Add comment
389
+ </ a >
390
+ </ div >
391
+ </ div >
392
+
393
+ < div class ="form-group collapse js-comment " th:classappend ="${#fields.hasErrors('comment') ? 'has-error in' : ''} " sec:authorize ="hasAuthority('ADD_COMMENTS_TO_SERIES') ">
363
394
< label for ="comment " class ="control-label col-sm-3 ">
364
395
< span class ="field-label " th:text ="#{t_comment} ">
365
396
Comment
@@ -419,6 +450,13 @@ <h3 th:text="#{t_add_series_ucfirst}">
419
450
return CatalogUtils . expandNumbers ( val ) ;
420
451
} ) ;
421
452
} ) ;
453
+
454
+ $ ( '.collapse' ) . on ( 'show.bs.collapse hide.bs.collapse' , function toggleChevron ( ) {
455
+ $ ( this )
456
+ . prev ( '.js-collapse-toggle-header' )
457
+ . find ( '.glyphicon' )
458
+ . toggleClass ( 'glyphicon-chevron-down glyphicon-chevron-right' ) ;
459
+ } ) ;
422
460
} ) ;
423
461
</ script >
424
462
</ body >
0 commit comments