From c2fcadc6fead1c9d6ada83e8099401d3a84984c6 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 1 Jul 2015 09:07:03 +0200 Subject: [PATCH 01/44] Redesigned the web debug toolbar --- .../views/Collector/security.html.twig | 12 +- .../Resources/views/Collector/ajax.html.twig | 6 +- .../views/Collector/config.html.twig | 133 +++++------ .../Resources/views/Collector/form.html.twig | 14 +- .../views/Collector/logger.html.twig | 39 +--- .../views/Collector/memory.html.twig | 16 +- .../views/Collector/request.html.twig | 20 +- .../Resources/views/Collector/time.html.twig | 11 +- .../views/Collector/translation.html.twig | 39 +--- .../Resources/views/Collector/twig.html.twig | 9 +- .../views/Profiler/base_js.html.twig | 2 +- .../views/Profiler/profiler.css.twig | 8 +- .../Resources/views/Profiler/toolbar.css.twig | 215 ++++++++++-------- .../views/Profiler/toolbar.html.twig | 6 +- .../views/Profiler/toolbar_item.html.twig | 17 +- .../views/Profiler/toolbar_js.html.twig | 2 +- 16 files changed, 275 insertions(+), 274 deletions(-) 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 a495829d3e51..1a1352ab320c 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -2,17 +2,17 @@ {% block toolbar %} {% if collector.tokenClass %} - {% set color_code = (collector.enabled and collector.authenticated) ? 'green' : 'yellow' %} + {% set color_code = (collector.enabled and collector.authenticated) ? '' : 'yellow' %} {% set authentication_color_code = (collector.enabled and collector.authenticated) ? 'green' : 'red' %} {% set authentication_color_text = (collector.enabled and collector.authenticated) ? 'Yes' : 'No' %} {% else %} - {% set color_code = collector.enabled ? 'red' : 'black' %} + {% set color_code = collector.enabled ? 'red' : '' %} {% endif %} {% set text %} {% if collector.tokenClass %}
Logged in as - {{ collector.user }} + {{ collector.user }}
Authenticated @@ -31,10 +31,10 @@ {% endif %} {% endset %} {% set icon %} - - {{ collector.user }} + + {% if collector.user %}{{ collector.user }}{% endif %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': color_code } %} {% endblock %} {% block menu %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig index d557629d18b1..3c7b99b0285c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig @@ -2,10 +2,8 @@ {% block toolbar %} {% set icon %} - - - 0 - + 0 + ajax {% endset %} {% set text %}
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 485cb57c9bff..8ab559351d1d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -1,28 +1,35 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} - {# Symfony Logo #} + + {# Symfony Information #} + {% if 'unknown' == collector.symfonyState %} + {% set block_status = '' %} + {% set symfony_version_status = 'Unable to retrieve information about the Symfony version.' %} + {% elseif 'eol' == collector.symfonyState %} + {% set block_status = 'red' %} + {% set symfony_version_status = 'This Symfony version will no longer receive security fixes.' %} + {% elseif 'eom' == collector.symfonyState %} + {% set block_status = 'yellow' %} + {% set symfony_version_status = 'This Symfony version will only receive security fixes.' %} + {% elseif 'dev' == collector.symfonyState %} + {% set block_status = 'yellow' %} + {% set symfony_version_status = 'This Symfony version is still in the development phase.' %} + + {% else %} + {% set block_status = '' %} + {% set symfony_version_status = '' %} + {% endif %} + {% set icon %} - - - - {% if collector.applicationname %} - {{ collector.applicationname }} {{ collector.applicationversion }} - {% elseif collector.symfonyState is defined %} - {% if 'unknown' == collector.symfonyState -%} - - {%- elseif 'eol' == collector.symfonyState -%} - - {%- elseif 'eom' == collector.symfonyState -%} - - {%- elseif 'dev' == collector.symfonyState -%} - - {%- else -%} - - {%- endif -%} - {{ collector.symfonyversion }} - {% endif %} - + + {% if collector.applicationname %} + {{ collector.applicationname }} + {{ collector.applicationversion }} + {% elseif collector.symfonyState is defined %} + symfony + {{ collector.symfonyversion }} + {% endif %} {% endset %} {% set text %} @@ -32,18 +39,46 @@
{% endif %}
- Symfony {{ collector.symfonyversion }} + + Read Symfony {{ collector.symfonyversion }} Docs +
+ {% if 'n/a' != collector.appname %} +
+ Kernel name + {{ collector.appname }} +
+ {% endif %} + {% if 'n/a' != collector.env %} +
+ Environment + {{ collector.env }} +
+ {% endif %} + {% if 'n/a' != collector.debug %} +
+ Debug + {{ collector.debug ? 'en' : 'dis' }}abled +
+ {% endif %}
- Symfony Documentation + Profiler token + + {% if profiler_url %} + {{ collector.token }} + {% else %} + {{ collector.token }} + {% endif %} +
{% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false, 'block_name': 'config-symfony', 'block_status': block_status } %} {# PHP Information #} {% set icon %} - + php + {{ collector.phpversion }} {% endset %} {% set text %} @@ -63,53 +98,7 @@
{% endspaceless %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} - - {# Environment #} - {% set debug_status_class %}sf-toolbar-status sf-toolbar-status-{{ collector.debug ? 'green' : 'red' }}{% endset %} - {% set icon %} - - {{ token }} - {% if 'n/a' != collector.appname or 'n/a' != collector.env %} - - {{ collector.appname }} - {{ collector.env }} - - {% endif %} - {% endset %} - {% set text %} - {% spaceless %} - {% if 'n/a' != collector.appname %} -
- Name - {{ collector.appname }} -
- {% endif %} - {% if 'n/a' != collector.env %} -
- Environment - {{ collector.env }} -
- {% endif %} - {% if 'n/a' != collector.debug %} -
- Debug - {{ collector.debug ? 'en' : 'dis' }}abled -
- {% endif %} -
- Token - - {% if profiler_url %} - {{ collector.token }} - {% else %} - {{ collector.token }} - {% endif %} - -
- {% endspaceless %} - {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false, 'block_name': 'config-php' } %} {% endblock %} {% block menu %} 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 f4342df72b1c..6c4ad8a09dfc 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -3,13 +3,19 @@ {% from _self import form_tree_entry, form_tree_details %} {% block toolbar %} - {% if collector.data|length %} + {% if collector.data.nb_errors > 0 or collector.data.forms|length %} {% set icon %} - - {% if collector.data.nb_errors %}{{ collector.data.nb_errors }}{% else %}{{ collector.data.forms|length }}{% endif %} + + + {% if collector.data.nb_errors %} + {{ collector.data.nb_errors }} + {% else %} + {{ collector.data.forms|length }} + {% endif %} + {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': collector.data.nb_errors ? 'red' : '' } %} {% endif %} {% endblock %} 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 a6707da12d77..fa78941f4d37 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -5,14 +5,10 @@ {% block toolbar %} {% if collector.counterrors or collector.countdeprecations or collector.countscreams %} {% set icon %} - - {% if collector.counterrors %} - {% set status_color = "red" %} - {% elseif collector.countdeprecations %} - {% set status_color = "yellow" %} - {% endif %} + + {% set status_color = collector.counterrors ? 'red' : collector.countdeprecations ? 'yellow' : '' %} {% set error_count = collector.counterrors + collector.countdeprecations + collector.countscreams %} - {{ error_count }} + {{ error_count }} {% endset %} {% set text %} {% if collector.counterrors %} @@ -34,7 +30,7 @@ {% endif %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': status_color } %} {% endif %} {% endblock %} @@ -87,30 +83,20 @@ {% if collector.logs %} - - - - - - - - + - - - - - +
  • + {{ logger.display_message(loop.index, log, is_deprecation) }} +
  • {% endif %} {% else %} - +
  • No logs available for this priority.
  • {% endfor %} -
    #PriorityChannelMessage and context
    {{ log_loop_index }}{{ is_deprecation ? 'DEPRECATION' : log.priorityName }}{{ log.channel is defined ? log.channel }}{{ logger.display_message(loop.index, log, is_deprecation) }}
    No logs available for {{ priority }} priority.
    + {% else %}

    No logs available. @@ -120,13 +106,11 @@ {% macro display_message(log_index, log, is_deprecation) %} - {{ is_deprecation ? 'DEPRECATED' : log.priorityName }} - {{ log.message }} - {% if is_deprecation %} {% set stack = log.context.stack|default([]) %} {% set id = 'sf-call-stack-' ~ log_index %} - {{ log.message }} + DEPRECATED - {{ log.message }} {% if stack %} @@ -156,6 +140,7 @@ {% endif %} {% endfor %} {% else %} + {{ log.priorityName }} - {{ log.message }} {% if log.context is defined and log.context is not empty %}
    diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index 397b5e830592..0b7649e90ef6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -2,16 +2,22 @@ {% block toolbar %} {% set icon %} + {% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %} - - {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} + MB {% endset %} {% set text %}

    - Memory usage - {{ '%.1f'|format(collector.memory / 1024 / 1024) }} / {{ collector.memoryLimit == -1 ? '∞' : '%.1f'|format(collector.memoryLimit / 1024 / 1024)|escape }} MB + Peak memory usage + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB +
    + +
    + PHP memory limit + {{ collector.memoryLimit == -1 ? '∞' : '%.1f'|format(collector.memoryLimit / 1024 / 1024)|escape }} MB
    {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false, 'block_status': status_color } %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 4d00a07d5fd8..8eaf168be160 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -16,26 +16,30 @@ {{ collector.controller }} {% endif %} {% endset %} - {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red'%} - {% set request_route = collector.route ? collector.route : 'NONE' %} + + {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red' %} + {% set icon %} - - {{ collector.statuscode }} - {{ request_handler }} + {{ collector.statuscode }} + {{ request_handler }} {% endset %} {% set text %} {% spaceless %}
    - Status + HTTP status {{ collector.statuscode }} {{ collector.statustext }}
    - Controller + Controller method {{ request_handler }}
    +
    + Controller file + {{ collector.controller.class }} +
    Route name - {{ request_route }} + {{ collector.route|default('NONE') }}
    Has session diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index db807a721168..7aff16eb7082 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -16,18 +16,19 @@ {% endif %} {% block toolbar %} - {% set duration = collector.events|length ? '%.0f ms'|format(collector.duration) : 'n/a' %} + {% set duration = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %} + {% set status_color = collector.events|length ? collector.duration > 1000 ? 'yellow' : '' %} {% set icon %} - - {{ duration }} + {{ duration }} + ms {% endset %} {% set text %}
    Total time - {{ duration }} + {{ duration }} ms
    {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': status_color } %} {% endblock %} {% block menu %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig index 840e7cd1acc8..815ce29320fa 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig @@ -5,14 +5,11 @@ {% block toolbar %} {% if collector.messages|length %} {% set icon %} - - {% if collector.countMissings %} - {% set status_color = "red" %} - {% elseif collector.countFallbacks %} - {% set status_color = "yellow" %} - {% endif %} + + + {% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' : '' %} {% set error_count = collector.countMissings + collector.countFallbacks %} - {{ error_count ?: collector.countdefines }} + {{ error_count ?: collector.countdefines }} {% endset %} {% set text %} {% if collector.countMissings %} @@ -34,7 +31,7 @@
    {% endif %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': status_color } %} {% endif %} {% endblock %} @@ -57,14 +54,6 @@ {% endblock %} {% block panelContent %} - {% set filter = request.query.get('state', '-1') %} - {% set filterOptions = { - '-1': '', - (constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_DEFINED')): 'Defined messages', - (constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_MISSING')): 'Missing messages', - (constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK')): 'Fallback messages', - } %} -

    Translation Stats

    @@ -80,22 +69,6 @@ - - - -
    Missing messages
    {{ collector.countMissings }}
    Filter -
    - - - -
    -
    @@ -107,7 +80,7 @@ Id Message Preview - {% for message in collector.messages if message.state == filter or filter == '-1' %} + {% for message in collector.messages %} {{ translator.state(message) }} {{ message.locale }} 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 0ecd469bd073..5d102e137019 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -1,10 +1,13 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} - {% set time = collector.templatecount ? '%0.0f ms'|format(collector.time) : 'n/a' %} + {% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %} {% set icon %} - Twig - {{ time }} + + Twig + {{ time }} + ms + {% endset %} {% set text %}
    diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index e313380e5109..7cfcface334a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -180,7 +180,7 @@ requestCounter[0].textContent = requestStack.length; - var className = 'sf-toolbar-ajax-requests sf-toolbar-status'; + var className = 'sf-toolbar-ajax-requests sf-toolvar-value'; if (state == 'ok') { className += ' sf-toolbar-status-green'; } else if (state == 'error') { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig index fd3256534795..3e453b0a212c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig @@ -179,7 +179,7 @@ pre, code { width: 250px; margin-left: -100%; } -table td { +#collector-content table td { background-color: white; } h1 { @@ -273,15 +273,15 @@ ul.alt li { ul.alt li.even { background: #f1f7e2; } -ul.alt li.error, tr.error td { +ul.alt li.error { background-color: #f66; margin-bottom: 1px; } -ul.alt li.warning, tr.warning td { +ul.alt li.warning { background-color: #ffcc00; margin-bottom: 1px; } -ul.alt li.scream, ul.alt li.scream strong, tr.scream td, tr.scream strong { +ul.alt li.scream, ul.alt li.scream strong { color: gray; } ul.sf-call-stack li { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 8d736a716dd3..c31156d750b6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -7,13 +7,7 @@ padding: 5px 5px 0; - background-color: #f7f7f7; - background-image: -moz-linear-gradient(top, #e4e4e4, #ffffff); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e4e4e4), to(#ffffff)); - background-image: -o-linear-gradient(top, #e4e4e4, #ffffff); - background: linear-gradient(top, #e4e4e4, #ffffff); - - border-radius: 16px 0 0 0; + background-color: #222; z-index: 6000000; } @@ -26,39 +20,32 @@ } .sf-toolbarreset { - position: fixed; - background-color: #f7f7f7; + background-color: #222; + box-shadow: 0 -1px 0px rgba(0, 0, 0, 0.2); + bottom: 0; + color: #EEE; + font: 11px Arial, sans-serif; + height: 36px; left: 0; - right: 0; margin: 0; - padding: 0 40px 0 0; - z-index: 6000000; - font: 11px Verdana, Arial, sans-serif; + padding: 0 36px 0 0; + position: fixed; + right: 0; text-align: left; - color: #2f2f2f; - - background-image: -moz-linear-gradient(top, #e4e4e4, #ffffff); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e4e4e4), to(#ffffff)); - background-image: -o-linear-gradient(top, #e4e4e4, #ffffff); - background: linear-gradient(top, #e4e4e4, #ffffff); - - bottom: 0; - border-top: 1px solid #bbb; + z-index: 6000000; } .sf-toolbarreset abbr { - border-bottom: 1px dotted #000000; - cursor: help; -} -.sf-toolbarreset span, -.sf-toolbarreset div, -.sf-toolbarreset td, -.sf-toolbarreset th { - font-size: 11px; + border: none; + cursor: text; } .sf-toolbarreset img { width: auto; display: inline; } +.sf-toolbarreset svg, +.sf-toolbarreset img { + max-height: 24px; +} .sf-toolbarreset table { border-collapse: collapse; border-spacing: 0; @@ -70,42 +57,74 @@ table-layout: auto; } .sf-toolbarreset .hide-button { + background: #444; + cursor: pointer; display: block; position: absolute; top: 0; right: 0; - width: 40px; - height: 40px; + width: 36px; + height: 30px; cursor: pointer; - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAllBMVEXDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PExMTPz8/Q0NDR0dHT09Pb29vc3Nzf39/h4eHi4uLj4+P6+vr7+/v8/Pz9/f3///+Nh2QuAAAAIXRSTlMABgwPGBswMzk8QktRV4SKjZOWmaKlq7TAxszb3urt+fy1vNEpAAAAiklEQVQIHUXBBxKCQBREwRFzDqjoGh+C2YV//8u5Sll2S0E/dof1tKdKM6GyqCto7PjZRJIS/mbSELgXOSd/BzpKIH1ZefVWpDDTHsi8mZVnwImPi5ndCLbaAZk3M58Bay0h9VbeSvMpjDUAHj4jL55AW1rxN5fU2PLjIgVRzNdxVFOlGzvnJi0Fb1XNGBHA9uQOAAAAAElFTkSuQmCC'); - background-repeat: no-repeat; - background-position: 13px 11px; + padding-top: 6px; + text-align: center; +} +.sf-toolbarreset .hide-button svg { + max-height: 24px; + max-width: 24px; } .sf-toolbar-block { - white-space: nowrap; - color: #2f2f2f; + cursor: default; display: block; - min-height: 28px; - border-bottom: 1px solid #e4e4e4; - border-right: 1px solid #e4e4e4; - padding: 0; float: left; - cursor: default; + margin-right: 0px; + white-space: nowrap; +} +.sf-toolbar-block a:hover { + text-decoration: none; +} +.sf-toolbar-block-config-symfony, +.sf-toolbar-block-config-php { + float: right; + margin-left: 0; + margin-right: 0; +} +.sf-toolbar-block-time { + margin-right: 0; +} +.sf-toolbar-block-ajax { + display: none; } .sf-toolbar-block span { display: inline-block; } +.sf-toolbar-block .sf-toolbar-value { + color: #F5F5F5; + font-size: 13px; + line-height: 36px; + padding: 0; +} +.sf-toolbar-block .sf-toolbar-label { + color: #AAA; + font-size: 12px; +} +.sf-toolbar-block-config-php .sf-toolbar-label, +.sf-toolbar-block-config-symfony .sf-toolbar-label { + font-size: 11px; +} +.sf-toolbar-block-twig img { + opacity: .8; +} .sf-toolbar-block .sf-toolbar-info-piece { - line-height: 19px; - margin-bottom: 5px; + line-height: 1.4; + margin-bottom: 8px; } .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { padding: 0px 5px; - border-radius: 5px; margin-bottom: 0px; vertical-align: top; } @@ -114,16 +133,26 @@ margin-bottom: 0; } -.sf-toolbar-block .sf-toolbar-info-piece a, -.sf-toolbar-block .sf-toolbar-info-piece abbr { - color: #2f2f2f; +.sf-toolbar-block .sf-toolbar-info-piece a { + color: #75D1EA; + text-decoration: underline; +} +.sf-toolbar-block .sf-toolbar-info-piece a:hover { + text-decoration: none; } .sf-toolbar-block .sf-toolbar-info-piece b { + color: #AAA; display: inline-block; + font-size: 11px; min-width: 110px; vertical-align: top; } +.sf-toolbar-block .sf-toolbar-info-piece span, +.sf-toolbar-block .sf-toolbar-info-piece abbr { + color: #F5F5F5; + font-size: 12px; +} .sf-toolbar-block .sf-toolbar-info-with-next-pointer:after { content: ' :: '; @@ -133,20 +162,16 @@ .sf-toolbar-block .sf-toolbar-info-with-delimiter { border-right: 1px solid #999; padding-right: 5px; + margin-right: 5px; } .sf-toolbar-block .sf-toolbar-info { + background-color: #444; + bottom: 36px; + color: #F5F5F5; display: none; - position: absolute; - background-color: #fff; - border: 1px solid #bbb; padding: 9px 0; - margin-left: -1px; - - bottom: 38px; - border-bottom-width: 0; - border-bottom: 1px solid #bbb; - border-radius: 4px 4px 0 0; + position: absolute; } .sf-toolbar-block .sf-toolbar-info:empty { @@ -165,43 +190,67 @@ min-height: 13px; } -.sf-toolbar-block .sf-toolbar-status abbr { - color: #fff; - border-bottom: 1px dotted black; -} - .sf-toolbar-block .sf-toolbar-status-green { background-color: #759e1a; } - .sf-toolbar-block .sf-toolbar-status-red { - background-color: #a33; + background-color: rgba(200,0,0, 0.8); } - .sf-toolbar-block .sf-toolbar-status-yellow { background-color: #ffcc00; color: #000; } - .sf-toolbar-block .sf-toolbar-status-black { background-color: #000; } +.sf-toolbar-block.sf-toolbar-status-green { + background-color: #759e1a; + color: #FFF; +} +.sf-toolbar-block.sf-toolbar-status-red { + background-color: rgba(200,0,0, 0.8); + color: #FFF; +} +.sf-toolbar-block.sf-toolbar-status-red svg > g > path { + fill: #FFF; +} +.sf-toolbar-block.sf-toolbar-status-yellow { + background-color: rgba(255,158,43, 0.8); + color: #FFF; +} +.sf-toolbar-block-request .sf-toolbar-status { + border-radius: 0 !important; + color: #FFF; + font-size: 14px; + margin-right: 4px; + padding: 10px; +} + +.sf-toolbar-status-green .sf-toolbar-label, +.sf-toolbar-status-yellow .sf-toolbar-label, +.sf-toolbar-status-red .sf-toolbar-label { + color: #FFF; +} + .sf-toolbar-block .sf-toolbar-icon { display: block; + padding: 0 10px; +} +.sf-toolbar-block-request .sf-toolbar-icon { + padding-left: 0; } +/* .sf-toolbar-block .sf-toolbar-icon > a, .sf-toolbar-block .sf-toolbar-icon > span { - display: block; - font-weight: normal; text-decoration: none; margin: 0; padding: 5px 8px; min-width: 20px; text-align: center; vertical-align: middle; -} +}*/ .sf-toolbar-block .sf-toolbar-icon > a, .sf-toolbar-block .sf-toolbar-icon > a:link @@ -216,11 +265,12 @@ .sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { border-width: 0; vertical-align: middle; + position: relative; + top: -1px; } .sf-toolbar-block .sf-toolbar-icon img + span, .sf-toolbar-block .sf-toolbar-icon svg + span { - margin-left: 5px; - margin-top: 2px; + margin-left: 4px; } .sf-toolbar-block .sf-toolbar-icon .sf-toolbar-status { @@ -230,8 +280,6 @@ } .sf-toolbar-block .sf-toolbar-info-method { - border-bottom: 1px dashed #ccc; - cursor: help; } .sf-toolbar-block .sf-toolbar-info-method[onclick=""] { @@ -260,22 +308,13 @@ display: none; } -.sf-toolbarreset:hover { - box-shadow: rgba(0, 0, 0, 0.3) 0 0 50px; -} - .sf-toolbar-block:hover { - box-shadow: rgba(0, 0, 0, 0.35) 0 0 5px; - border-right: none; - margin-right: 1px; position: relative; } .sf-toolbar-block:hover .sf-toolbar-icon { - background-color: #fff; - border-top: 1px dotted #DDD; + background-color: #444; position: relative; - margin-top: -1px; z-index: 10002; } @@ -286,7 +325,7 @@ z-index: 10001; box-sizing: border-box; padding: 9px; - line-height: 19px; + line-height: 1.5; max-width: 480px; max-height: 480px; @@ -433,11 +472,3 @@ display: none; } } - -/***** Media query print: Do not print the Toolbar. *****/ -@media print { - .sf-toolbar { - display: none; - visibility: hidden; - } -} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index dbe3d0cdbf7b..dc769c9cad8c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -15,7 +15,7 @@ Sfjs.setPreference('toolbar/displayState', 'block'); "> - +
    {% endif %} @@ -43,7 +43,7 @@ document.getElementById('sfMiniToolbar-{{ token }}').style.display = 'block'; Sfjs.setPreference('toolbar/displayState', 'none'); "> - + {{ include('@WebProfiler/Icon/close.svg.twig') }} {% endif %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index ab4e07f93ec7..18292e8f1a20 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,5 +1,5 @@ -
    {{ text|default('') }}
    {% if link %}
    {% endif %} From 27353463084f65e2ddec9504d39fdb8ff9d05204 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 10:38:08 +0200 Subject: [PATCH 05/44] Fixed a minor markup error that broke the toolbar --- .../Resources/views/Profiler/toolbar.css.twig | 3 +++ .../Resources/views/Profiler/toolbar_item.html.twig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 883165795e20..cfce041ac3cc 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -89,6 +89,9 @@ margin-left: 0; margin-right: 0; } +.sf-toolbar-block-config svg { + padding-right: 4px; +} .sf-toolbar-block-time { margin-right: 0; } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index 18292e8f1a20..6a8fa473e4b9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,5 +1,5 @@
    - {% if link %}{% endif %}
    {{ icon|default('') }}
    {{ text|default('') }}
    {% if link %}
    {% endif %} From 51a79c92e6cc3d632e6132f99ef95b9c63829942 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 11:40:01 +0200 Subject: [PATCH 06/44] Reorder toolbar panels --- .../Profiler/TemplateManager.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 5d0fd277c51d..aa281b8da1a5 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -72,6 +72,8 @@ public function getName(Profile $profile, $panel) public function getTemplates(Profile $profile) { $templates = $this->getNames($profile); + $templates = $this->reorderTemplates($templates); + foreach ($templates as $name => $template) { $templates[$name] = $this->twig->loadTemplate($template); } @@ -134,4 +136,47 @@ protected function templateExists($template) return false; } + + /** + * It changes the default order of collector templates to show them in a + * different order which is better for design and aesthetic reasons. + * + * @param array $templates + * @return array + */ + protected function reorderTemplates($templates) + { + $templates = $this->moveArrayElementToFirstPosition($templates, 'memory'); + $templates = $this->moveArrayElementToFirstPosition($templates, 'time'); + $templates = $this->moveArrayElementToFirstPosition($templates, 'request'); + + $templates = $this->moveArrayElementToLastPosition($templates, 'config'); + + return $templates; + } + + private function moveArrayElementToFirstPosition($array, $key) + { + if (!array_key_exists($key, $array)) { + return $array; + } + + $value = $array[$key]; + unset($array[$key]); + + return array_merge(array($key => $value), $array); + } + + private function moveArrayElementToLastPosition($array, $key) + { + if (!array_key_exists($key, $array)) { + return $array; + } + + $value = $array[$key]; + unset($array[$key]); + $array[$key] = $value; + + return $array; + } } From ef53850cb3e9139c2c88fa841a3e085111403bce Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 12:13:55 +0200 Subject: [PATCH 07/44] More fixes and tweaks --- .../Profiler/TemplateManager.php | 1 + .../views/Collector/config.html.twig | 17 +++++------ .../views/Collector/request.html.twig | 9 ++++-- .../Resources/views/Profiler/toolbar.css.twig | 28 ++++++++++--------- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index aa281b8da1a5..2a12198542bf 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -146,6 +146,7 @@ protected function templateExists($template) */ protected function reorderTemplates($templates) { + $templates = $this->moveArrayElementToFirstPosition($templates, 'twig'); $templates = $this->moveArrayElementToFirstPosition($templates, 'memory'); $templates = $this->moveArrayElementToFirstPosition($templates, 'time'); $templates = $this->moveArrayElementToFirstPosition($templates, 'request'); 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 a0705f6e4c7b..adfc00c8af5c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -33,14 +33,6 @@ {% endset %} {% set text %} - {% if collector.symfonyversion is defined %} - - {% endif %} - {% if collector.applicationname %}
    {{ collector.applicationname }} {{ collector.applicationversion }} @@ -94,6 +86,15 @@ PHP SAPI {{ collector.sapiName }}
    + + {% if collector.symfonyversion is defined %} + + {% endif %} {% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false, status: block_status }) }} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 43ef4403748a..68a1d025f9d6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -21,17 +21,19 @@ {% set icon %} {{ collector.statuscode }} - {{ request_handler }} + @ + {{ collector.route }} {% endset %} + {% set text %} {% spaceless %}
    HTTP status - {{ collector.statuscode }} {{ collector.statustext }} + {{ collector.statuscode }} {{ collector.statustext }}
    Controller method - {{ request_handler }} + {{ request_handler }}
    Controller file @@ -47,6 +49,7 @@
    {% endspaceless %} {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index cfce041ac3cc..32511b929037 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -120,15 +120,19 @@ opacity: .8; } +.sf-toolbar-block .sf-toolbar-info { + display: table; +} .sf-toolbar-block .sf-toolbar-info-piece { + display: table-row; line-height: 1.4; margin-bottom: 8px; } .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { - padding: 0px 5px; + border-radius: 0; + padding: 2px 5px; margin-bottom: 0px; - vertical-align: top; } .sf-toolbar-block .sf-toolbar-info-piece:last-child { @@ -145,10 +149,12 @@ .sf-toolbar-block .sf-toolbar-info-piece b { color: #AAA; - display: inline-block; + display: table-cell; font-size: 11px; - min-width: 110px; - vertical-align: top; + padding: 4px 8px 4px 4px; +} +.sf-toolbar-block .sf-toolbar-info-piece span { + } .sf-toolbar-block .sf-toolbar-info-piece span, .sf-toolbar-block .sf-toolbar-info-piece abbr { @@ -196,7 +202,7 @@ background-color: #759e1a; } .sf-toolbar-block .sf-toolbar-status-red { - background-color: rgba(200,0,0, 0.8); + background-color: rgba(200, 0, 0, 0.8); } .sf-toolbar-block .sf-toolbar-status-yellow { background-color: #ffcc00; @@ -211,7 +217,7 @@ color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red { - background-color: rgba(200,0,0, 0.8); + background-color: rgba(200, 0, 0, 0.8); color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red svg > g > path { @@ -292,12 +298,8 @@ .sf-toolbar-info-php {} .sf-toolbar-info-php-ext {} -.sf-toolbar-info-php-ext .sf-toolbar-status { - margin-left: 2px; -} - -.sf-toolbar-info-php-ext .sf-toolbar-status:first-child { - margin-left: 0; +.sf-toolbar-info-php-ext .sf-toolbar-status + .sf-toolbar-status { + margin-left: 4px; } .sf-toolbar-block a .sf-toolbar-info-piece-additional, From fac5391dab21061344aeee13c20be90307ce8a51 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 15:54:44 +0200 Subject: [PATCH 08/44] Lots of minor improvements --- .../Resources/views/Profiler/toolbar.css.twig | 38 +++---------------- .../views/Profiler/toolbar_item.html.twig | 2 +- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 32511b929037..255a9b02d01d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -232,6 +232,7 @@ color: #FFF; font-size: 14px; margin-right: 4px; + max-height: 36px; padding: 10px; } @@ -389,55 +390,26 @@ /***** Override the setting when the toolbar is on the top *****/ {% if position == 'top' %} .sf-minitoolbar { - top: 0; bottom: auto; right: 0; - - background-color: #f7f7f7; - - background-image: -moz-linear-gradient(225deg, #e4e4e4, #ffffff); - background-image: -webkit-gradient(linear, 100% 0%, 0% 0%, from(#e4e4e4), to(#ffffff)); - background-image: -o-linear-gradient(135deg, #e4e4e4, #ffffff); - background: linear-gradient(225deg, #e4e4e4, #ffffff); - - border-radius: 0 0 0 16px; + top: 0; } .sf-toolbarreset { - background-image: -moz-linear-gradient(225deg, #e4e4e4, #ffffff); - background-image: -webkit-gradient(linear, 100% 0%, 0% 0%, from(#e4e4e4), to(#ffffff)); - background-image: -o-linear-gradient(135deg, #e4e4e4, #ffffff); - background: linear-gradient(225deg, #e4e4e4, #ffffff); - - top: 0; bottom: auto; - border-bottom: 1px solid #bbb; + box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2); + top: 0; } .sf-toolbar-block .sf-toolbar-info { - top: 39px; bottom: auto; - border-top-width: 0; - border-radius: 0 0 4px 4px; - } - - .sf-toolbar-block:hover .sf-toolbar-icon { - border-top: none; - border-bottom: 1px dotted #DDD; - margin-top: 0; - margin-bottom: -1px; + top: 36px; } {% endif %} {% if not floatable %} .sf-toolbarreset { position: static; - background: #cbcbcb; - - background-image: -moz-linear-gradient(90deg, #cbcbcb, #e8e8e8) !important; - background-image: -webkit-gradient(linear, 0% 0%, 100% 0%, from(#cbcbcb), to(#e8e8e8)) !important; - background-image: -o-linear-gradient(180deg, #cbcbcb, #e8e8e8) !important; - background: linear-gradient(90deg, #cbcbcb, #e8e8e8) !important; } {% endif %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index 6a8fa473e4b9..2f30e05c9a6b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,6 +1,6 @@
    {% if link %}{% endif %}
    {{ icon|default('') }}
    -
    {{ text|default('') }}
    {% if link %}
    {% endif %} +
    {{ text|default('') }}
    From acee052b686403ee84904c8ade376e9304304f22 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 17:40:13 +0200 Subject: [PATCH 09/44] Finished the Ajax panel redesign --- .../Resources/views/Collector/ajax.html.twig | 9 ++-- .../views/Collector/request.html.twig | 13 +++-- .../Resources/views/Collector/twig.html.twig | 2 +- .../views/Profiler/base_js.html.twig | 13 ++--- .../Resources/views/Profiler/toolbar.css.twig | 50 +++++++++++-------- 5 files changed, 51 insertions(+), 36 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig index 3c7b99b0285c..fd9ee91c567f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig @@ -2,13 +2,13 @@ {% block toolbar %} {% set icon %} + {{ include('@WebProfiler/Icon/ajax.svg.twig') }} 0 - ajax {% endset %} + {% set text %}
    - AJAX requests - +
    @@ -24,5 +24,6 @@
    {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} + + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 68a1d025f9d6..1d0d805c4394 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -4,14 +4,19 @@ {% set request_handler %} {% if collector.controller.class is defined %} {% set link = collector.controller.file|file_link(collector.controller.line) %} + {% if link %}{% endif %} + + + {{ collector.controller.class|abbr_class }} + + {% if collector.controller.method %} - {{ collector.controller.class|abbr_class }} - + {{ collector.controller.method }} - {% else %} - {{ collector.controller.class|abbr_class }} {% endif %} + + {% if link %}{% endif %} {% else %} {{ collector.controller }} {% endif %} 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 629d06cf1136..959295a87e92 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -4,7 +4,7 @@ {% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %} {% set icon %} - Twig + {{ include('@WebProfiler/Icon/twig.html.twig') }} {{ time }} ms diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index 29b1d5b363e1..cdf6818897d9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -165,7 +165,7 @@ tbody.appendChild(rows); if (infoSpan) { - var text = requestStack.length + ' call' + (requestStack.length > 1 ? 's' : ''); + var text = requestStack.length + ' AJAX request' + (requestStack.length > 1 ? 's' : ''); infoSpan.textContent = text; } } else { @@ -181,15 +181,16 @@ requestCounter[0].textContent = requestStack.length; var className = 'sf-toolbar-ajax-requests sf-toolbar-value'; + requestCounter[0].className = className; + + var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); if (state == 'ok') { - className += ' sf-toolbar-status-green'; + ajaxToolbarPanel.className = 'sf-toolbar-status-green'; } else if (state == 'error') { - className += ' sf-toolbar-status-red'; + ajaxToolbarPanel.className = 'sf-toolbar-status-red'; } else { - className += ' sf-ajax-request-loading'; + ajaxToolbarPanel.className = 'sf-ajax-request-loading'; } - - requestCounter[0].className = className; }; var addEventListener; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 255a9b02d01d..77447e2f9c2f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -92,12 +92,6 @@ .sf-toolbar-block-config svg { padding-right: 4px; } -.sf-toolbar-block-time { - margin-right: 0; -} -.sf-toolbar-block-ajax { - display: none; -} .sf-toolbar-block span { display: inline-block; @@ -140,7 +134,7 @@ } .sf-toolbar-block .sf-toolbar-info-piece a { - color: #75D1EA; + color: #99CDD8; text-decoration: underline; } .sf-toolbar-block .sf-toolbar-info-piece a:hover { @@ -288,17 +282,13 @@ margin-top: 0; } -.sf-toolbar-block .sf-toolbar-info-method { +.sf-toolbar-block-time .sf-toolbar-icon { + padding-right: 5px; } - -.sf-toolbar-block .sf-toolbar-info-method[onclick=""] { - border-bottom: none; - cursor: inherit; +.sf-toolbar-block-memory .sf-toolbar-icon { + padding-left: 5px; } -.sf-toolbar-info-php {} -.sf-toolbar-info-php-ext {} - .sf-toolbar-info-php-ext .sf-toolbar-status + .sf-toolbar-status { margin-left: 4px; } @@ -339,14 +329,26 @@ overflow-y: auto; } -.sf-toolbar-ajax-requests th, .sf-toolbar-ajax-requests td { - border-bottom: 1px solid #ddd; - padding: 0 4px; - color: #2f2f2f; - background-color: #fff; +.sf-toolbar-info-piece b.sf-toolbar-ajax-info { + color: #F5F5F5; +} +.sf-toolbar-ajax-requests { + width: 100%; +} + +.sf-toolbar-ajax-requests td { + background-color: #444; + border-bottom: 1px solid #777; + color: #F5F5F5; + font-size: 12px; + padding: 4px; } .sf-toolbar-ajax-requests th { - background-color: #eee; + background-color: #222; + border-bottom: 0; + color: #AAA; + font-size: 11px; + padding: 4px; } .sf-ajax-request-url { max-width: 300px; @@ -354,6 +356,12 @@ overflow: hidden; text-overflow: ellipsis; } +.sf-toolbar-ajax-requests .sf-ajax-request-url a { + text-decoration: none; +} +.sf-toolbar-ajax-requests .sf-ajax-request-url a:hover { + text-decoration: underline; +} .sf-ajax-request-duration { text-align: right; } From af3dcb2a976f715e697eb7479e76ddebdca65210 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 18:01:44 +0200 Subject: [PATCH 10/44] Minor Ajax tweaks --- .../Resources/views/Profiler/base_js.html.twig | 8 ++------ .../Resources/views/Profiler/toolbar.css.twig | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index cdf6818897d9..03a242b62702 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -169,12 +169,8 @@ infoSpan.textContent = text; } } else { - var cell = document.createElement('td'); - cell.setAttribute('colspan', '4'); - cell.textContent = "No AJAX requests yet."; - var row = document.createElement('tr'); - row.appendChild(cell); - tbody.appendChild(row); + var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); + ajaxToolbarPanel[0].style.display = 'none'; } } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 77447e2f9c2f..6896555af7a3 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -343,6 +343,9 @@ font-size: 12px; padding: 4px; } +.sf-toolbar-ajax-requests tr:last-child td { + border-bottom: 0; +} .sf-toolbar-ajax-requests th { background-color: #222; border-bottom: 0; From 041d4243a1102d9e8dc9fab914f4da04c839302e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 09:23:43 +0200 Subject: [PATCH 11/44] Improved the Security toolbar panel --- .../views/Collector/security.html.twig | 22 ++++++----- .../Resources/views/Profiler/toolbar.css.twig | 39 ++++--------------- 2 files changed, 20 insertions(+), 41 deletions(-) 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 1a1352ab320c..2ca6a02ee593 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -2,12 +2,17 @@ {% block toolbar %} {% if collector.tokenClass %} - {% set color_code = (collector.enabled and collector.authenticated) ? '' : 'yellow' %} - {% set authentication_color_code = (collector.enabled and collector.authenticated) ? 'green' : 'red' %} - {% set authentication_color_text = (collector.enabled and collector.authenticated) ? 'Yes' : 'No' %} + {% set is_authenticated = collector.enabled and collector.authenticated %} + {% set color_code = is_authenticated ? '' : 'yellow' %} {% else %} - {% set color_code = collector.enabled ? 'red' : '' %} + {% set color_code = collector.enabled ? 'red' : '' %} {% endif %} + + {% set icon %} + + {{ collector.user|default('n/a') }} + {% endset %} + {% set text %} {% if collector.tokenClass %}
    @@ -16,7 +21,7 @@
    Authenticated - {{ authentication_color_text }} + {{ is_authenticated ? 'Yes' : 'No' }}
    {% if collector.tokenClass != null %}
    @@ -30,11 +35,8 @@ The security is disabled. {% endif %} {% endset %} - {% set icon %} - - {% if collector.user %}{{ collector.user }}{% endif %} - {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': color_code } %} + + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: color_code }) }} {% endblock %} {% block menu %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 6896555af7a3..4b8619f6b4b4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -202,9 +202,6 @@ background-color: #ffcc00; color: #000; } -.sf-toolbar-block .sf-toolbar-status-black { - background-color: #000; -} .sf-toolbar-block.sf-toolbar-status-green { background-color: #759e1a; @@ -221,6 +218,7 @@ background-color: rgba(255,158,43, 0.8); color: #FFF; } + .sf-toolbar-block-request .sf-toolbar-status { border-radius: 0 !important; color: #FFF; @@ -235,6 +233,11 @@ .sf-toolbar-status-red .sf-toolbar-label { color: #FFF; } +.sf-toolbar-status-green svg *, +.sf-toolbar-status-red svg *, +.sf-toolbar-status-yellow svg * { + fill: #FFF; +} .sf-toolbar-block .sf-toolbar-icon { display: block; @@ -244,27 +247,6 @@ padding-left: 0; } -/* -.sf-toolbar-block .sf-toolbar-icon > a, -.sf-toolbar-block .sf-toolbar-icon > span { - text-decoration: none; - margin: 0; - padding: 5px 8px; - min-width: 20px; - text-align: center; - vertical-align: middle; -}*/ - -.sf-toolbar-block .sf-toolbar-icon > a, -.sf-toolbar-block .sf-toolbar-icon > a:link -.sf-toolbar-block .sf-toolbar-icon > a:hover { - color: black !important; -} - -.sf-toolbar-block .sf-toolbar-icon > a[href]:after { - content: ""; -} - .sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { border-width: 0; vertical-align: middle; @@ -272,16 +254,11 @@ top: -1px; } -.sf-toolbar-block .sf-toolbar-icon img + span, .sf-toolbar-block .sf-toolbar-icon svg + span { +.sf-toolbar-block .sf-toolbar-icon img + span, +.sf-toolbar-block .sf-toolbar-icon svg + span { margin-left: 4px; } -.sf-toolbar-block .sf-toolbar-icon .sf-toolbar-status { - border-radius: 12px; - border-bottom-left-radius: 0; - margin-top: 0; -} - .sf-toolbar-block-time .sf-toolbar-icon { padding-right: 5px; } From 77d522a8cb56219bcd6309af7958b95d0c821f98 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 10:28:18 +0200 Subject: [PATCH 12/44] Tweaked the translation panel --- .../views/Collector/config.html.twig | 8 ++-- .../views/Collector/translation.html.twig | 41 ++++++++++--------- .../Resources/views/Icon/ajax.svg.twig | 1 + .../Resources/views/Icon/close.svg.twig | 1 + .../Resources/views/Icon/symfony.svg.twig | 1 + .../Resources/views/Icon/translation.svg.twig | 1 + .../Resources/views/Icon/twig.html.twig | 1 + .../Resources/views/Profiler/toolbar.css.twig | 11 +++-- 8 files changed, 36 insertions(+), 29 deletions(-) create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig 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 adfc00c8af5c..08babc2ea0f1 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -90,9 +90,11 @@ {% if collector.symfonyversion is defined %} {% endif %} {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig index ed33872746f1..7eefbde73c86 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig @@ -5,32 +5,33 @@ {% block toolbar %} {% if collector.messages|length %} {% set icon %} - - + {{ include('@WebProfiler/Icon/translation.svg.twig') }} {% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' : '' %} {% set error_count = collector.countMissings + collector.countFallbacks %} {{ error_count ?: collector.countdefines }} {% endset %} + {% set text %} - {% if collector.countMissings %} -
    - Missing messages - {{ collector.countMissings }} -
    - {% endif %} - {% if collector.countFallbacks %} -
    - Fallback messages - {{ collector.countFallbacks }} -
    - {% endif %} - {% if collector.countdefines %} -
    - Defined messages - {{ collector.countdefines }} -
    - {% endif %} +
    + Missing messages + + {{ collector.countMissings|default(0) }} + +
    + +
    + Fallback messages + + {{ collector.countFallbacks|default(0) }} + +
    + +
    + Defined messages + {{ collector.countdefines|default(0) }} +
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig new file mode 100644 index 000000000000..ba77a3aa7f40 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig new file mode 100644 index 000000000000..70b4d589bc60 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig new file mode 100644 index 000000000000..da9802c3884e --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig new file mode 100644 index 000000000000..ed8601a2a945 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig new file mode 100644 index 000000000000..a8e72424cf20 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig @@ -0,0 +1 @@ +Twig diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 4b8619f6b4b4..20f50e1cfb05 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -193,18 +193,17 @@ } .sf-toolbar-block .sf-toolbar-status-green { - background-color: #759e1a; + background-color: rgba(117, 158, 43, 0.8); } .sf-toolbar-block .sf-toolbar-status-red { - background-color: rgba(200, 0, 0, 0.8); + background-color: rgba(200, 43, 43, 0.8); } .sf-toolbar-block .sf-toolbar-status-yellow { - background-color: #ffcc00; - color: #000; + background-color: rgba(255, 158, 43, 0.8); } .sf-toolbar-block.sf-toolbar-status-green { - background-color: #759e1a; + background-color: rgba(117, 158, 43, 0.8); color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red { @@ -215,7 +214,7 @@ fill: #FFF; } .sf-toolbar-block.sf-toolbar-status-yellow { - background-color: rgba(255,158,43, 0.8); + background-color: rgba(255, 158, 43, 0.8); color: #FFF; } From c0bee9b7e7cdc03b140ba5bf4862caf97e1b1064 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 10:45:55 +0200 Subject: [PATCH 13/44] Tweaked the Twig panel --- .../Resources/views/Collector/twig.html.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 959295a87e92..20a07327cab4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -12,19 +12,19 @@ {% set text %}
    Render Time - {{ time }} + {{ time }} ms
    Template Calls - {{ collector.templatecount }} + {{ collector.templatecount }}
    Block Calls - {{ collector.blockcount }} + {{ collector.blockcount }}
    Macro Calls - {{ collector.macrocount }} + {{ collector.macrocount }}
    {% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }} From 2bccdd4a62f262092c4653ff2e70517623c2eb14 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 10:58:45 +0200 Subject: [PATCH 14/44] Minor CSS fixes --- .../Resources/views/Profiler/toolbar.css.twig | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 20f50e1cfb05..c6b9fa3e4d82 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -124,7 +124,6 @@ } .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { - border-radius: 0; padding: 2px 5px; margin-bottom: 0px; } @@ -182,10 +181,9 @@ .sf-toolbar-block .sf-toolbar-status { display: inline-block; - color: #fff; + color: #FFF; background-color: #666; padding: 3px 6px; - border-radius: 3px; margin-bottom: 2px; vertical-align: middle; min-width: 6px; @@ -207,7 +205,7 @@ color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red { - background-color: rgba(200, 0, 0, 0.8); + background-color: rgba(200, 43, 43, 0.8); color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red svg > g > path { @@ -219,7 +217,6 @@ } .sf-toolbar-block-request .sf-toolbar-status { - border-radius: 0 !important; color: #FFF; font-size: 14px; margin-right: 4px; @@ -232,9 +229,9 @@ .sf-toolbar-status-red .sf-toolbar-label { color: #FFF; } -.sf-toolbar-status-green svg *, -.sf-toolbar-status-red svg *, -.sf-toolbar-status-yellow svg * { +.sf-toolbar-status-green svg > g > path, +.sf-toolbar-status-red svg > g > path, +.sf-toolbar-status-yellow svg > g > path { fill: #FFF; } From b25b6dd608e0646b8e265c34a4af789d30f5859b Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 14:56:10 +0200 Subject: [PATCH 15/44] Finished "dump" panel and other minor tweaks --- .../Resources/views/Profiler/dump.html.twig | 14 ++++---- .../Resources/views/Collector/form.html.twig | 16 +++++++-- .../views/Collector/logger.html.twig | 36 +++++++++---------- .../views/Collector/memory.html.twig | 4 ++- .../Resources/views/Collector/time.html.twig | 14 ++++++-- .../Resources/views/Collector/twig.html.twig | 2 ++ .../Resources/views/Profiler/toolbar.css.twig | 19 ++++++++++ 7 files changed, 72 insertions(+), 33 deletions(-) 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 e7a8245fb3b0..2ce089908085 100644 --- a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig +++ b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig @@ -5,17 +5,14 @@ {% if dumps_count %} {% set icon %} - - {{ dumps_count }} + + {{ dumps_count }} {% endset %} {% set text %} -
    - dump() -
    {% for dump in collector.getDumps('html') %}
    - in + {% if dump.file %} {% set link = dump.file|file_link(dump.line) %} {% if link %} @@ -26,14 +23,15 @@ {% else %} {{ dump.name }} {% endif %} - line {{ dump.line }}: + + line {{ dump.line }} {{ dump.data|raw }}
    {% endfor %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': true } %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }} {% 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 979ef56d3159..27515f752295 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -4,8 +4,9 @@ {% block toolbar %} {% if collector.data.nb_errors > 0 or collector.data.forms|length %} + {% set status_color = collector.data.nb_errors ? 'red' : '' %} {% set icon %} - + {{ include('@WebProfiler/Icon/form.svg.twig') }} {% if collector.data.nb_errors %} {{ collector.data.nb_errors }} @@ -15,7 +16,18 @@ {% endset %} - {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: collector.data.nb_errors ? 'red' : '' }) }} + {% set text %} +
    + Number of forms + {{ collector.data.forms|length }} +
    +
    + Number of errors + {{ collector.data.nb_errors }} +
    + {% endset %} + + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} 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 10858a531b6f..6344197eff6b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -5,31 +5,29 @@ {% block toolbar %} {% if collector.counterrors or collector.countdeprecations or collector.countscreams %} {% set icon %} - {% set status_color = collector.counterrors ? 'red' : collector.countdeprecations ? 'yellow' : '' %} {% set error_count = collector.counterrors + collector.countdeprecations + collector.countscreams %} + {{ include('@WebProfiler/Icon/logger.svg.twig') }} {{ error_count }} {% endset %} + {% set text %} - {% if collector.counterrors %} -
    - Errors - {{ collector.counterrors }} -
    - {% endif %} - {% if collector.countdeprecations %} -
    - Deprecated Calls - {{ collector.countdeprecations }} -
    - {% endif %} - {% if collector.countscreams %} -
    - Silenced Errors - {{ collector.countscreams }} -
    - {% endif %} +
    + Errors + {{ collector.counterrors|default(0) }} +
    + +
    + Deprecated Calls + {{ collector.countdeprecations|default(0) }} +
    + +
    + Silenced Errors + {{ collector.countscreams|default(0) }} +
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index af68792e1b17..b10159684303 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -8,6 +8,7 @@ MB {% endset %} + {% set text %}
    Peak memory usage @@ -16,8 +17,9 @@
    PHP memory limit - {{ collector.memoryLimit == -1 ? '∞' : '%.1f'|format(collector.memoryLimit / 1024 / 1024)|escape }} MB + {{ collector.memoryLimit == -1 ? '∞' : '%.0f'|format(collector.memoryLimit / 1024 / 1024)|escape }} MB
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false, status: status_color }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 4b743f99024d..558a155bdb6b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -16,18 +16,26 @@ {% endif %} {% block toolbar %} - {% set duration = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %} + {% set total_time = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %} + {% set initialization_time = collector.events|length ? '%.0f'|format(collector.inittime) : 'n/a' %} {% set status_color = collector.events|length ? collector.duration > 1000 ? 'yellow' : '' %} + {% set icon %} - {{ duration }} + {{ total_time }} ms {% endset %} + {% set text %}
    Total time - {{ duration }} ms + {{ total_time }} ms +
    +
    + Initialization time + {{ initialization_time }} ms
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endblock %} 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 20a07327cab4..293180757fd6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -9,6 +9,7 @@ ms {% endset %} + {% set text %}
    Render Time @@ -27,6 +28,7 @@ {{ collector.macrocount }}
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index c6b9fa3e4d82..de56ad35db98 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -81,6 +81,7 @@ margin-right: 0px; white-space: nowrap; } +.sf-toolbar-block a, .sf-toolbar-block a:hover { text-decoration: none; } @@ -371,6 +372,24 @@ 100% { color: black; } } +.sf-toolbar-block-dump pre.sf-dump { + background-color: #222; + border-color: #777; + border-radius: 0; + margin: 6px 0 12px 0; + width: 200px; +} +.sf-toolbar-block-dump pre.sf-dump:last-child { + margin-bottom: 0; +} +.sf-toolbar-block-dump .sf-toolbar-info-piece .sf-toolbar-file-line { + color: #AAA; + margin-left: 4px; +} +.sf-toolbar-block-dump .sf-toolbar-info img { + display: none; +} + /***** Override the setting when the toolbar is on the top *****/ {% if position == 'top' %} .sf-minitoolbar { From 9d89841e3aaa708a0215db7ad866cfb52b6f2261 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 18:09:41 +0200 Subject: [PATCH 16/44] Finished the toolbar redesign --- .../views/Collector/config.html.twig | 20 +- .../views/Collector/memory.html.twig | 7 +- .../views/Collector/request.html.twig | 26 +- .../Resources/views/Collector/time.html.twig | 1 + .../Resources/views/Icon/form.svg.twig | 1 + .../Resources/views/Icon/logger.svg.twig | 1 + .../Resources/views/Icon/memory.svg.twig | 1 + .../Resources/views/Icon/symfony.svg.twig | 2 +- .../Resources/views/Icon/time.svg.twig | 1 + .../views/Profiler/base_js.html.twig | 8 +- .../Resources/views/Profiler/toolbar.css.twig | 227 +++++++++--------- 11 files changed, 152 insertions(+), 143 deletions(-) create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig 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 08babc2ea0f1..4b66f4589a66 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -19,17 +19,15 @@ {% endif %} {% set icon %} - {% if collector.symfonyState is defined %} - - - {{ include('@WebProfiler/Icon/symfony.svg.twig') }} - - {{ collector.symfonyversion }} - - {% elseif collector.applicationname %} - {{ collector.applicationname }} - {{ collector.applicationversion }} - {% endif %} + {% if collector.symfonyState is defined %} + + {{ include('@WebProfiler/Icon/symfony.svg.twig') }} + + {{ collector.symfonyversion }} + {% elseif collector.applicationname %} + {{ collector.applicationname }} + {{ collector.applicationversion }} + {% endif %} {% endset %} {% set text %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index b10159684303..5dd22697475e 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -3,10 +3,9 @@ {% block toolbar %} {% set icon %} {% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %} - - {{ '%.1f'|format(collector.memory / 1024 / 1024) }} - MB - + {{ include('@WebProfiler/Icon/memory.svg.twig') }} + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} + MB {% endset %} {% set text %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 1d0d805c4394..25cecdc20102 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -1,24 +1,22 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} + + {% set request_handler %} {% if collector.controller.class is defined %} {% set link = collector.controller.file|file_link(collector.controller.line) %} - {% if link %}{% endif %} + {% if link %}{% else %}{% endif %} - - {{ collector.controller.class|abbr_class }} - + {{ collector.controller.class|abbr_class|striptags }} - {% if collector.controller.method %} - - {{ collector.controller.method }} - - {% endif %} + {%- if collector.controller.method -%} +  :: {{ collector.controller.method }} + {%- endif -%} - {% if link %}{% endif %} + {% if link %}{% else %}{% endif %} {% else %} - {{ collector.controller }} + {{ collector.controller }} {% endif %} {% endset %} @@ -26,8 +24,10 @@ {% set icon %} {{ collector.statuscode }} - @ - {{ collector.route }} + {% if collector.route %} + @ + {{ collector.route }} + {% endif %} {% endset %} {% set text %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 558a155bdb6b..8b5330df6b06 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -21,6 +21,7 @@ {% set status_color = collector.events|length ? collector.duration > 1000 ? 'yellow' : '' %} {% set icon %} + {{ include('@WebProfiler/Icon/time.svg.twig') }} {{ total_time }} ms {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig new file mode 100644 index 000000000000..07bd66550718 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig new file mode 100644 index 000000000000..b29b2071d40f --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig new file mode 100644 index 000000000000..90b195a52173 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig index da9802c3884e..d4136c0958e0 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig @@ -1 +1 @@ - + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig new file mode 100644 index 000000000000..65f36710844f --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index 03a242b62702..d0f51c42d2f4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -180,12 +180,10 @@ requestCounter[0].className = className; var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); - if (state == 'ok') { - ajaxToolbarPanel.className = 'sf-toolbar-status-green'; - } else if (state == 'error') { - ajaxToolbarPanel.className = 'sf-toolbar-status-red'; + if (state == 'error') { + Sfjs.addClass(ajaxToolbarPanel[0], 'sf-toolbar-status-red'); } else { - ajaxToolbarPanel.className = 'sf-ajax-request-loading'; + Sfjs.addClass(ajaxToolbarPanel[0], 'sf-ajax-request-loading'); } }; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index de56ad35db98..975ed9639f53 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -1,15 +1,12 @@ .sf-minitoolbar { + background-color: #222; + bottom: 0; display: none; - + height: 36px; + padding: 5px 6px 0; position: fixed; - bottom: 0; right: 0; - - padding: 5px 5px 0; - - background-color: #222; - - z-index: 6000000; + z-index: 9999; } .sf-toolbarreset * { @@ -21,8 +18,8 @@ .sf-toolbarreset { background-color: #222; - box-shadow: 0 -1px 0px rgba(0, 0, 0, 0.2); bottom: 0; + box-shadow: 0 -1px 0px rgba(0, 0, 0, 0.2); color: #EEE; font: 11px Arial, sans-serif; height: 36px; @@ -32,30 +29,16 @@ position: fixed; right: 0; text-align: left; - z-index: 6000000; + z-index: 9999; } .sf-toolbarreset abbr { border: none; cursor: text; } -.sf-toolbarreset img { - width: auto; - display: inline; -} .sf-toolbarreset svg, .sf-toolbarreset img { max-height: 24px; } -.sf-toolbarreset table { - border-collapse: collapse; - border-spacing: 0; - background-color: #000; - margin: 0; - padding: 0; - border: 0; - width: 100%; - table-layout: auto; -} .sf-toolbarreset .hide-button { background: #444; cursor: pointer; @@ -78,20 +61,17 @@ cursor: default; display: block; float: left; - margin-right: 0px; + height: 36px; + margin-right: 0; white-space: nowrap; } -.sf-toolbar-block a, -.sf-toolbar-block a:hover { +.sf-toolbar-block > a, +.sf-toolbar-block > a:hover { + display: block; text-decoration: none; } -.sf-toolbar-block-config { - float: right; - margin-left: 0; - margin-right: 0; -} .sf-toolbar-block-config svg { - padding-right: 4px; + max-height: 22px; } .sf-toolbar-block span { @@ -103,25 +83,33 @@ line-height: 36px; padding: 0; } -.sf-toolbar-block .sf-toolbar-label { +.sf-toolbar-block .sf-toolbar-label, +.sf-toolbar-block .sf-toolbar-class-separator { color: #AAA; font-size: 12px; } -.sf-toolbar-block-config-php .sf-toolbar-label, -.sf-toolbar-block-config-symfony .sf-toolbar-label { - font-size: 11px; -} +/* TODO: remove it when Twig uses SVG icons */ .sf-toolbar-block-twig img { opacity: .8; } .sf-toolbar-block .sf-toolbar-info { + border-collapse: collapse; display: table; } +.sf-toolbar-block .sf-toolbar-info-piece-group { + border-top: 1px solid #777; + margin-top: 4px; + padding-top: 4px; +} .sf-toolbar-block .sf-toolbar-info-piece { + /* this 'border-bottom' trick is needed because 'margin-bottom' doesn't work for table rows */ + border-bottom: solid transparent 3px; display: table-row; - line-height: 1.4; - margin-bottom: 8px; +} +.sf-toolbar-block .sf-toolbar-info-piece-additional, +.sf-toolbar-block .sf-toolbar-info-piece-additional-detail { + display: none; } .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { @@ -198,7 +186,7 @@ background-color: rgba(200, 43, 43, 0.8); } .sf-toolbar-block .sf-toolbar-status-yellow { - background-color: rgba(255, 158, 43, 0.8); + background-color: rgb(189, 132, 0); } .sf-toolbar-block.sf-toolbar-status-green { @@ -213,16 +201,21 @@ fill: #FFF; } .sf-toolbar-block.sf-toolbar-status-yellow { - background-color: rgba(255, 158, 43, 0.8); + background-color: rgb(189, 132, 0); color: #FFF; } .sf-toolbar-block-request .sf-toolbar-status { color: #FFF; font-size: 14px; - margin-right: 4px; max-height: 36px; - padding: 10px; + padding: 10px 7px; +} +.sf-toolbar-block-request .sf-toolbar-info-piece a { + text-decoration: none; +} +.sf-toolbar-block-request .sf-toolbar-info-piece a:hover { + text-decoration: underline; } .sf-toolbar-status-green .sf-toolbar-label, @@ -238,17 +231,23 @@ .sf-toolbar-block .sf-toolbar-icon { display: block; - padding: 0 10px; + height: 36px; + padding: 0 7px; } .sf-toolbar-block-request .sf-toolbar-icon { padding-left: 0; + padding-right: 0; } -.sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { +.sf-toolbar-block .sf-toolbar-icon img, +.sf-toolbar-block .sf-toolbar-icon svg { border-width: 0; - vertical-align: middle; position: relative; - top: -1px; + top: 5px; +} +.sf-toolbar-block-translation .sf-toolbar-icon svg, +.sf-toolbar-block-config .sf-toolbar-icon svg { + top: 8px; } .sf-toolbar-block .sf-toolbar-icon img + span, @@ -256,27 +255,10 @@ margin-left: 4px; } -.sf-toolbar-block-time .sf-toolbar-icon { - padding-right: 5px; -} -.sf-toolbar-block-memory .sf-toolbar-icon { - padding-left: 5px; -} - .sf-toolbar-info-php-ext .sf-toolbar-status + .sf-toolbar-status { margin-left: 4px; } -.sf-toolbar-block a .sf-toolbar-info-piece-additional, -.sf-toolbar-block a .sf-toolbar-info-piece-additional-detail { - display: inline-block; -} - -.sf-toolbar-block a .sf-toolbar-info-piece-additional:empty, -.sf-toolbar-block a .sf-toolbar-info-piece-additional-detail:empty { - display: none; -} - .sf-toolbar-block:hover { position: relative; } @@ -289,13 +271,7 @@ .sf-toolbar-block:hover .sf-toolbar-info { display: block; - min-width: -webkit-calc(100% + 2px); - min-width: calc(100% + 2px); - z-index: 10001; - box-sizing: border-box; - padding: 9px; - line-height: 1.5; - + padding: 8px; max-width: 480px; max-height: 480px; word-wrap: break-word; @@ -309,7 +285,6 @@ .sf-toolbar-ajax-requests { width: 100%; } - .sf-toolbar-ajax-requests td { background-color: #444; border-bottom: 1px solid #777; @@ -342,9 +317,6 @@ .sf-ajax-request-duration { text-align: right; } -.sf-ajax-request-error { - color: #a33 !important; -} .sf-ajax-request-loading { -webkit-animation: sf-blink .5s ease-in-out infinite; -o-animation: sf-blink .5s ease-in-out infinite; @@ -352,24 +324,24 @@ animation: sf-blink .5s ease-in-out infinite; } @-webkit-keyframes sf-blink { - 0% { color: black; } - 50% { color: #bbb; } - 100% { color: black; } + 0% { background: #222; } + 50% { background: #444; } + 100% { background: #222; } } @-moz-keyframes sf-blink { - 0% { color: black; } - 50% { color: #bbb; } - 100% { color: black; } + 0% { background: #222; } + 50% { background: #444; } + 100% { background: #222; } } @-o-keyframes sf-blink { - 0% { color: black; } - 50% { color: #bbb; } - 100% { color: black; } + 0% { background: #222; } + 50% { background: #444; } + 100% { background: #222; } } @keyframes sf-blink { - 0% { color: black; } - 50% { color: #bbb; } - 100% { color: black; } + 0% { background: #222; } + 50% { background: #444; } + 100% { background: #222; } } .sf-toolbar-block-dump pre.sf-dump { @@ -390,7 +362,7 @@ display: none; } -/***** Override the setting when the toolbar is on the top *****/ +/* Override the setting when the toolbar is on the top */ {% if position == 'top' %} .sf-minitoolbar { bottom: auto; @@ -416,38 +388,75 @@ } {% endif %} -/***** Media query *****/ -@media screen and (max-width: 779px) { - .sf-toolbar-block .sf-toolbar-icon > * > :first-child ~ * { - display: none; +/* Responsive Design */ +.sf-toolbar-icon .sf-toolbar-label, +.sf-toolbar-icon .sf-toolbar-value { + display: none; +} +.sf-toolbar-block-config .sf-toolbar-icon .sf-toolbar-label { + display: inline-block; +} + +@media (min-width: 768px) { +.navbar-brand::before { content: "768 px"; background: red; + color: white; + position: absolute; } + + .sf-toolbar-icon .sf-toolbar-label, + .sf-toolbar-icon .sf-toolbar-value { + display: inline; } - .sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional, - .sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional-detail { - display: none !important; + .sf-toolbar-block .sf-toolbar-icon img, + .sf-toolbar-block .sf-toolbar-icon svg { + top: 6px; + } + .sf-toolbar-block-config .sf-toolbar-icon svg { + top: 8px; + } + .sf-toolbar-block-time .sf-toolbar-icon svg, + .sf-toolbar-block-memory .sf-toolbar-icon svg { + display: none; } -} -@media screen and (min-width: 880px) { - .sf-toolbar-block .sf-toolbar-icon a[href$="config"] .sf-toolbar-info-piece-additional { - display: inline-block; + .sf-toolbar-block .sf-toolbar-icon { + padding: 0 10px; + } + .sf-toolbar-block-time .sf-toolbar-icon { + padding-right: 5px; + } + .sf-toolbar-block-memory .sf-toolbar-icon { + padding-left: 5px; + } + .sf-toolbar-block-request .sf-toolbar-icon { + padding-left: 0; + } + .sf-toolbar-block-request .sf-toolbar-status { + margin-right: 4px; + padding: 10px; + } + .sf-toolbar-block-config { + float: right; + margin-left: 0; + margin-right: 0; } } -@media screen and (min-width: 980px) { - .sf-toolbar-block .sf-toolbar-icon a[href$="security"] .sf-toolbar-info-piece-additional { +@media (min-width: 1024px) { +.navbar-brand::before { content: "1024 px"; } + + .sf-toolbar-block .sf-toolbar-info-piece-additional, + .sf-toolbar-block .sf-toolbar-info-piece-additional-detail { display: inline-block; } -} -@media screen and (max-width: 1179px) { - .sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional { + .sf-toolbar-block .sf-toolbar-info-piece-additional:empty, + .sf-toolbar-block .sf-toolbar-info-piece-additional-detail:empty { display: none; } } -@media screen and (max-width: 1439px) { - .sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional-detail { - display: none; - } +@media (min-width: 1200px) { +.navbar-brand::before { content: "1200 px"; } + } From e14fb6d5c9f65d99aae169e136293da6e8d9ba8e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 18:11:29 +0200 Subject: [PATCH 17/44] Fixed a minor syntax issue --- .../Bundle/WebProfilerBundle/Profiler/TemplateManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 2a12198542bf..7be8c7296a33 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -141,7 +141,7 @@ protected function templateExists($template) * It changes the default order of collector templates to show them in a * different order which is better for design and aesthetic reasons. * - * @param array $templates + * @param array $templates * @return array */ protected function reorderTemplates($templates) From 7c35d25baeecfd0c8687d5692f7992f8169acabb Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 18:22:31 +0200 Subject: [PATCH 18/44] Fixed another insignificant syntax issue --- .../Bundle/WebProfilerBundle/Profiler/TemplateManager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 7be8c7296a33..3cb004c46069 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -142,6 +142,7 @@ protected function templateExists($template) * different order which is better for design and aesthetic reasons. * * @param array $templates + * * @return array */ protected function reorderTemplates($templates) From 23dc884dcfefb205f5139470016a9018244ebcc3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 22:41:25 +0200 Subject: [PATCH 19/44] Fixed a potential issue in the request panel --- .../Resources/views/Collector/request.html.twig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 25cecdc20102..b7d693b6e74f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -40,10 +40,12 @@ Controller method {{ request_handler }}
    -
    - Controller file - {{ collector.controller.class }} -
    + {% if collector.controller.class is defined %} +
    + Controller file + {{ collector.controller.class }} +
    + {% endif %}
    Route name {{ collector.route|default('NONE') }} From e28f895a182fb27f780b9f8e350da1cef2b56ec1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 22:43:30 +0200 Subject: [PATCH 20/44] A very high z-index value is required to avoid issues in the profiler view --- .../Resources/views/Profiler/toolbar.css.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 975ed9639f53..02cadc579093 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -6,7 +6,7 @@ padding: 5px 6px 0; position: fixed; right: 0; - z-index: 9999; + z-index: 99999; } .sf-toolbarreset * { @@ -29,7 +29,7 @@ position: fixed; right: 0; text-align: left; - z-index: 9999; + z-index: 99999; } .sf-toolbarreset abbr { border: none; From cd5321016116b7768822a3517e6aa1ae98160f75 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 10 Jul 2015 10:08:14 +0200 Subject: [PATCH 21/44] Fixed another z-index issue --- .../WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 02cadc579093..cc35f17d9c4d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -96,6 +96,7 @@ .sf-toolbar-block .sf-toolbar-info { border-collapse: collapse; display: table; + z-index: 99999; } .sf-toolbar-block .sf-toolbar-info-piece-group { border-top: 1px solid #777; From 0dfcb602ef69ada4d64ea83cb7653c8ea9b80ffa Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 10 Jul 2015 10:11:14 +0200 Subject: [PATCH 22/44] Fixed an issue with the Config panel in the Profiler view --- .../Resources/views/Profiler/toolbar.css.twig | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index cc35f17d9c4d..eb6eaeff64f6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -399,10 +399,6 @@ } @media (min-width: 768px) { -.navbar-brand::before { content: "768 px"; background: red; - color: white; - position: absolute; } - .sf-toolbar-icon .sf-toolbar-label, .sf-toolbar-icon .sf-toolbar-value { display: inline; @@ -415,6 +411,9 @@ .sf-toolbar-block-config .sf-toolbar-icon svg { top: 8px; } + .sf-toolbar-block-config:hover .sf-toolbar-info { + right: 0; + } .sf-toolbar-block-time .sf-toolbar-icon svg, .sf-toolbar-block-memory .sf-toolbar-icon svg { display: none; @@ -444,8 +443,6 @@ } @media (min-width: 1024px) { -.navbar-brand::before { content: "1024 px"; } - .sf-toolbar-block .sf-toolbar-info-piece-additional, .sf-toolbar-block .sf-toolbar-info-piece-additional-detail { display: inline-block; @@ -458,6 +455,4 @@ } @media (min-width: 1200px) { -.navbar-brand::before { content: "1200 px"; } - } From 9e38a8aa963e5be67db9fef0e80652c700b04469 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 10 Jul 2015 10:28:54 +0200 Subject: [PATCH 23/44] Minor CSS tweaks and made font sizes bigger --- .../views/Collector/security.html.twig | 10 ++++++--- .../Resources/views/Profiler/toolbar.css.twig | 22 +++++-------------- 2 files changed, 13 insertions(+), 19 deletions(-) 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 2ca6a02ee593..7ecaf82759ef 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -26,13 +26,17 @@ {% if collector.tokenClass != null %}
    Token class - {{ collector.tokenClass|abbr_class }} + {{ collector.tokenClass|abbr_class }}
    {% endif %} {% elseif collector.enabled %} - You are not authenticated. +
    + You are not authenticated. +
    {% else %} - The security is disabled. +
    + The security is disabled. +
    {% endif %} {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index eb6eaeff64f6..3e3fa4404183 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -133,27 +133,15 @@ .sf-toolbar-block .sf-toolbar-info-piece b { color: #AAA; display: table-cell; - font-size: 11px; + font-size: 12px; padding: 4px 8px 4px 4px; } .sf-toolbar-block .sf-toolbar-info-piece span { } -.sf-toolbar-block .sf-toolbar-info-piece span, -.sf-toolbar-block .sf-toolbar-info-piece abbr { +.sf-toolbar-block .sf-toolbar-info-piece span { color: #F5F5F5; - font-size: 12px; -} - -.sf-toolbar-block .sf-toolbar-info-with-next-pointer:after { - content: ' :: '; - color: #999; -} - -.sf-toolbar-block .sf-toolbar-info-with-delimiter { - border-right: 1px solid #999; - padding-right: 5px; - margin-right: 5px; + font-size: 13px; } .sf-toolbar-block .sf-toolbar-info { @@ -279,7 +267,9 @@ overflow: hidden; overflow-y: auto; } - +.sf-toolbar-block-request:hover .sf-toolbar-info { + max-width: none; +} .sf-toolbar-info-piece b.sf-toolbar-ajax-info { color: #F5F5F5; } From f087ac0bcd5a3e7e08fd3cb1be6c208364b0e3d2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 10 Jul 2015 10:47:29 +0200 Subject: [PATCH 24/44] More vertical aligning fixes --- .../Resources/views/Collector/twig.html.twig | 8 +++----- .../Resources/views/Profiler/toolbar.css.twig | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) 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 293180757fd6..4f758a1d12c1 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -3,11 +3,9 @@ {% block toolbar %} {% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %} {% set icon %} - - {{ include('@WebProfiler/Icon/twig.html.twig') }} - {{ time }} - ms - + {{ include('@WebProfiler/Icon/twig.html.twig') }} + {{ time }} + ms {% endset %} {% set text %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 3e3fa4404183..2314f0896d51 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -393,11 +393,22 @@ .sf-toolbar-icon .sf-toolbar-value { display: inline; } + .sf-toolbar-block .sf-toolbar-value { + /* needed for perfect vertical aligning */ + line-height: 37px; + } .sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { top: 6px; } + /* TODO: needed for perfect vertical aligning, remove when icons are recreated */ + .sf-toolbar-block-twig .sf-toolbar-icon img { + top: 7px; + } + .sf-toolbar-block-security .sf-toolbar-icon svg { + top: 7px; + } .sf-toolbar-block-config .sf-toolbar-icon svg { top: 8px; } From 3ab2e20913e70aa7524a1c13f93174ed55666f4f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 14 Jul 2015 13:03:21 +0200 Subject: [PATCH 25/44] fixed all vertical aligning issues and tweaked icons --- .../Resources/views/Profiler/dump.html.twig | 5 +- .../views/Collector/security.html.twig | 4 +- .../Resources/views/Icon/ajax.svg.twig | 7 +- .../Resources/views/Icon/close.svg.twig | 6 +- .../Resources/views/Icon/form.svg.twig | 7 +- .../Resources/views/Icon/logger.svg.twig | 8 ++- .../Resources/views/Icon/memory.svg.twig | 6 +- .../Resources/views/Icon/symfony.svg.twig | 13 +++- .../Resources/views/Icon/time.svg.twig | 6 +- .../Resources/views/Icon/translation.svg.twig | 14 +++- .../Resources/views/Icon/twig.html.twig | 6 +- .../Resources/views/Profiler/toolbar.css.twig | 64 ++++++------------- 12 files changed, 92 insertions(+), 54 deletions(-) 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 2ce089908085..7f2354746963 100644 --- a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig +++ b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig @@ -5,7 +5,10 @@ {% if dumps_count %} {% set icon %} - + + + + {{ dumps_count }} {% endset %} 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 7ecaf82759ef..6c5b85356de1 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -9,7 +9,9 @@ {% endif %} {% set icon %} - + + + {{ collector.user|default('n/a') }} {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig index ba77a3aa7f40..d8cad847d471 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig @@ -1 +1,6 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig index 70b4d589bc60..49a75fc16514 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig @@ -1 +1,5 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig index 07bd66550718..18bdb6e793d5 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig @@ -1 +1,6 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig index b29b2071d40f..3270a33618d5 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig @@ -1 +1,7 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig index 90b195a52173..5cd2fc4d84f2 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig @@ -1 +1,5 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig index d4136c0958e0..8d0ab1417f89 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig @@ -1 +1,12 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig index 65f36710844f..ec280a59a6bc 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig @@ -1 +1,5 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig index ed8601a2a945..93d42327ed85 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig @@ -1 +1,13 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig index a8e72424cf20..21d81ea2161c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig @@ -1 +1,5 @@ -Twig + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 2314f0896d51..6f7f95ebc94a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -37,7 +37,7 @@ } .sf-toolbarreset svg, .sf-toolbarreset img { - max-height: 24px; + max-height: 20px; } .sf-toolbarreset .hide-button { background: #444; @@ -47,15 +47,11 @@ top: 0; right: 0; width: 36px; - height: 30px; + height: 28px; cursor: pointer; - padding-top: 6px; + padding-top: 8px; text-align: center; } -.sf-toolbarreset .hide-button svg { - max-height: 24px; - max-width: 24px; -} .sf-toolbar-block { cursor: default; @@ -70,9 +66,6 @@ display: block; text-decoration: none; } -.sf-toolbar-block-config svg { - max-height: 22px; -} .sf-toolbar-block span { display: inline-block; @@ -117,6 +110,9 @@ padding: 2px 5px; margin-bottom: 0px; } +.sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status + .sf-toolbar-status { + margin-left: 4px; +} .sf-toolbar-block .sf-toolbar-info-piece:last-child { margin-bottom: 0; @@ -134,7 +130,7 @@ color: #AAA; display: table-cell; font-size: 12px; - padding: 4px 8px 4px 4px; + padding: 4px 8px 4px 0; } .sf-toolbar-block .sf-toolbar-info-piece span { @@ -186,9 +182,6 @@ background-color: rgba(200, 43, 43, 0.8); color: #FFF; } -.sf-toolbar-block.sf-toolbar-status-red svg > g > path { - fill: #FFF; -} .sf-toolbar-block.sf-toolbar-status-yellow { background-color: rgb(189, 132, 0); color: #FFF; @@ -196,9 +189,11 @@ .sf-toolbar-block-request .sf-toolbar-status { color: #FFF; + display: inline-block; font-size: 14px; - max-height: 36px; - padding: 10px 7px; + height: 36px; + line-height: 36px; + padding: 0 10px; } .sf-toolbar-block-request .sf-toolbar-info-piece a { text-decoration: none; @@ -212,9 +207,12 @@ .sf-toolbar-status-red .sf-toolbar-label { color: #FFF; } -.sf-toolbar-status-green svg > g > path, -.sf-toolbar-status-red svg > g > path, -.sf-toolbar-status-yellow svg > g > path { +.sf-toolbar-status-green svg path, +.sf-toolbar-status-red svg path, +.sf-toolbar-status-yellow svg path { + fill: #FFF; +} +.sf-toolbar-block-config svg path { fill: #FFF; } @@ -232,10 +230,6 @@ .sf-toolbar-block .sf-toolbar-icon svg { border-width: 0; position: relative; - top: 5px; -} -.sf-toolbar-block-translation .sf-toolbar-icon svg, -.sf-toolbar-block-config .sf-toolbar-icon svg { top: 8px; } @@ -243,24 +237,21 @@ .sf-toolbar-block .sf-toolbar-icon svg + span { margin-left: 4px; } - -.sf-toolbar-info-php-ext .sf-toolbar-status + .sf-toolbar-status { +.sf-toolbar-block-config .sf-toolbar-icon .sf-toolbar-value { margin-left: 4px; } .sf-toolbar-block:hover { position: relative; } - .sf-toolbar-block:hover .sf-toolbar-icon { background-color: #444; position: relative; z-index: 10002; } - .sf-toolbar-block:hover .sf-toolbar-info { display: block; - padding: 8px; + padding: 10px; max-width: 480px; max-height: 480px; word-wrap: break-word; @@ -393,25 +384,11 @@ .sf-toolbar-icon .sf-toolbar-value { display: inline; } - .sf-toolbar-block .sf-toolbar-value { - /* needed for perfect vertical aligning */ - line-height: 37px; - } .sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { top: 6px; } - /* TODO: needed for perfect vertical aligning, remove when icons are recreated */ - .sf-toolbar-block-twig .sf-toolbar-icon img { - top: 7px; - } - .sf-toolbar-block-security .sf-toolbar-icon svg { - top: 7px; - } - .sf-toolbar-block-config .sf-toolbar-icon svg { - top: 8px; - } .sf-toolbar-block-config:hover .sf-toolbar-info { right: 0; } @@ -432,10 +409,11 @@ .sf-toolbar-block-request .sf-toolbar-icon { padding-left: 0; } + .sf-toolbar-block-request .sf-toolbar-status { margin-right: 4px; - padding: 10px; } + .sf-toolbar-block-config { float: right; margin-left: 0; From 9b585b980855938b69e9db5d54a0ae8d356caf3d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 14 Jul 2015 15:44:49 +0200 Subject: [PATCH 26/44] Made the close icon a bit smaller --- .../Resources/views/Profiler/toolbar.css.twig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 6f7f95ebc94a..8698818f9fd4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -39,6 +39,7 @@ .sf-toolbarreset img { max-height: 20px; } + .sf-toolbarreset .hide-button { background: #444; cursor: pointer; @@ -47,11 +48,14 @@ top: 0; right: 0; width: 36px; - height: 28px; + height: 36px; cursor: pointer; - padding-top: 8px; text-align: center; } +.sf-toolbarreset .hide-button svg { + max-height: 18px; + padding-top: 10px; +} .sf-toolbar-block { cursor: default; From e94a6a02b15098450c073e54a109c29532dd6dc1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 11:29:57 +0200 Subject: [PATCH 27/44] Smaller font sizes for smartphones, fixed request status padding issue and make too long panels always be displayed at the leftmost part of browser window --- .../Resources/views/Profiler/toolbar.css.twig | 26 ++++++++++++++----- .../views/Profiler/toolbar_js.html.twig | 5 +++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 8698818f9fd4..909198b9487f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -133,7 +133,7 @@ .sf-toolbar-block .sf-toolbar-info-piece b { color: #AAA; display: table-cell; - font-size: 12px; + font-size: 11px; padding: 4px 8px 4px 0; } .sf-toolbar-block .sf-toolbar-info-piece span { @@ -141,7 +141,7 @@ } .sf-toolbar-block .sf-toolbar-info-piece span { color: #F5F5F5; - font-size: 13px; + font-size: 12px; } .sf-toolbar-block .sf-toolbar-info { @@ -262,9 +262,6 @@ overflow: hidden; overflow-y: auto; } -.sf-toolbar-block-request:hover .sf-toolbar-info { - max-width: none; -} .sf-toolbar-info-piece b.sf-toolbar-ajax-info { color: #F5F5F5; } @@ -384,6 +381,7 @@ } @media (min-width: 768px) { + .sf-toolbar-icon .sf-toolbar-label, .sf-toolbar-icon .sf-toolbar-value { display: inline; @@ -412,10 +410,24 @@ } .sf-toolbar-block-request .sf-toolbar-icon { padding-left: 0; + padding-right: 0; + } + .sf-toolbar-block-request .sf-toolbar-status + .sf-toolbar-label { + margin-left: 4px; + } + .sf-toolbar-block-request .sf-toolbar-label + .sf-toolbar-value { + margin-right: 10px; } - .sf-toolbar-block-request .sf-toolbar-status { - margin-right: 4px; + .sf-toolbar-block-request:hover .sf-toolbar-info { + max-width: none; + } + + .sf-toolbar-block .sf-toolbar-info-piece b { + font-size: 12px; + } + .sf-toolbar-block .sf-toolbar-info-piece span { + font-size: 13px; } .sf-toolbar-block-config { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig index 1814a004c935..1eadef3e9611 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig @@ -46,7 +46,10 @@ toolbarInfo.style.right = ''; toolbarInfo.style.left = ''; - if (leftValue > 0 && rightValue > 0) { + if (elementWidth > pageWidth) { + toolbarInfo.style.left = 0; + } + else if (leftValue > 0 && rightValue > 0) { toolbarInfo.style.right = (rightValue * -1) + 'px'; } else if (leftValue < 0) { toolbarInfo.style.left = 0; From 002dda5bd392bea90f6a0493e4c412f9811e9ba2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 11:59:57 +0200 Subject: [PATCH 28/44] Fixed toolbar issues when displaying it inside the profiler --- .../WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 909198b9487f..77eb3e858b5d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -357,6 +357,7 @@ bottom: auto; box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2); top: 0; + overflow: hidden; /* needed to aovid issues for toolbars with lots of elements */ } .sf-toolbar-block .sf-toolbar-info { From a0e03f6b2c8ef98f59ec2ee81f1ce64f07275c85 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 12:14:53 +0200 Subject: [PATCH 29/44] Minor tweaks --- .../Resources/views/Profiler/toolbar.css.twig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 77eb3e858b5d..ae6ad0284427 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -370,6 +370,10 @@ .sf-toolbarreset { position: static; } + + .sf-toolbar-block:hover .sf-toolbar-icon { + background-color: inherit; + } {% endif %} /* Responsive Design */ @@ -399,6 +403,10 @@ .sf-toolbar-block-memory .sf-toolbar-icon svg { display: none; } + .sf-toolbar-block-time .sf-toolbar-icon svg + span, + .sf-toolbar-block-memory .sf-toolbar-icon svg + span { + margin-left: 0; + } .sf-toolbar-block .sf-toolbar-icon { padding: 0 10px; From 18472853226756ed1abe3feb1c2de7d6924a4883 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 15:23:16 +0200 Subject: [PATCH 30/44] Pass the toolbar version number from the controller, to ease transition and keep BC --- .../Controller/ProfilerController.php | 15 +++++++++++---- .../Resources/views/Profiler/toolbar.html.twig | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index cada4ee6ca43..558966f415b3 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -11,13 +11,14 @@ namespace Symfony\Bundle\WebProfilerBundle\Controller; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Profiler\Profiler; -use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** @@ -27,6 +28,9 @@ */ class ProfilerController { + const TOOLBAR_VERSION_1 = 1; + const TOOLBAR_VERSION_2 = 2; + private $templateManager; private $generator; private $profiler; @@ -201,12 +205,15 @@ public function toolbarAction(Request $request, $token) // the profiler is not enabled } + $toolbarVersion = Kernel::VERSION_ID < 20800 ? self::TOOLBAR_VERSION_1 : self::TOOLBAR_VERSION_2; + return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( 'position' => $position, 'profile' => $profile, 'templates' => $this->getTemplateManager()->getTemplates($profile), 'profiler_url' => $url, 'token' => $token, + 'toolbar_version' => $toolbarVersion, )), 200, array('Content-Type' => 'text/html')); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index 58c125268e75..cc47a2ef7d32 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -30,7 +30,8 @@ 'collector': profile.getcollector(name), 'profiler_url': profiler_url, 'token': profile.token, - 'name': name + 'name': name, + 'toolbar_version': toolbar_version }) }} {% endfor %} From ebb44e483225ef5920816be76b212d90cae793d1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 16:27:08 +0200 Subject: [PATCH 31/44] Added some styles to make old panels look better in the new design --- .../Resources/views/Profiler/toolbar.css.twig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index ae6ad0284427..647354387027 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -385,6 +385,18 @@ display: inline-block; } +/* Legacy Design - these styles are maintained to make old panels look + a bit better on the new toolbar */ +.sf-toolbar-block .sf-toolbar-info-piece-additional-detail { + color: #AAA; + font-size: 12px; +} +.sf-toolbar-status-green .sf-toolbar-info-piece-additional-detail, +.sf-toolbar-status-yellow .sf-toolbar-info-piece-additional-detail, +.sf-toolbar-status-red .sf-toolbar-info-piece-additional-detail { + color: #FFF; +} + @media (min-width: 768px) { .sf-toolbar-icon .sf-toolbar-label, From 972a92e778e08505c77bb7b6f5187828fcf935d4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 22 Jul 2015 17:55:10 +0200 Subject: [PATCH 32/44] Misc. tweaks and improvements --- .../Bundle/WebProfilerBundle/Profiler/TemplateManager.php | 2 +- .../Resources/views/Collector/request.html.twig | 4 ++-- .../Resources/views/Collector/time.html.twig | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 3cb004c46069..d074db31bd64 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -145,7 +145,7 @@ protected function templateExists($template) * * @return array */ - protected function reorderTemplates($templates) + private function reorderTemplates($templates) { $templates = $this->moveArrayElementToFirstPosition($templates, 'twig'); $templates = $this->moveArrayElementToFirstPosition($templates, 'memory'); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index b7d693b6e74f..ad799c6b23e4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -37,12 +37,12 @@ {{ collector.statuscode }} {{ collector.statustext }}
    - Controller method + Controller {{ request_handler }}
    {% if collector.controller.class is defined %}
    - Controller file + Controller class {{ collector.controller.class }}
    {% endif %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 8b5330df6b06..7d341a09d32f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -18,7 +18,7 @@ {% block toolbar %} {% set total_time = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %} {% set initialization_time = collector.events|length ? '%.0f'|format(collector.inittime) : 'n/a' %} - {% set status_color = collector.events|length ? collector.duration > 1000 ? 'yellow' : '' %} + {% set status_color = collector.events|length and collector.duration > 1000 ? 'yellow' : '' %} {% set icon %} {{ include('@WebProfiler/Icon/time.svg.twig') }} From 084cca644df7a3675fe9eb07c86b64aac6c49167 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 22 Jul 2015 18:16:40 +0200 Subject: [PATCH 33/44] Minor JavaScript optimizations --- .../Resources/views/Profiler/base_js.html.twig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index d0f51c42d2f4..6c8826dabe72 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -169,8 +169,8 @@ infoSpan.textContent = text; } } else { - var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); - ajaxToolbarPanel[0].style.display = 'none'; + var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); + ajaxToolbarPanel.style.display = 'none'; } } @@ -179,11 +179,11 @@ var className = 'sf-toolbar-ajax-requests sf-toolbar-value'; requestCounter[0].className = className; - var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); + var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); if (state == 'error') { - Sfjs.addClass(ajaxToolbarPanel[0], 'sf-toolbar-status-red'); + Sfjs.addClass(ajaxToolbarPanel, 'sf-toolbar-status-red'); } else { - Sfjs.addClass(ajaxToolbarPanel[0], 'sf-ajax-request-loading'); + Sfjs.addClass(ajaxToolbarPanel, 'sf-ajax-request-loading'); } }; From 7ec1cd491da1bd696499c79d044d96f0fa58870e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 27 Jul 2015 09:36:22 +0200 Subject: [PATCH 34/44] Reverted the feature to display different toolbar versions --- .../WebProfilerBundle/Controller/ProfilerController.php | 6 ------ .../Resources/views/Profiler/toolbar.html.twig | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 558966f415b3..1af8644850f3 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -28,9 +28,6 @@ */ class ProfilerController { - const TOOLBAR_VERSION_1 = 1; - const TOOLBAR_VERSION_2 = 2; - private $templateManager; private $generator; private $profiler; @@ -205,15 +202,12 @@ public function toolbarAction(Request $request, $token) // the profiler is not enabled } - $toolbarVersion = Kernel::VERSION_ID < 20800 ? self::TOOLBAR_VERSION_1 : self::TOOLBAR_VERSION_2; - return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( 'position' => $position, 'profile' => $profile, 'templates' => $this->getTemplateManager()->getTemplates($profile), 'profiler_url' => $url, 'token' => $token, - 'toolbar_version' => $toolbarVersion, )), 200, array('Content-Type' => 'text/html')); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index cc47a2ef7d32..58c125268e75 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -30,8 +30,7 @@ 'collector': profile.getcollector(name), 'profiler_url': profiler_url, 'token': profile.token, - 'name': name, - 'toolbar_version': toolbar_version + 'name': name }) }} {% endfor %} From 2fb33191fe71430ac42528deeb5d5855ae7e4ac8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 30 Jul 2015 09:30:53 +0200 Subject: [PATCH 35/44] Removed an unused import --- .../Bundle/WebProfilerBundle/Controller/ProfilerController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 1af8644850f3..19d8322eb07d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -17,7 +17,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; From 5070861326346efe932673d837e4d14e60df1af1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 30 Jul 2015 13:21:10 +0200 Subject: [PATCH 36/44] Added a new profiler_markup_version to improve BC of the new toolbar --- .../Bundle/WebProfilerBundle/Controller/ProfilerController.php | 1 + .../Resources/views/Profiler/toolbar.html.twig | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 19d8322eb07d..261d0afcb908 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -207,6 +207,7 @@ public function toolbarAction(Request $request, $token) 'templates' => $this->getTemplateManager()->getTemplates($profile), 'profiler_url' => $url, 'token' => $token, + 'profiler_markup_version' => 2, // 1 = original toolbar, 2 = Symfony 2.8+ toolbar )), 200, array('Content-Type' => 'text/html')); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index 58c125268e75..e141a0df1125 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -30,7 +30,8 @@ 'collector': profile.getcollector(name), 'profiler_url': profiler_url, 'token': profile.token, - 'name': name + 'name': name, + 'profiler_markup_version': profiler_markup_version }) }} {% endfor %} From 22f6bc5003e4536c8114731c576cb54ebd8250b2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 30 Jul 2015 15:15:53 +0200 Subject: [PATCH 37/44] Removed an useless CSS class and added styles for
    --- .../Resources/views/Profiler/toolbar.css.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 647354387027..1cd7fd541b0c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -95,9 +95,9 @@ display: table; z-index: 99999; } -.sf-toolbar-block .sf-toolbar-info-piece-group { +.sf-toolbar-block hr { border-top: 1px solid #777; - margin-top: 4px; + margin: 4px 0; padding-top: 4px; } .sf-toolbar-block .sf-toolbar-info-piece { From 9df0f8b4b819c975532694043a3fcf76f929167d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 31 Jul 2015 12:12:25 +0200 Subject: [PATCH 38/44] Added some upgrade notes about the new toolbar design --- UPGRADE-2.8.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/UPGRADE-2.8.md b/UPGRADE-2.8.md index 966f1f471113..04792dee879f 100644 --- a/UPGRADE-2.8.md +++ b/UPGRADE-2.8.md @@ -136,3 +136,64 @@ DependencyInjection ``` + +Web Development Toolbar +----------------------- + +The web development toolbar has been completely redesigned. This update has +introduced some changes in the HTML markup of the toolbar items. + +Before: + +Information was wrapped with simple `` elements: + +```twig +{% block toolbar %} + {% set icon %} + + + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB + + {% endset %} +{% endblock %} +``` + +After: + +Information is now semantically divided into values and labels according to +the `class` attribute of each `` element: + +```twig +{% block toolbar %} + {% set icon %} + + + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} + + MB + {% endset %} +{% endblock %} +``` + +Most of the blocks designed for the previous toolbar will still be displayed +correctly. However, if you want to support both the old and the new toolbar, +it's better to make use of the new `profiler_markup_version` variable passed +to the toolbar templates: + +```twig +{% block toolbar %} + {% set profiler_markup_version = profiler_markup_version|default(1) %} + + {% set icon %} + {% if profiler_markup_version == 1 %} + + {# code for the original toolbar #} + + {% else %} + + {# code for the new toolbar (Symfony 2.8+) #} + + {% endif %} + {% endset %} +{% endblock %} +``` From 597637eceaff6f1605fc952e2053b2e833c373dc Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 31 Jul 2015 13:11:01 +0200 Subject: [PATCH 39/44] Tweaks and bug fixes --- .../Resources/views/Collector/ajax.html.twig | 2 +- .../Resources/views/Collector/config.html.twig | 7 +++++-- .../Resources/views/Collector/form.html.twig | 2 +- .../Resources/views/Collector/logger.html.twig | 4 ++-- .../Resources/views/Collector/memory.html.twig | 2 +- .../Resources/views/Collector/time.html.twig | 2 +- .../Resources/views/Collector/translation.html.twig | 8 ++++---- .../Resources/views/Collector/twig.html.twig | 2 +- .../Resources/views/Icon/{ajax.svg.twig => ajax.svg} | 0 .../Resources/views/Icon/{close.svg.twig => close.svg} | 0 .../Resources/views/Icon/{form.svg.twig => form.svg} | 0 .../Resources/views/Icon/{logger.svg.twig => logger.svg} | 0 .../Resources/views/Icon/{memory.svg.twig => memory.svg} | 0 .../views/Icon/{symfony.svg.twig => symfony.svg} | 0 .../Resources/views/Icon/{time.svg.twig => time.svg} | 0 .../views/Icon/{translation.svg.twig => translation.svg} | 0 .../Resources/views/Icon/{twig.html.twig => twig.svg} | 0 .../Resources/views/Profiler/base_js.html.twig | 3 +-- .../Resources/views/Profiler/toolbar.css.twig | 9 --------- .../Resources/views/Profiler/toolbar.html.twig | 4 ++-- 20 files changed, 19 insertions(+), 26 deletions(-) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{ajax.svg.twig => ajax.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{close.svg.twig => close.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{form.svg.twig => form.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{logger.svg.twig => logger.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{memory.svg.twig => memory.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{symfony.svg.twig => symfony.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{time.svg.twig => time.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{translation.svg.twig => translation.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{twig.html.twig => twig.svg} (100%) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig index fd9ee91c567f..fe73b662bd31 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig @@ -2,7 +2,7 @@ {% block toolbar %} {% set icon %} - {{ include('@WebProfiler/Icon/ajax.svg.twig') }} + {{ include('@WebProfiler/Icon/ajax.svg') }} 0 {% endset %} 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 4b66f4589a66..7379beaae862 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -21,7 +21,7 @@ {% set icon %} {% if collector.symfonyState is defined %} - {{ include('@WebProfiler/Icon/symfony.svg.twig') }} + {{ include('@WebProfiler/Icon/symfony.svg') }} {{ collector.symfonyversion }} {% elseif collector.applicationname %} @@ -71,7 +71,10 @@
    PHP version - {{ collector.phpversion }} + + {{ collector.phpversion }} +   View phpinfo() +
    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 27515f752295..f226e644af8c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -6,7 +6,7 @@ {% if collector.data.nb_errors > 0 or collector.data.forms|length %} {% set status_color = collector.data.nb_errors ? 'red' : '' %} {% set icon %} - {{ include('@WebProfiler/Icon/form.svg.twig') }} + {{ include('@WebProfiler/Icon/form.svg') }} {% if collector.data.nb_errors %} {{ collector.data.nb_errors }} 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 6344197eff6b..5053657e2bfe 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -7,7 +7,7 @@ {% set icon %} {% set status_color = collector.counterrors ? 'red' : collector.countdeprecations ? 'yellow' : '' %} {% set error_count = collector.counterrors + collector.countdeprecations + collector.countscreams %} - {{ include('@WebProfiler/Icon/logger.svg.twig') }} + {{ include('@WebProfiler/Icon/logger.svg') }} {{ error_count }} {% endset %} @@ -80,7 +80,7 @@ -{% if collector.logs %} + {% if collector.logs %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index 5dd22697475e..702b4df3658f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -3,7 +3,7 @@ {% block toolbar %} {% set icon %} {% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %} - {{ include('@WebProfiler/Icon/memory.svg.twig') }} + {{ include('@WebProfiler/Icon/memory.svg') }} {{ '%.1f'|format(collector.memory / 1024 / 1024) }}MB {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 7d341a09d32f..39f8f62abd3a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -21,7 +21,7 @@ {% set status_color = collector.events|length and collector.duration > 1000 ? 'yellow' : '' %} {% set icon %} - {{ include('@WebProfiler/Icon/time.svg.twig') }} + {{ include('@WebProfiler/Icon/time.svg') }} {{ total_time }}ms {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig index 7eefbde73c86..3d75c4676896 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig @@ -5,7 +5,7 @@ {% block toolbar %} {% if collector.messages|length %} {% set icon %} - {{ include('@WebProfiler/Icon/translation.svg.twig') }} + {{ include('@WebProfiler/Icon/translation.svg') }} {% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' : '' %} {% set error_count = collector.countMissings + collector.countFallbacks %} {{ error_count ?: collector.countdefines }} @@ -15,20 +15,20 @@
    Missing messages - {{ collector.countMissings|default(0) }} + {{ collector.countMissings }}
    Fallback messages - {{ collector.countFallbacks|default(0) }} + {{ collector.countFallbacks }}
    Defined messages - {{ collector.countdefines|default(0) }} + {{ collector.countdefines }}
    {% endset %} 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 4f758a1d12c1..95713b93db24 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -3,7 +3,7 @@ {% block toolbar %} {% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %} {% set icon %} - {{ include('@WebProfiler/Icon/twig.html.twig') }} + {{ include('@WebProfiler/Icon/twig.svg') }} {{ time }}ms {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index 6c8826dabe72..2b1eeff3c00e 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -86,6 +86,7 @@ return; } + var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); var tbodies = document.querySelectorAll('.sf-toolbar-ajax-request-list'); var state = 'ok'; if (tbodies.length) { @@ -169,7 +170,6 @@ infoSpan.textContent = text; } } else { - var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); ajaxToolbarPanel.style.display = 'none'; } } @@ -179,7 +179,6 @@ var className = 'sf-toolbar-ajax-requests sf-toolbar-value'; requestCounter[0].className = className; - var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); if (state == 'error') { Sfjs.addClass(ajaxToolbarPanel, 'sf-toolbar-status-red'); } else { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 1cd7fd541b0c..5b2e4f66667a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -85,10 +85,6 @@ color: #AAA; font-size: 12px; } -/* TODO: remove it when Twig uses SVG icons */ -.sf-toolbar-block-twig img { - opacity: .8; -} .sf-toolbar-block .sf-toolbar-info { border-collapse: collapse; @@ -316,11 +312,6 @@ 50% { background: #444; } 100% { background: #222; } } -@-o-keyframes sf-blink { - 0% { background: #222; } - 50% { background: #444; } - 100% { background: #222; } -} @keyframes sf-blink { 0% { background: #222; } 50% { background: #444; } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index e141a0df1125..e4fea4b00b1a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -15,7 +15,7 @@ Sfjs.setPreference('toolbar/displayState', 'block'); "> - {{ include('@WebProfiler/Icon/symfony.svg.twig') }} + {{ include('@WebProfiler/Icon/symfony.svg') }}
    #