From 547076e3ea1f2c9bbab05e1d2f8e6abf09f03153 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 14 Mar 2018 10:51:38 +0100 Subject: [PATCH] Added some HTML5 features to the Symfony Profiler --- .../views/Collector/logger.html.twig | 2 +- .../Resources/views/Profiler/layout.html.twig | 2 +- .../views/Profiler/results.html.twig | 28 ++++++++----------- .../Resources/views/Profiler/search.html.twig | 4 +-- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig index 6e92022a44..829dfe1787 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -203,7 +203,7 @@ {% if show_level %} {{ log.priorityName }} {% endif %} - {{ log.timestamp|date('H:i:s') }} + {% if channel_is_defined %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig index ff1124bfde..7c0b2201ff 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig @@ -77,7 +77,7 @@
Profiled on
-
{{ profile.time|date('r') }}
+
Token
{{ profile.token }}
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig index cd9fd06cc6..fb5c3aa6d1 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig @@ -1,5 +1,13 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} +{% macro profile_search_filter(request, result, property) %} + {%- if request.session is not null -%} + {{ include('@WebProfiler/Icon/search.svg') }} + {%- endif -%} +{% endmacro %} + +{% import _self as helper %} + {% block summary %}
@@ -32,28 +40,14 @@ {{ result.status_code|default('n/a') }} - {{ result.ip }} - {% if request.session is not null %} - - {{ include('@WebProfiler/Icon/search.svg') }} - - {% endif %} + {{ result.ip }} {{ helper.profile_search_filter(request, result, 'ip') }} - {{ result.method }} - {% if request.session is not null %} - - {{ include('@WebProfiler/Icon/search.svg') }} - - {% endif %} + {{ result.method }} {{ helper.profile_search_filter(request, result, 'method') }} {{ result.url }} - {% if request.session is not null %} - - {{ include('@WebProfiler/Icon/search.svg') }} - - {% endif %} + {{ helper.profile_search_filter(request, result, 'url') }} {{ result.time|date('d-M-Y') }} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig index d98414e727..71059ed235 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig @@ -17,12 +17,12 @@
- +
- +