From 11bfda60abdb0462678c52a8f66b978967259c0e Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Sun, 29 Dec 2013 16:46:37 +0100 Subject: [PATCH 1/7] [WebProfilerBundle] Vertically centered the icons in the form tree --- .../Resources/views/Collector/form.html.twig | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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 eb5eeb75c1522..3ea410a1bf670 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -47,10 +47,11 @@ } .tree .tree-inner { width: 100%; - padding: 5px 7px; + padding: 5px 7px 5px 22px; border-radius: 6px; color: #313131; cursor: pointer; + position: relative; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; @@ -62,20 +63,22 @@ .tree .toggle-button { width: 10px; height: 10px; - background: none; - border: none; + position: absolute; + top: 50%; + margin-top: -5px; + margin-left: -15px; } .tree ul ul .tree-inner { - padding-left: 22px; + padding-left: 37px; } .tree ul ul ul .tree-inner { - padding-left: 37px; + padding-left: 52px; } .tree ul ul ul ul .tree-inner { - padding-left: 52px; + padding-left: 67px; } .tree ul ul ul ul ul .tree-inner { - padding-left: 67px; + padding-left: 82px; } .tree .tree-inner:hover { background: #dfdfdf; From 07994d5e7480afd50666bd133fa8993e73edcda2 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Mon, 30 Dec 2013 14:55:17 +0100 Subject: [PATCH 2/7] [WebProfilerBundle] Improved JavaScript of the form debugger --- .../Resources/public/images/toggler.png | Bin 0 -> 295 bytes .../Resources/public/images/toggler_empty.png | Bin 0 -> 238 bytes .../Resources/views/Collector/form.html.twig | 269 ++++++++++-------- .../views/Profiler/base_js.html.twig | 10 +- 4 files changed, 155 insertions(+), 124 deletions(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler.png create mode 100644 src/Symfony/Bundle/FrameworkBundle/Resources/public/images/toggler_empty.png 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 0000000000000000000000000000000000000000..b436c7bd734ca1d5619d6d40cfed4d4958c7d5a1 GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^0zj<5!3HFyJAa%3Qfx`y?k)^zAjrPUD;FrjS>O>_ z%)r1c48n{Iv*t(u1=&kHeO=k_^2qVAX!x*dZ~%q2c)B=-cpSewtAr@bWSL3Ht|2rsy4D>2Wxptt4#2w$4zDfo=mi-k!H;;W)l+?QVlg-C(m4AM4uTo#R lZa(|m=Lf&|HOw>N&ts1E=;;#Ou@mTi22WQ%mvv4FO#m*mY104z literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..3059b9cdb31d9e8ec4962b8896490115f9eed70b GIT binary patch literal 238 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE(~cP$iB-f7bwD6;1OBO zz`!jG!i)^F=12eq*-JcqUD@yQ$nmjgU*)OX1Qe?Fba4!^IQ@3=M!~}dJk0SjhjOqsJpY*2~rPjM5vJxWAh$@U&v=I-0-WGmocL zmwEk(z{Bb3HxJpTM#i)4z(}g48L0r%IUdJ6U&<_l;ml3_%dTiyz!|e cj8~=hX)TcB^m`o00(1t0r>mdKI;Vst031wAj{pDw literal 0 HcmV?d00001 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 3ea410a1bf670..ebd051208c0a5 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,13 @@ /*background: #F6F6F6;*/ margin: -30px -40px -40px; } + .toggle-button { + display: inline-block; + background: url("/bundles/framework/images/toggler.png") no-repeat top left; + } + .toggle-button.closed { + background-position: bottom left; + } .tree { width: 230px; padding: 10px; @@ -63,11 +70,18 @@ .tree .toggle-button { width: 10px; height: 10px; + /* vertically center the button */ position: absolute; top: 50%; margin-top: -5px; margin-left: -15px; } + .tree a.toggle-button { + background-size: 10px 20px; + } + .tree img.toggle-button { + background: none; + } .tree ul ul .tree-inner { padding-left: 37px; } @@ -94,15 +108,25 @@ margin-left: 250px; padding: 30px 40px 40px; } + .tree-details h3 { + position: relative; + padding-left: 22px; + } + .tree-details .toggle-button { + width: 16px; + height: 16px; + /* vertically center the button */ + position: absolute; + top: 50%; + margin-top: -9px; + margin-left: -22px; + } .form-type { color: #999999; } .hidden { display: none; } - .btn-toggle { - cursor: pointer; - } .badge-error { float: right; background: #a33; @@ -125,7 +149,7 @@
    {% for formName, formData in collector.data.forms %} - {{ form_tree_entry(formName, formData) }} + {{ form_tree_entry(formName, formData, true) }} {% endfor %}
@@ -139,134 +163,152 @@ {% endif %} {% endblock %} -{% macro form_tree_entry(name, data) %} +{% macro form_tree_entry(name, data, expanded) %}
  • -
    +
    {% if data.children is not empty %} - - + {% else %} - + {% endif %} {{ name }} {% if data.errors is defined and data.errors|length > 0 %} @@ -275,9 +317,9 @@
    {% if data.children is not empty %} -
      + {% endif %} @@ -285,7 +327,7 @@ {% endmacro %} {% macro form_tree_details(name, data) %} -
      +

      {{ name }} {% if data.type_class is defined %} @@ -312,11 +354,8 @@ {% if data.default_data is defined %}

      + Default Data - - - -

      @@ -351,11 +390,8 @@ {% if data.submitted_data is defined %}

      + Submitted Data - - - -

      @@ -394,11 +430,8 @@ {% if data.passed_options is defined %}

      + Passed Options - - - -

      @@ -431,14 +464,11 @@ {% if data.resolved_options is defined %}

      + Resolved Options - - - -

      -