File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Resources/views/Collector Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 164
164
font-weight : bold ;
165
165
vertical-align : middle ;
166
166
}
167
+ .has-error {
168
+ color : #B0413E ;
169
+ }
167
170
.errors h3 {
168
171
color : #B0413E ;
169
172
}
423
426
</script >
424
427
{% endblock %}
425
428
426
- {% macro form_tree_entry(name , data , expanded ) %}
429
+ {% macro form_tree_entry(name , data , is_root ) %}
427
430
{% import _self as tree %}
431
+ {% set has_error = data .errors is defined and data .errors | length > 0 %}
428
432
<li >
429
433
<div class =" tree-inner" data-tab-target-id =" {{ data .id }}-details" >
430
- {% if data . errors is defined and data . errors | length > 0 %}
434
+ {% if has_error %}
431
435
<div class =" badge-error" >{{ data .errors | length }}</div >
432
436
{% endif %}
433
437
437
441
<div class =" toggle-icon empty" ></div >
438
442
{% endif %}
439
443
440
- {{ name | default (' (no name)' ) }} {% if data .type_class is defined %}[<abbr title =" {{ data .type_class }}" >{{ data .type_class | split (' \\' )| last }}</abbr >]{% endif %}
444
+ <span {% if has_error or data .has_children_error | default (false ) %}class =" has-error" {% endif %}>
445
+ {{ name | default (' (no name)' ) }} {% if data .type_class is defined %}[<abbr title =" {{ data .type_class }}" >{{ data .type_class | split (' \\' )| last }}</abbr >]{% endif %}
446
+ </span >
441
447
</div >
442
448
443
449
{% if data .children is not empty %}
444
- <ul id =" {{ data .id }}-children" {% if not expanded %}class =" hidden" {% endif %}>
450
+ <ul id =" {{ data .id }}-children" {% if not is_root and not data . has_children_error | default ( false ) %}class =" hidden" {% endif %}>
445
451
{% for childName , childData in data .children %}
446
452
{{ tree.form_tree_entry (childName , childData , false ) }}
447
453
{% endfor %}
You can’t perform that action at this time.
0 commit comments