diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler.png b/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler.png new file mode 100644 index 0000000000000..afcbb115d1919 Binary files /dev/null and b/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler.png differ diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_empty.png b/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_empty.png new file mode 100644 index 0000000000000..b5b27c79fc355 Binary files /dev/null and b/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_empty.png differ diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_hover.png b/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_hover.png new file mode 100644 index 0000000000000..dad1b3fce39ac Binary files /dev/null and b/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_hover.png differ diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_hover_empty.png b/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_hover_empty.png new file mode 100644 index 0000000000000..d5c873c1b8413 Binary files /dev/null and b/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_hover_empty.png differ diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig index 1bc7cfbbefe5b..602ae9668ba2a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -29,6 +29,16 @@ /*background: #F6F6F6;*/ margin: -30px -40px -40px; } + .toggle-icon { + display: inline-block; + background: url("{{ asset('bundles/framework/images/toggler.png') }}") no-repeat top left #5eb5e0; + } + .closed .toggle-icon, .closed.toggle-icon { + background-position: bottom left; + } + .toggle-icon.empty { + background-image: url("{{ asset('bundles/framework/images/toggler_empty.png') }}"); + } .tree { width: 230px; padding: 10px; @@ -45,45 +55,127 @@ padding: 0; width: 100%; } - .tree a { - text-decoration: none; - display: block; - padding: 5px 7px; + .tree .tree-inner { + width: 100%; + padding: 5px 7px 5px 22px; border-radius: 6px; color: #313131; + cursor: pointer; + position: relative; + + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } - .tree ul ul a { - padding-left: 22px; + .tree a { + text-decoration: none; + } + .tree .toggle-button { + /* provide a bigger clickable area than just 10x10px */ + width: 16px; + height: 16px; + /* vertically center the button */ + position: absolute; + top: 50%; + margin-top: -8px; + margin-left: -18px; + } + .tree .toggle-icon { + width: 10px; + height: 10px; + /* position the icon in the center of the clickable area */ + margin-left: 3px; + margin-top: 3px; + background-size: 10px 20px; + background-color: #ccc; + } + .tree .toggle-icon.empty { + width: 10px; + height: 10px; + position: absolute; + top: 50%; + margin-top: -5px; + margin-left: -15px; + background-size: 10px 10px; } - .tree ul ul ul a { + .tree ul ul .tree-inner { padding-left: 37px; } - .tree ul ul ul ul a { + .tree ul ul ul .tree-inner { padding-left: 52px; } - .tree ul ul ul ul ul a { + .tree ul ul ul ul .tree-inner { padding-left: 67px; } - .tree a:hover { + .tree ul ul ul ul ul .tree-inner { + padding-left: 82px; + } + .tree .tree-inner:hover { background: #dfdfdf; } - .tree a.active, a.active:hover { + .tree .tree-inner.active, .tree .tree-inner.active:hover { background: #dfdfdf; font-weight: bold; color: #313131; } + .tree .tree-inner.active .toggle-icon, .tree .tree-inner:hover .toggle-icon, .tree .tree-inner.active:hover .toggle-icon { + background-image: url("{{ asset('bundles/framework/images/toggler_hover.png') }}"); + background-color: #aaa; + } + .tree .tree-inner.active .toggle-icon.empty, .tree .tree-inner:hover .toggle-icon.empty, .tree .tree-inner.active:hover .toggle-icon.empty { + background-image: url("{{ asset('bundles/framework/images/toggler_hover_empty.png') }}"); + } .tree-details { border-left: 1px solid #dfdfdf; background: white; margin-left: 250px; padding: 30px 40px 40px; } + .tree-details h3 { + position: relative; + } + .tree-details .toggle-icon { + width: 16px; + height: 16px; + /* vertically center the button */ + position: absolute; + top: 50%; + margin-top: -9px; + margin-left: 6px; + } .form-type { color: #999999; } .hidden { display: none; } + .badge-error { + float: right; + background: #a33; + color: #fff; + padding: 1px 4px; + font-size: 10px; + font-weight: bold; + vertical-align: middle; + border-radius: 6px; + } + .errors h3 { + color: #800; + } + .errors th, .errors td { + border-color: #800; + } + .errors th { + background: #a33; + color: #fff; + } + .errors .toggle-icon { + background-color: #a33; + } + h3 a, h3 a:hover, h3 a:focus { + color: inherit; + text-decoration: inherit; + } {% if collector.data.forms|length %} @@ -93,7 +185,7 @@ @@ -107,78 +199,167 @@ {% endif %} {% endblock %} -{% macro form_tree_entry(name, data) %} +{% macro form_tree_entry(name, data, expanded) %}
  • - {{ name }} +
    + {% if data.children is not empty %} + + {% else %} +
    + {% endif %} + {{ name }} + {% if data.errors is defined and data.errors|length > 0 %} +
    {{ data.errors|length }}
    + {% endif %} +
    {% if data.children is not empty %} -