Improved the Security toolbar panel

This commit is contained in:
Javier Eguiluz 2015-07-09 09:23:43 +02:00
parent af3dcb2a97
commit 041d4243a1
2 changed files with 20 additions and 41 deletions

View File

@ -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 %}
<svg width="24" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 24 28" enable-background="new 0 0 24 28" xml:space="preserve"><g><path fill="#AAA" d="M8.6 14.6c0-0.4 0-0.6 0-0.9c0.2-0.1 0.5-0.6 0.5-1.1c0.1 0 0.3-0.1 0.4-0.6c0-0.3-0.1-0.4-0.2-0.5 c0.2-0.6 0.6-2.6-0.8-2.8C8.4 8.4 8 8.3 7.5 8.3c-2 0-2.2 1.5-1.8 3.2c-0.1 0-0.2 0.2-0.2 0.5c0.1 0.5 0.3 0.6 0.4 0.6 c0 0.5 0.4 1 0.5 1.1c0 0.3 0 0.6 0 0.9c-0.4 1.1-3 0.8-3.2 2.8h8.5C11.7 15.3 9 15.6 8.6 14.6z"/><path fill="#AAA" d="M18 10.7c-0.2 0-0.4 0-0.5 0.1c-0.2 0.1-0.3 0.2-0.5 0.5c-0.2 0.2-0.3 0.5-0.4 0.8s-0.1 0.6-0.1 0.8 c0 0.4 0.1 0.7 0.3 0.9c0.2 0.2 0.4 0.3 0.6 0.3c0.2 0 0.3 0 0.5-0.1c0.2-0.1 0.3-0.2 0.5-0.4c0.2-0.2 0.3-0.4 0.4-0.7 c0.1-0.3 0.2-0.6 0.2-0.9c0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.1-0.9 0.4-1.4c0.2-0.5 0.5-0.8 0.9-1 c0.3-0.2 0.7-0.3 1-0.3c0.3 0 0.5 0.1 0.7 0.2c0.2 0.1 0.4 0.3 0.6 0.6l0.1-0.7h0.8l-0.6 2.9c-0.1 0.4-0.1 0.6-0.1 0.7 c0 0.1 0 0.1 0.1 0.2c0.1 0.1 0.1 0.1 0.2 0.1c0.2 0 0.4-0.1 0.6-0.3c0.3-0.2 0.6-0.5 0.8-0.9c0.2-0.4 0.3-0.8 0.3-1.2 c0-0.5-0.1-0.9-0.4-1.3c-0.2-0.4-0.6-0.8-1.1-1s-1-0.4-1.6-0.4c-0.7 0-1.3 0.2-1.8 0.5c-0.6 0.3-1 0.8-1.3 1.4 c-0.3 0.6-0.5 1.2-0.5 1.9c0 0.7 0.2 1.3 0.5 1.8c0.3 0.5 0.8 0.9 1.3 1.1c0.6 0.2 1.2 0.4 1.9 0.4c0.8 0 1.4-0.1 1.9-0.4 c0.5-0.3 0.9-0.6 1.1-0.9h0.8C22 14.9 21.8 15.3 21.4 15.6z"/></g></svg>
<span class="sf-toolbar-value">{{ collector.user|default('n/a') }}</span>
{% endset %}
{% set text %}
{% if collector.tokenClass %}
<div class="sf-toolbar-info-piece">
@ -16,7 +21,7 @@
</div>
<div class="sf-toolbar-info-piece">
<b>Authenticated</b>
<span class="sf-toolbar-status sf-toolbar-status-{{ authentication_color_code }}">{{ authentication_color_text }}</span>
<span class="sf-toolbar-status sf-toolbar-status-{{ is_authenticated ? 'green' : 'red' }}">{{ is_authenticated ? 'Yes' : 'No' }}</span>
</div>
{% if collector.tokenClass != null %}
<div class="sf-toolbar-info-piece">
@ -30,11 +35,8 @@
The security is disabled.
{% endif %}
{% endset %}
{% set icon %}
<svg width="24" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 24 28" enable-background="new 0 0 24 28" xml:space="preserve"><g><path fill="#AAA" d="M8.6 14.6c0-0.4 0-0.6 0-0.9c0.2-0.1 0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-0.9h0.8C22 14.9 21.8 15.3 21.4 15.6z"/></g></svg>
{% if collector.user %}<span class="sf-toolbar-value sf-toolbar-info-piece-additional">{{ collector.user }}</span>{% 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 %}

View File

@ -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;
}