Updated the responsive design in addition to the scenario with authenticated users and exception notification.

This commit is contained in:
Juti Noppornpitak 2012-04-13 16:19:42 -04:00
parent 4a3312bda3
commit 306533b5d0
4 changed files with 57 additions and 12 deletions

View File

@ -3,12 +3,21 @@
{% block toolbar %}
{% if collector.user %}
{% set color_code = (collector.enabled and collector.authenticated) ? 'green' : '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' %}
{% endif %}
{% set text %}
{% if collector.user %}
You are logged in as {{ collector.user }}{% if not collector.authenticated %} <em>(not yet authenticated)</em>{% endif %}.
<div class="sf-toolbar-info-piece">
<b>Logged in as</b>
<span class="sf-toolbar-status sf-toolbar-status-{{ color_code }}">{{ collector.user }}</span>
</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>
</div>
{% elseif collector.enabled %}
You are not authenticated.
{% else %}
@ -18,7 +27,7 @@
{% set icon %}
<img width="24" height="28" alt="Security" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAAC70lEQVR42u2V3UtTYRzHu+mFwCwK+gO6CEryPlg7yiYx50vDqUwjFIZDSYUk2ZTmCysHvg9ZVggOQZiRScsR4VwXTjEwdKZWk8o6gd5UOt0mbev7g/PAkLONIOkiBx+25/v89vuc85zn2Q5Fo9F95UDwnwhS5HK5TyqVRv8m1JN6k+AiC+fn54cwbgFNIrTQ/J9IqDcJJDGBHsgDgYBSq9W6ysvLPf39/SSUUU7zsQ1yc3MjmN90OBzfRkZG1umzQqGIxPSTkIBjgdDkaGNjoza2kcFgUCE/QvMsq6io2PV6vQu1tbV8Xl7etkql2qqvr/+MbDE/Pz8s9OP2Cjhwwmw29+4R3Kec1WZnZ4fn5uamc3Jyttra2qbH8ero6JgdHh5+CvFHq9X6JZHgzODgoCVW0NPTY0N+ltU2Nzdv4GqXsYSrPp+vDw80aLFYxru6uhyQ/rDb7a8TCVJDodB1jUazTVlxcXGQ5/mbyE+z2u7u7veY38BVT3Z2djopm5qa6isrK/tQWVn5qb29fSGR4DC4PDAwMEsZHuArjGnyGKutq6v7ajQaF6urq9/MzMz0QuSemJiwQDwGkR0POhhXgILjNTU1TaWlpTxlOp1uyWQyaUjMajMzM8Nut/tJQUHBOpZppbCwkM/KytrBznuL9xDVxBMo8KXHYnu6qKjIivmrbIy67x6Px4Yd58W672ApfzY0NCyNjo7OZmRkiAv8fr+O47iwmABXtoXaG3uykF6vX7bZbF6cgZWqqiqezYkKcNtmjO+CF2AyhufgjsvlMiU7vXEF+4C4ALf9CwdrlVAqlcFkTdRqdQSHLUDgBEeSCrArAsiGwENs0XfJBE6ncxm1D8Aj/B6tigkkJSUlmxSwLYhMDeRsyyUCd+lHrWxtbe2aTCbbZTn1ZD92F0Cr8GBfgnsgDZwDt8EzMBmHMXBLqD0PDMAh9Gql3iRIESQSIAXp4CRIBZeEjIvDFZAm1J4C6UK9ROiZcvCn/+8FvwHtDdJEaRY+oQAAAABJRU5ErkJggg==" />
<span class="sf-toolbar-status sf-toolbar-status-{{ color_code }}"></span>
<div class="sf-toolbar-status sf-toolbar-info-piece-additional">{% if collector.user %}{{ collector.user }}{% endif %}</div>
{% if collector.user %}<div class="sf-toolbar-status sf-toolbar-info-piece-additional">{{ collector.user }}</div>{% endif %}
{% endset %}
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
{% endblock %}

View File

@ -182,14 +182,30 @@ build: 56
}
/***** Media query *****/
@media screen and (max-width: 700px) {
.sf-toolbar-block .sf-toolbar-icon > * :first-child ~ * {
@media screen and (max-width: 780px) {
.sf-toolbar-block .sf-toolbar-icon > * > :first-child ~ * {
display: none;
}
.sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional {
display: none !important;
}
}
@media screen and (min-width: 880px) {
.sf-toolbar-block .sf-toolbar-icon a[href$="config"] .sf-toolbar-info-piece-additional {
display: inline-block;
}
}
@media screen and (min-width: 980px) {
.sf-toolbar-block .sf-toolbar-icon a[href$="security"] .sf-toolbar-info-piece-additional {
display: inline-block;
}
}
@media screen and (max-width: 1180px) {
.sf-toolbar-block .sf-toolbar-info-piece-additional {
.sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional {
display: none;
}
}

View File

@ -3,10 +3,14 @@
{% block toolbar %}
{% if collector.counterrors %}
{% set icon %}
<img width="15" height="28" alt="Logs" style="border-width: 0; vertical-align: middle; margin-right: 5px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAcCAYAAABoMT8aAAAA4klEQVQ4y2P4//8/AyWYYXgYwOPp6Xnc3t7+P7EYpB6k7+zZs2ADNEjRjIwDAgKWgAywIUfz8+fPVzg7O/8AGeCATQEQnAfi/SAah/wcV1dXvAYUgORANA75ehcXl+/4DHAABRIe+ZrhbgAhTHsDiEgHBA0glA6GfSDiw5mZma+A+sphBlhVVFQ88vHx+Xfu3Ll7QP5haOjjwtuAuGHv3r3NIMNABqh8+/atsaur666vr+9XUlwSHx//AGQANxCbAnEWyGQicRMQ9wBxIQM0qjiBWAFqkB00/glhayBWHwb1AgB38EJsUtxtWwAAAABJRU5ErkJggg=="/>
<img width="15" height="28" alt="Logs" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAcCAYAAABoMT8aAAAA4klEQVQ4y2P4//8/AyWYYXgYwOPp6Xnc3t7+P7EYpB6k7+zZs2ADNEjRjIwDAgKWgAywIUfz8+fPVzg7O/8AGeCATQEQnAfi/SAah/wcV1dXvAYUgORANA75ehcXl+/4DHAABRIe+ZrhbgAhTHsDiEgHBA0glA6GfSDiw5mZma+A+sphBlhVVFQ88vHx+Xfu3Ll7QP5haOjjwtuAuGHv3r3NIMNABqh8+/atsaur666vr+9XUlwSHx//AGQANxCbAnEWyGQicRMQ9wBxIQM0qjiBWAFqkB00/glhayBWHwb1AgB38EJsUtxtWwAAAABJRU5ErkJggg=="/>
<span class="sf-toolbar-status sf-toolbar-status-yellow">{{ collector.counterrors }}</span>
{% endset %}
{% set text %}
<span>{{ collector.counterrors }}</span>
<div class="sf-toolbar-info-piece">
<b>Exception</b>
<span class="sf-toolbar-status sf-toolbar-status-yellow">{{ collector.counterrors }}</span>
</div>
{% endset %}
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
{% endif %}

View File

@ -161,11 +161,11 @@
margin-left: 0;
}
.sf-toolbar-block .sf-toolbar-info-piece-additional {
.sf-toolbar-block a .sf-toolbar-info-piece-additional {
display: inline-block;
}
.sf-toolbar-block .sf-toolbar-info-piece-additional:empty {
.sf-toolbar-block a .sf-toolbar-info-piece-additional:empty {
display: none;
}
@ -200,14 +200,30 @@
{% endif %}
/***** Media query *****/
@media screen and (max-width: 700px) {
.sf-toolbar-block .sf-toolbar-icon > * :first-child ~ * {
@media screen and (max-width: 780px) {
.sf-toolbar-block .sf-toolbar-icon > * > :first-child ~ * {
display: none;
}
.sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional {
display: none !important;
}
}
@media screen and (min-width: 880px) {
.sf-toolbar-block .sf-toolbar-icon a[href$="config"] .sf-toolbar-info-piece-additional {
display: inline-block;
}
}
@media screen and (min-width: 980px) {
.sf-toolbar-block .sf-toolbar-icon a[href$="security"] .sf-toolbar-info-piece-additional {
display: inline-block;
}
}
@media screen and (max-width: 1180px) {
.sf-toolbar-block .sf-toolbar-info-piece-additional {
.sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional {
display: none;
}
}