From 041d4243a1102d9e8dc9fab914f4da04c839302e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 09:23:43 +0200 Subject: [PATCH] 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 1a1352ab32..2ca6a02ee5 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 6896555af7..4b8619f6b4 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; }