[Form][WebProfiler] Empty form names fix

When a Form had no name, the markup was broken in the profiler,
making the form tree ugly.
This commit is contained in:
Stepan Anchugov 2014-10-27 15:16:22 +05:00 committed by Fabien Potencier
parent 9500411c9a
commit 6e9642a9da

View File

@ -420,7 +420,7 @@
{% else %}
<div class="toggle-icon empty"></div>
{% endif %}
{{ name }}
{{ name|default('(no name)') }}
{% if data.errors is defined and data.errors|length > 0 %}
<div class="badge-error">{{ data.errors|length }}</div>
{% endif %}
@ -437,9 +437,9 @@
{% endmacro %}
{% macro form_tree_details(name, data, forms_by_hash) %}
<div class="tree-details" id="{{ data.id }}-details">
<div class="tree-details" {% if data.id is defined %} id="{{ data.id }}-details"{% endif %}>
<h2>
{{ name }}
{{ name|default('(no name)') }}
{% if data.type_class is defined %}
<span class="form-type">[<abbr title="{{ data.type_class }}">{{ data.type }}</abbr>]</span>
{% endif %}