소스 검색

[WebProfilerBundle] Add shortcuts to the panels in the toolbar

Victor Berchet 14 년 전
부모
커밋
5b39894efc

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
src/Symfony/Bundle/DoctrineBundle/Resources/views/Collector/db.html.twig


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Collector/mongodb.html.twig


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 4
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig


+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig

@@ -7,5 +7,5 @@
     {% set text %}
         {{ '%.0f'|format(collector.memory / 1024) }} KB
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with {'icon' : icon, 'text' : text, 'status' : collector.status } only %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false, 'status': collector.status } %}
 {% endblock %}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig


+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/timer.html.twig

@@ -7,5 +7,5 @@
     {% set text %}
         {{ '%.0f'|format(collector.time * 1000) }} ms
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with {'icon' : icon, 'text' : text, 'status' : collector.status } only %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false, 'status': collector.status } %}
 {% endblock %}

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig

@@ -24,7 +24,7 @@
     <span style="display: inline-block; min-height: 24px; width: 40px; float: right;">&nbsp;</span>
 
     {% for name, template in templates %}
-        {{ template.renderblock('toolbar', { 'collector': profiler.get(name), 'profiler_url': profiler_url }) }}
+        {{ template.renderblock('toolbar', { 'collector': profiler.get(name), 'profiler_url': profiler_url, 'token': profiler.token, 'name': name }) }}
     {% endfor %}
 
     {% if 'normal' != position %}

+ 18 - 10
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig

@@ -1,12 +1,20 @@
-{% set style = '' %}
-{% if status is defined %}
-    {% if 'error' == status %}
-        {% set style = 'background-color: #f66;' %}
-    {% elseif 'warning' == status %}
-        {% set style = 'background-color: #fa2;' %}
-    {% endif %}
+{% if link %}
+    {% set icon %}
+        {% if 'config' == name %}
+            <a href="{{ path('_profiler', { 'token': token}) }}">{{ icon }}</a>
+        {% else %}
+            <a href="{{ path('_profiler_panel', { 'token': token, 'panel': name }) }}">{{ icon }}</a>
+        {% endif %}
+    {% endset %}
+{% endif %}
+{% if 'info' == status|default('info') %}
+    {% set style = '' %}
+{% elseif 'warning' == status %}
+    {% set style = 'background-color: #fa2;' %}
+{% else %}
+    {% set style = 'background-color: #f66;' %}
 {% endif %}
 <span style="{{ style }}white-space:nowrap; color:#2f2f2f; display:inline-block; min-height:24px; border-right:1px solid #cdcdcd; padding:5px 10px 5px 6px; ">
-     {% if icon is defined %}{{ icon }}{% endif %}
-     {% if text is defined %}{{ text }}{% endif %}
-</span>
+     {{ icon|default('') }}
+     {{ text|default('') }}
+</span>