From 05773c263b1704adb833a8e59d7884c2049b36f1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 12 Aug 2015 16:14:36 +0200 Subject: [PATCH] Redesigned the Symfony Profiler --- .../Twig/DataCollector/TwigDataCollector.php | 16 +- .../Resources/views/Profiler/dump.html.twig | 79 +- .../Resources/views/Profiler/icon.svg | 4 + .../Resources/views/Collector/icon.svg | 3 + .../views/Collector/security.html.twig | 105 +- .../Controller/ProfilerController.php | 1 + .../views/Collector/config.html.twig | 228 ++-- .../views/Collector/events.html.twig | 148 ++- .../views/Collector/exception.css.twig | 109 +- .../views/Collector/exception.html.twig | 24 +- .../Resources/views/Collector/form.html.twig | 559 ++++----- .../views/Collector/logger.html.twig | 205 ++-- .../views/Collector/memory.html.twig | 4 +- .../views/Collector/request.html.twig | 300 +++-- .../views/Collector/router.html.twig | 7 +- .../Resources/views/Collector/time.html.twig | 158 ++- .../views/Collector/translation.html.twig | 231 ++-- .../Resources/views/Collector/twig.html.twig | 85 +- .../Resources/views/Icon/config.svg | 3 + .../Resources/views/Icon/event.svg | 11 + .../Resources/views/Icon/exception.svg | 15 + .../Resources/views/Icon/no.svg | 5 + .../Resources/views/Icon/request.svg | 16 + .../Resources/views/Icon/router.svg | 6 + .../Resources/views/Icon/search.svg | 7 + .../Resources/views/Icon/yes.svg | 5 + .../Resources/views/Profiler/admin.html.twig | 9 +- .../Resources/views/Profiler/bag.html.twig | 12 +- .../Resources/views/Profiler/base.html.twig | 13 +- .../views/Profiler/base_js.html.twig | 149 ++- .../Resources/views/Profiler/body.css.twig | 137 --- .../Resources/views/Profiler/header.html.twig | 33 +- .../Resources/views/Profiler/info.html.twig | 77 +- .../Resources/views/Profiler/layout.html.twig | 174 +-- .../views/Profiler/profiler.css.twig | 1023 ++++++++++++----- .../views/Profiler/results.html.twig | 47 +- .../Resources/views/Profiler/search.html.twig | 89 +- .../Resources/views/Profiler/table.html.twig | 10 +- .../views/Profiler/toolbar_js.html.twig | 2 +- .../Resources/views/Router/panel.html.twig | 120 +- .../Debug/TraceableEventDispatcher.php | 81 +- .../Debug/TraceableEventDispatcherTest.php | 4 +- 42 files changed, 2547 insertions(+), 1767 deletions(-) create mode 100644 src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/icon.svg create mode 100644 src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/icon.svg create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/config.svg create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/event.svg create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/exception.svg create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/no.svg create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/request.svg create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/router.svg create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/search.svg create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/yes.svg delete mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/body.css.twig diff --git a/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php b/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php index 763a5ec4b31e..90b21d0495ff 100644 --- a/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php +++ b/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php @@ -74,8 +74,20 @@ public function getMacroCount() public function getHtmlCallGraph() { $dumper = new \Twig_Profiler_Dumper_Html(); - - return new \Twig_Markup($dumper->dump($this->getProfile()), 'UTF-8'); + $dump = $dumper->dump($this->getProfile()); + + // needed to remove the hardcoded CSS styles + $dump = str_replace(array( + '', + '', + '', + ), array( + '', + '', + '', + ), $dump); + + return new \Twig_Markup($dump, 'UTF-8'); } public function getProfile() diff --git a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig index 7f2354746963..1163d283d020 100644 --- a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig +++ b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig @@ -1,15 +1,10 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} - {% set dumps_count = collector.dumpsCount %} - - {% if dumps_count %} + {% if collector.dumpsCount %} {% set icon %} - - - - - {{ dumps_count }} + {{ include('@Debug/Profiler/icon.svg') }} + {{ collector.dumpsCount }} {% endset %} {% set text %} @@ -28,6 +23,7 @@ {% endif %} line {{ dump.line }} + {{ dump.data|raw }} {% endfor %} @@ -39,42 +35,18 @@ {% endblock %} {% block menu %} - - - {{- "" -}} - - {{- "" -}} - - dump() - - {{ collector.dumpsCount }} - + + {{ include('@Debug/Profiler/icon.svg') }} + Debug {% endblock %} {% block panel %} -

dump()

+

Dumped Contents

- - - {% if collector.dumpsCount %} -
    - {% for dump in collector.getDumps('html') %} -
  • - in + {% for dump in collector.getDumps('html') %} +
    +

    In {% if dump.line %} {% set link = dump.file|file_link(dump.line) %} {% if link %} @@ -85,19 +57,22 @@ {% else %} {{ dump.name }} {% endif %} - line {{ dump.line }}: - - - {% if dump.fileExcerpt %}{{ dump.fileExcerpt|raw }}{% else %}{{ dump.file|file_excerpt(dump.line) }}{% endif %} - + line {{ dump.line }} - {{ dump.data|raw }} -

  • - {% endfor %} -
+ Show code + + + + + {{ dump.data|raw }} + {% else %} -

- No dumped variable -

- {% endif %} +
+

No content was dumped.

+
+ {% endfor %} {% endblock %} diff --git a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/icon.svg b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/icon.svg new file mode 100644 index 000000000000..2f7e708c8b3d --- /dev/null +++ b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/icon.svg b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/icon.svg new file mode 100644 index 000000000000..02033fdc7f5e --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 6c5b85356de1..5d36088c4341 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -1,5 +1,7 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} +{% block page_title 'Security' %} + {% block toolbar %} {% if collector.tokenClass %} {% set is_authenticated = collector.enabled and collector.authenticated %} @@ -9,9 +11,7 @@ {% endif %} {% set icon %} - - - + {{ include('@Security/Collector/icon.svg') }} {{ collector.user|default('n/a') }} {% endset %} @@ -21,10 +21,12 @@ Logged in as {{ collector.user }} +
Authenticated {{ is_authenticated ? 'Yes' : 'No' }}
+ {% if collector.tokenClass != null %}
Token class @@ -46,54 +48,69 @@ {% endblock %} {% block menu %} - - - Security - + + {{ include('@Security/Collector/icon.svg') }} + Security + {% endblock %} {% block panel %} -

Security

+

Security Token

+ {% if collector.tokenClass %} +
+
+ {{ collector.user == 'anon.' ? 'Anonymous' : collector.user }} + Username +
+ +
+ {{ include('@WebProfiler/Icon/' ~ (collector.authenticated ? 'yes' : 'no') ~ '.svg') }} + Authenticated +
+
+ - - - - - - - - - - - - - {% if collector.supportsRoleHierarchy %} - - - - - {% endif %} - {% if collector.tokenClass != null %} - - - - - {% endif %} + + + + + + + + + + + + + {% if collector.supportsRoleHierarchy %} + + + + + {% endif %} + + {% if collector.tokenClass %} + + + + + {% endif %} +
Username{{ collector.user }}
Authenticated? - {% if collector.authenticated %} - yes - {% else %} - no {% if not collector.roles|length %}(probably because the user has no roles){% endif %} - {% endif %} -
Roles{{ collector.roles|yaml_encode }}
Inherited Roles{{ collector.inheritedRoles|yaml_encode }}
Token class{{ collector.tokenClass }}
PropertyValue
Roles + {{ collector.roles is empty ? 'none' : collector.roles|yaml_encode }} + + {% if not collector.authenticated and collector.roles is empty %} +

User is not authenticated probably because they have no roles.

+ {% endif %} +
Inherited Roles{{ collector.inheritedRoles is empty ? 'none' : collector.inheritedRoles|yaml_encode }}
Token class{{ collector.tokenClass }}
{% elseif collector.enabled %} -

- No token -

+
+

There is no security token.

+
{% else %} -

- The security component is disabled -

+
+

The security component is disabled.

+
{% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 261d0afcb908..21b02190c970 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -112,6 +112,7 @@ public function panelAction(Request $request, $token) 'request' => $request, 'templates' => $this->getTemplateManager()->getTemplates($profile), 'is_ajax' => $request->isXmlHttpRequest(), + 'profiler_markup_version' => 2, // 1 = original profiler, 2 = Symfony 2.8+ profiler )), 200, array('Content-Type' => 'text/html')); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index 7379beaae862..669f654b72fd 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -19,21 +19,22 @@ {% endif %} {% set icon %} - {% if collector.symfonyState is defined %} + {% if collector.applicationname %} + {{ collector.applicationname }} + {{ collector.applicationversion }} + {% elseif collector.symfonyState is defined %} {{ include('@WebProfiler/Icon/symfony.svg') }} {{ collector.symfonyversion }} - {% elseif collector.applicationname %} - {{ collector.applicationname }} - {{ collector.applicationversion }} {% endif %} {% endset %} {% set text %} {% if collector.applicationname %}
- {{ collector.applicationname }} {{ collector.applicationversion }} + {{ collector.applicationname }} + {{ collector.applicationversion }}
{% endif %} @@ -88,118 +89,149 @@ {{ collector.sapiName }}
+ {% if collector.symfonyversion is defined %}
Resources - - Read Symfony {{ collector.symfonyversion }} Docs - + {% if 'Silex' == collector.applicationname %} + + Read Silex Docs + + {% else %} + + Read Symfony {{ collector.symfonyversion }} Docs + + {% endif %}
{% endif %} {% endset %} - {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false, status: block_status }) }} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: true, name: 'config', status: block_status }) }} {% endblock %} {% block menu %} - - - Config - + + {{ include('@WebProfiler/Icon/config.svg') }} + Configuration + {% endblock %} {% block panel %} -

Project Configuration

- - - - - - - {% if collector.applicationname %} - - - {% else %} - - + {% if collector.applicationname %} + {# this application is not the Symfony framework #} +

Project Configuration

+ +
+
+ {{ collector.applicationname }} + Application name +
+ +
+ {{ collector.applicationversion }} + Application version +
+
+ +

+ Based on Symfony {{ collector.symfonyversion }} +

+ {% else %} +

Symfony Configuration

+ +
+
+ {{ collector.symfonyversion }} + Symfony version +
+ + {% if 'n/a' != collector.appname %} +
+ {{ collector.appname }} + Application name +
{% endif %} -
- {% if 'n/a' != collector.appname %} - - - - - {% endif %} - {% if 'n/a' != collector.env %} - - - - - {% endif %} - {% if 'n/a' != collector.debug %} - - - - - {% endif %} -
KeyValue
Application{{ collector.applicationname }} {{ collector.applicationversion }} (on Symfony {{ collector.symfonyversion }})Symfony version{{ collector.symfonyversion }}
Application name{{ collector.appname }}
Environment{{ collector.env }}
Debug{{ collector.debug ? 'enabled' : 'disabled' }}
- -

PHP configuration

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyValue
PHP version{{ collector.phpversion }}
Xdebug{{ collector.hasxdebug ? 'enabled' : 'disabled' }}
PHP acceleration{{ collector.hasaccelerator ? 'enabled' : 'disabled' }}
XCache{{ collector.hasxcache ? 'enabled' : 'disabled' }}
APC{{ collector.hasapc ? 'enabled' : 'disabled' }}
Zend OPcache{{ collector.haszendopcache ? 'enabled' : 'disabled' }}
EAccelerator{{ collector.haseaccelerator ? 'enabled' : 'disabled' }}
Full PHP configurationphpinfo
+ + {% if 'n/a' != collector.env %} +
+ {{ collector.env }} + Environment +
+ {% endif %} + + {% if 'n/a' != collector.debug %} +
+ {{ collector.debug ? 'enabled' : 'disabled' }} + Debug +
+ {% endif %} + + {% endif %} + +

PHP Configuration

+ +
+
+ {{ collector.phpversion }} + PHP version +
+ +
+ {{ include('@WebProfiler/Icon/' ~ (collector.hasaccelerator ? 'yes' : 'no') ~ '.svg') }} + PHP acceleration +
+ +
+ {{ include('@WebProfiler/Icon/' ~ (collector.hasxdebug ? 'yes' : 'no') ~ '.svg') }} + Xdebug +
+
+ +
+
+ {{ include('@WebProfiler/Icon/' ~ (collector.haszendopcache ? 'yes' : 'no') ~ '.svg') }} + OPcache +
+ +
+ {{ include('@WebProfiler/Icon/' ~ (collector.hasapc ? 'yes' : 'no') ~ '.svg') }} + APC +
+ +
+ {{ include('@WebProfiler/Icon/' ~ (collector.hasxcache ? 'yes' : 'no') ~ '.svg') }} + XCache +
+ +
+ {{ include('@WebProfiler/Icon/' ~ (collector.haseaccelerator ? 'yes' : 'no') ~ '.svg') }} + EAccelerator +
+
+ +

+ View full PHP configuration +

{% if collector.bundles %} -

Active bundles

+

Enabled Bundles ({{ collector.bundles|length }})

- - - - - {% set bundles = collector.bundles %} - {% for name in bundles|keys|sort %} - - - - - {% endfor %} + + + + + + + + {% for name in collector.bundles|keys|sort %} + + + + + {% endfor %} +
NamePath
{{ name }}{{ bundles[name] }}
NamePath
{{ name }}{{ collector.bundles[name] }}
{% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/events.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/events.html.twig index 879e537f13ce..24a1e3fff99a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/events.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/events.html.twig @@ -1,79 +1,117 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} -{% from _self import display_listener %} +{% import _self as helper %} {% block menu %} - + {{ include('@WebProfiler/Icon/event.svg') }} Events {% endblock %} {% block panel %} - {% if collector.calledlisteners|length %} - {{ block('panelContent') }} +

Event Dispatcher

+ + {% if collector.calledlisteners is empty %} +
+

No events have been recorded. Check that debugging is enabled in the kernel.

+
{% else %} -

Events

-

- No events have been recorded. Are you sure that debugging is enabled in the kernel? -

+
+
+

Called Listeners {{ collector.calledlisteners|length }}

+ +
+ {{ helper.render_table(collector.calledlisteners) }} +
+
+ +
+

Not Called Listeners {{ collector.notcalledlisteners|length }}

+
+ {% if collector.notcalledlisteners is empty %} +
+

+ There are no uncalled listeners. +

+

+ All listeners were called for this request or an error occurred + when trying to collect uncalled listeners (in which case check the + logs to get more information). +

+
+ {% else %} + {{ helper.render_table(collector.notcalledlisteners) }} + {% endif %} +
+
+
{% endif %} {% endblock %} -{% block panelContent %} -

Called Listeners

- +{% macro render_table(listeners) %} - - - - - {% for listener in collector.calledlisteners %} + - - + + - {% endfor %} -
Event nameListener
{{ listener.event }}{{ display_listener(listener) }}PriorityListener
+ + + {% set previous_event = (listeners|first).event %} + {% for listener in listeners %} + {% if loop.first or listener.event != previous_event %} + {% if not loop.first %} + + {% endif %} + + + + {{ listener.event }} + -

Not Called Listeners

+ {% set previous_event = listener.event %} + {% endif %} - {% if collector.notcalledlisteners %} - - - - - {% set listeners = collector.notcalledlisteners %} - {% for listener in listeners|keys|sort %} - - - - - {% endfor %} -
Event nameListener
{{ listeners[listener].event }}{{ display_listener(listeners[listener]) }}
- {% else %} -

- No uncalled listeners. -

-

+ {{ listener.priority|default('-') }} + + {% if listener.type == 'Closure' %} - All listeners were called for this request or an error occurred - when trying to collect uncalled listeners (in which case check the - logs to get more information). + Closure + (there is no class or file information) -

- {% endif %} -{% endblock %} + {% elseif listener.type == 'Function' %} -{% macro display_listener(listener) %} - {% if listener.type == "Closure" %} - Closure - {% elseif listener.type == "Function" %} - {% set link = listener.file|file_link(listener.line) %} - {% if link %}{{ listener.function }}{% else %}{{ listener.function }}{% endif %} - {% elseif listener.type == "Method" %} - {% set link = listener.file|file_link(listener.line) %} - {{ listener.class|abbr_class }}::{% if link %}{{ listener.method }}{% else %}{{ listener.method }}{% endif %} - {% endif %} + {% set link = listener.file|file_link(listener.line) %} + {% if link %} + {{ listener.function }}() + ({{ listener.file }}) + {% else %} + {{ listener.function }}() + {{ listener.file }} (line {{ listener.line }}) + {% endif %} + + {% elseif listener.type == "Method" %} + + {% set link = listener.file|file_link(listener.line) %} + {% set class_namespace = listener.class|split('\\', -1)|join('\\') %} + + {% if link %} + {{ listener.class|abbr_class|striptags }}::{{ listener.method }}() + ({{ listener.class }}) + {% else %} + {{ class_namespace }}\{{ listener.class|abbr_class|striptags }}::{{ listener.method }}() + {{ listener.file }} (line {{ listener.line }}) + {% endif %} + + {% endif %} + + + + {% if loop.last %} + + {% endif %} + {% endfor %} + {% endmacro %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig index 1224081bd600..8d5eaf7e1ac4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig @@ -1,55 +1,82 @@ .sf-reset .traces { - padding-bottom: 14px; + padding: 0 0 1em 1.5em; +} +.sf-reset .traces a { + font-size: 14px; +} +.sf-reset .traces abbr { + border-bottom-color: #AAA; + padding-bottom: 2px; } .sf-reset .traces li { - font-size: 12px; - color: #868686; - padding: 5px 4px; + ccolor: #222; + font-size: 14px; + padding: 5px 0; list-style-type: decimal; - margin-left: 20px; + margin: 0 0 0 1em; white-space: break-word; } +.sf-reset .traces li.selected { + background: rgba(255, 255, 153, 0.5); +} + +.sf-reset .traces ol li { + font-size: 12px; + color: #777; +} .sf-reset #logs .traces li.error { - font-style: normal; color: #AA3333; - background: #f9ecec; } .sf-reset #logs .traces li.warning { - font-style: normal; - background: #ffcc00; -} -/* fix for Opera not liking empty
  • */ -.sf-reset .traces li:after { - content: "\00A0"; + background: #FFCC00; } .sf-reset .trace { - border: 1px solid #D3D3D3; + border: 1px solid #DDD; + background: #FFF; padding: 10px; overflow: auto; - margin: 10px 0 20px; + margin: 1em 0; +} +.sf-reset .trace code, +#traces-text pre { + font-size: 13px; } .sf-reset .block-exception { - border-radius: 16px; - margin-bottom: 20px; - background-color: #f6f6f6; - border: 1px solid #dfdfdf; - padding: 30px 28px; + margin-bottom: 2em; + background-color: #FFF; + border: 1px solid #EEE; + padding: 28px; word-wrap: break-word; overflow: hidden; } +.sf-reset .block-exception h1 { + font-size: 21px; + font-weight: normal; + margin: 0 0 12px; +} +.sf-reset .block-exception .linked { + margin-top: 1em; +} + +.sf-reset .block { + margin-bottom: 2em; +} +.sf-reset .block h2 { + font-size: 16px; +} .sf-reset .block-exception div { - color: #313131; - font-size: 10px; + font-size: 14px; } .sf-reset .block-exception-detected .illustration-exception, .sf-reset .block-exception-detected .text-exception { float: left; } .sf-reset .block-exception-detected .illustration-exception { - width: 152px; + width: 110px; } .sf-reset .block-exception-detected .text-exception { - width: 670px; + width: 650px; + margin-left: 20px; padding: 30px 44px 24px 46px; position: relative; } @@ -65,40 +92,6 @@ bottom: 0; right: 50px; } -.sf-reset .block-exception p { - font-family: Arial, Helvetica, sans-serif; -} -.sf-reset .block-exception p a, -.sf-reset .block-exception p a:hover { - color: #565656; -} -.sf-reset .logs h2 { - float: left; - width: 654px; -} -.sf-reset .error-count { - float: right; - width: 170px; - text-align: right; -} -.sf-reset .error-count span { - display: inline-block; - background-color: #aacd4e; - border-radius: 6px; - padding: 4px; - color: white; - margin-right: 2px; - font-size: 11px; - font-weight: bold; -} .sf-reset .toggle { vertical-align: middle; } -.sf-reset .linked ul, -.sf-reset .linked li { - display: inline; -} -.sf-reset #output-content { - color: #000; - font-size: 12px; -} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig index 5175f6610769..94dfbb6acac0 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig @@ -3,34 +3,34 @@ {% block head %} {% if collector.hasexception %} {% endif %} {{ parent() }} {% endblock %} {% block menu %} - - - Exception - + + {{ include('@WebProfiler/Icon/exception.svg') }} + Exception {% if collector.hasexception %} - 1 + + 1 + {% endif %} - {% endblock %} {% block panel %} -

    Exception

    +

    Exceptions

    {% if not collector.hasexception %} -

    - No exception was thrown and uncaught during the request. -

    +
    +

    No exception was thrown and caught during the request.

    +
    {% else %}
    - {{ render(path('_profiler_exception', { 'token': token })) }} + {{ render(path('_profiler_exception', { token: token })) }}
    {% endif %} {% endblock %} 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 d7b286647044..f119f5eb80e0 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -8,11 +8,7 @@ {% set icon %} {{ include('@WebProfiler/Icon/form.svg') }} - {% if collector.data.nb_errors %} - {{ collector.data.nb_errors }} - {% else %} - {{ collector.data.forms|length }} - {% endif %} + {{ collector.data.nb_errors ?: collector.data.forms|length }} {% endset %} @@ -32,188 +28,184 @@ {% endblock %} {% block menu %} - - + + {{ include('@WebProfiler/Icon/form.svg') }} Forms - {% if collector.data.forms|length %} - {{ collector.data.forms|length }} + {% if collector.data.nb_errors > 0 %} + + {{ collector.data.nb_errors }} + {% endif %} {% endblock %} -{% block panel %} - +{% endblock %} - {% if collector.data.forms|length %} -
    -
    -

    Forms

    +{% block panel %} +

    Forms

    -
      - {% for formName, formData in collector.data.forms %} - {{ form_tree_entry(formName, formData, true) }} - {% endfor %} -
    -
    + {% if collector.data.forms|length %} +
    +
      + {% for formName, formData in collector.data.forms %} + {{ form_tree_entry(formName, formData, true) }} + {% endfor %} +
    +
    +
    {% for formName, formData in collector.data.forms %} {{ form_tree_details(formName, formData, collector.data.forms_by_hash) }} {% endfor %}
    {% else %} -

    No forms were submitted for this request.

    +
    +

    No forms were submitted for this request.

    +
    {% endif %} -{% endblock %} - -{% macro state(translation) %} - {% if translation.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK') %} - same as fallback - {% elseif translation.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_MISSING') %} - missing - {% endif %} {% endmacro %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig index 95713b93db24..c3c8a5d5f676 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -31,58 +31,71 @@ {% endblock %} {% block menu %} - - Twig - Twig - - {{ collector.templatecount }} - {{ '%0.0f ms'|format(collector.time) }} + + {{ include('@WebProfiler/Icon/twig.svg') }} + Twig - {% endblock %} {% block panel %} - {% if collector.templatecount %} -

    Twig Stats

    + {% if collector.templatecount == 0 %} +

    Twig

    - - - - - - - - - - - - - - - - - -
    Total Render Time
    including sub-requests rendering time
    {{ '%0.0f ms'|format(collector.time) }}
    Template Calls
    {{ collector.templatecount }}
    Block Calls
    {{ collector.blockcount }}
    Macro Calls
    {{ collector.macrocount }}
    +
    +

    No Twig templates were rendered for this request.

    +
    + {% else %} +

    Twig Metrics

    + +
    +
    + {{ '%0.0f'|format(collector.time) }} ms + Render time +
    + +
    + {{ collector.templatecount }} + Template calls +
    + +
    + {{ collector.blockcount }} + Block calls +
    + +
    + {{ collector.macrocount }} + Macro calls +
    +
    + +

    + Render time includes sub-requests rendering time (if any). +

    Rendered Templates

    - - - - + + + + + + + {% for template, count in collector.templates %} - - + + {% endfor %} +
    Template NameRender Count
    Template NameRender Count
    {{ template }}
    {{ count }}
    {{ template }}{{ count }}

    Rendering Call Graph

    - {{ collector.htmlcallgraph }} - {% else %} -

    No Twig templates were rendered for this request.

    +
    + {{ collector.htmlcallgraph }} +
    {% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/config.svg b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/config.svg new file mode 100644 index 000000000000..9bafe3830175 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/config.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/event.svg b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/event.svg new file mode 100644 index 000000000000..7d15a66f0103 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/event.svg @@ -0,0 +1,11 @@ + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/exception.svg b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/exception.svg new file mode 100644 index 000000000000..98e4eb1ebd52 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/exception.svg @@ -0,0 +1,15 @@ + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/no.svg b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/no.svg new file mode 100644 index 000000000000..02eb4e9c6abb --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/no.svg @@ -0,0 +1,5 @@ + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/request.svg b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/request.svg new file mode 100644 index 000000000000..d74a72850dc0 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/request.svg @@ -0,0 +1,16 @@ + + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/router.svg b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/router.svg new file mode 100644 index 000000000000..061a0a19465a --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/router.svg @@ -0,0 +1,6 @@ + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/search.svg b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/search.svg new file mode 100644 index 000000000000..b5f0a2c85be4 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/search.svg @@ -0,0 +1,7 @@ + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/yes.svg b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/yes.svg new file mode 100644 index 000000000000..0f129bffc21b --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/yes.svg @@ -0,0 +1,5 @@ + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig index a47b254a7716..431861cad604 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig @@ -1,10 +1,7 @@ {% if token is not empty %} -