@@ -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,66 @@ <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 form-group-sm " th:classappend ="${#fields.hasErrors('quantity') ? 'has-error' : ''} ">
121
+ < label for ="quantity " class ="control-label col-sm-3 ">
122
+ < span class ="field-label " th:text ="#{t_quantity} ">
123
+ Quantity
124
+ </ span >
125
+ < span id ="quantity.required " class ="required_field "> *</ span >
126
+ </ label >
127
+ < div class ="col-sm-2 ">
128
+ < input type ="number "
129
+ id ="quantity "
130
+ class ="form-control "
131
+ required ="required "
132
+ th:min ="${T(ru.mystamps.web.validation.ValidationRules).MIN_STAMPS_IN_SERIES} "
133
+ th:max ="${T(ru.mystamps.web.validation.ValidationRules).MAX_STAMPS_IN_SERIES} "
134
+ min ="1 "
135
+ max ="50 "
136
+ th:field ="*{quantity} " />
137
+ < span id ="quantity.errors " class ="help-block " th:if ="${#fields.hasErrors('quantity')} " th:each ="error : ${#fields.errors('quantity')} " th:text ="${error} "> </ span >
138
+ </ div >
139
+ </ div >
140
+
141
+ < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('perforated') ? 'has-error' : ''} ">
142
+ < label for ="perforated " class ="control-label col-sm-3 ">
143
+ < span class ="field-label " th:text ="#{t_perforated} ">
144
+ Perforated
145
+ </ span >
146
+ </ label >
147
+ < div class ="col-sm-1 ">
148
+ < input type ="checkbox " id ="perforated " checked ="checked " th:field ="*{perforated} " />
149
+ < span id ="perforated.errors " class ="help-block " th:if ="${#fields.hasErrors('perforated')} " th:each ="error : ${#fields.errors('perforated')} " th:text ="${error} "> </ span >
150
+ </ div >
151
+ </ div >
152
+
153
+ < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('image') ? 'has-error' : ''} ">
154
+ < label for ="image " class ="control-label col-sm-3 ">
155
+ < span class ="field-label " th:text ="#{t_image} ">
156
+ Image
157
+ </ span >
158
+ < span id ="image.required " class ="required_field "> *</ span >
159
+ </ label >
160
+ < div class ="col-sm-7 ">
161
+ < input type ="file " id ="image " class ="form-control " style ="box-shadow: none; border: 0px; " required ="required " accept ="image/png,image/jpeg " th:field ="*{image} " />
162
+ < small togglz:active ="ADD_ADDITIONAL_IMAGES_TO_SERIES " sec:authorize ="hasAuthority('ADD_IMAGES_TO_SERIES') ">
163
+ < span class ="hint-block " th:text ="#{t_add_more_images_hint} ">
164
+ You will be able to add additional images on the series page
165
+ </ span >
166
+ </ small >
167
+ < span id ="image.errors " class ="help-block " th:if ="${#fields.hasErrors('image')} " th:each ="error : ${#fields.errors('image')} " th:text ="${error} "> </ span >
168
+ </ div >
169
+ </ div >
170
+
171
+ < div class ="form-group js-collapse-toggle-header ">
172
+ < div class ="col-sm-offset-3 col-sm-5 ">
173
+ < 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} ">
174
+ Specify date of release
175
+ </ a >
176
+ </ div >
177
+ </ div >
178
+
179
+ < 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
180
< label for ="year " class ="control-label col-sm-3 ">
115
181
< span class ="field-label " th:text ="#{t_issue_date} ">
116
182
Date of release
@@ -194,40 +260,15 @@ <h3 th:text="#{t_add_series_ucfirst}">
194
260
</ div >
195
261
</ div >
196
262
197
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('quantity') ? 'has-error' : ''} ">
198
- < label for ="quantity " class ="control-label col-sm-3 ">
199
- < span class ="field-label " th:text ="#{t_quantity} ">
200
- Quantity
201
- </ span >
202
- < span id ="quantity.required " class ="required_field "> *</ span >
203
- </ label >
204
- < div class ="col-sm-2 ">
205
- < input type ="number "
206
- id ="quantity "
207
- class ="form-control "
208
- required ="required "
209
- th:min ="${T(ru.mystamps.web.validation.ValidationRules).MIN_STAMPS_IN_SERIES} "
210
- th:max ="${T(ru.mystamps.web.validation.ValidationRules).MAX_STAMPS_IN_SERIES} "
211
- min ="1 "
212
- max ="50 "
213
- th:field ="*{quantity} " />
214
- < span id ="quantity.errors " class ="help-block " th:if ="${#fields.hasErrors('quantity')} " th:each ="error : ${#fields.errors('quantity')} " th:text ="${error} "> </ span >
215
- </ div >
216
- </ div >
217
-
218
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('perforated') ? 'has-error' : ''} ">
219
- < label for ="perforated " class ="control-label col-sm-3 ">
220
- < span class ="field-label " th:text ="#{t_perforated} ">
221
- Perforated
222
- </ span >
223
- </ label >
224
- < div class ="col-sm-1 ">
225
- < input type ="checkbox " id ="perforated " checked ="checked " th:field ="*{perforated} " />
226
- < span id ="perforated.errors " class ="help-block " th:if ="${#fields.hasErrors('perforated')} " th:each ="error : ${#fields.errors('perforated')} " th:text ="${error} "> </ span >
263
+ < div class ="form-group js-collapse-toggle-header ">
264
+ < div class ="col-sm-offset-3 col-sm-7 ">
265
+ < 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} ">
266
+ Add information from stamps catalogues
267
+ </ a >
227
268
</ div >
228
269
</ div >
229
270
230
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('michelNumbers') or #fields.hasErrors('michelPrice') or #fields.hasErrors('michelCurrency') ? 'has-error ' : ''} ">
271
+ < div class ="form-group form-group-sm collapse js-catalogs-info " th:classappend ="|${michelHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in ' : ''}| ">
231
272
< label for ="michelNumbers " class ="control-label col-sm-3 ">
232
273
< span class ="field-label " th:text ="#{t_michel} ">
233
274
Michel
@@ -260,7 +301,7 @@ <h3 th:text="#{t_add_series_ucfirst}">
260
301
</ div >
261
302
</ div >
262
303
263
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('scottNumbers') or #fields.hasErrors('scottPrice') or #fields.hasErrors('scottCurrency') ? 'has-error ' : ''} ">
304
+ < div class ="form-group form-group-sm collapse js-catalogs-info " th:classappend ="|${scottHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in ' : ''}| ">
264
305
< label for ="scottNumbers " class ="control-label col-sm-3 ">
265
306
< span class ="field-label " th:text ="#{t_scott} ">
266
307
Scott
@@ -293,7 +334,7 @@ <h3 th:text="#{t_add_series_ucfirst}">
293
334
</ div >
294
335
</ div >
295
336
296
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('yvertNumbers') or #fields.hasErrors('yvertPrice') or #fields.hasErrors('yvertCurrency') ? 'has-error ' : ''} ">
337
+ < div class ="form-group form-group-sm collapse js-catalogs-info " th:classappend ="|${yvertHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in ' : ''}| ">
297
338
< label for ="yvertNumbers " class ="control-label col-sm-3 ">
298
339
< span class ="field-label " th:text ="#{t_yvert} ">
299
340
Yvert
@@ -326,7 +367,7 @@ <h3 th:text="#{t_add_series_ucfirst}">
326
367
</ div >
327
368
</ div >
328
369
329
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('gibbonsNumbers') or #fields.hasErrors('gibbonsPrice') or #fields.hasErrors('gibbonsCurrency') ? 'has-error ' : ''} ">
370
+ < div class ="form-group form-group-sm collapse js-catalogs-info " th:classappend ="|${gibbonsHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'in ' : ''}| ">
330
371
< label for ="gibbonsNumbers " class ="control-label col-sm-3 ">
331
372
< span class ="field-label " th:text ="#{t_sg} ">
332
373
Gibbons
@@ -359,7 +400,15 @@ <h3 th:text="#{t_add_series_ucfirst}">
359
400
</ div >
360
401
</ div >
361
402
362
- < div class ="form-group " th:classappend ="${#fields.hasErrors('comment') ? 'has-error' : ''} " sec:authorize ="hasAuthority('ADD_COMMENTS_TO_SERIES') ">
403
+ < div class ="form-group js-collapse-toggle-header " sec:authorize ="hasAuthority('ADD_COMMENTS_TO_SERIES') ">
404
+ < div class ="col-sm-offset-3 col-sm-5 ">
405
+ < 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} ">
406
+ Add comment
407
+ </ a >
408
+ </ div >
409
+ </ div >
410
+
411
+ < div class ="form-group collapse js-comment " th:classappend ="${#fields.hasErrors('comment') ? 'has-error in' : ''} " sec:authorize ="hasAuthority('ADD_COMMENTS_TO_SERIES') ">
363
412
< label for ="comment " class ="control-label col-sm-3 ">
364
413
< span class ="field-label " th:text ="#{t_comment} ">
365
414
Comment
@@ -371,24 +420,6 @@ <h3 th:text="#{t_add_series_ucfirst}">
371
420
</ div >
372
421
</ div >
373
422
374
- < div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('image') ? 'has-error' : ''} ">
375
- < label for ="image " class ="control-label col-sm-3 ">
376
- < span class ="field-label " th:text ="#{t_image} ">
377
- Image
378
- </ span >
379
- < span id ="image.required " class ="required_field "> *</ span >
380
- </ label >
381
- < div class ="col-sm-7 ">
382
- < input type ="file " id ="image " class ="form-control " style ="box-shadow: none; border: 0px; " required ="required " accept ="image/png,image/jpeg " th:field ="*{image} " />
383
- < small togglz:active ="ADD_ADDITIONAL_IMAGES_TO_SERIES " sec:authorize ="hasAuthority('ADD_IMAGES_TO_SERIES') ">
384
- < span class ="hint-block " th:text ="#{t_add_more_images_hint} ">
385
- You will be able to add additional images on the series page
386
- </ span >
387
- </ small >
388
- < span id ="image.errors " class ="help-block " th:if ="${#fields.hasErrors('image')} " th:each ="error : ${#fields.errors('image')} " th:text ="${error} "> </ span >
389
- </ div >
390
- </ div >
391
-
392
423
< div class ="form-group form-group-sm ">
393
424
< div class ="col-sm-offset-3 col-sm-5 ">
394
425
< input type ="submit " class ="btn btn-primary " value ="Add " th:value ="#{t_add} " />
@@ -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