Skip to content

Commit 049fdfe

Browse files
committed
Add a way to group toolbar info pieces
1 parent 23b8a56 commit 049fdfe

File tree

2 files changed

+76
-61
lines changed

2 files changed

+76
-61
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig

Lines changed: 66 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -31,81 +31,86 @@
3131
{% endset %}
3232

3333
{% set text %}
34-
{% if collector.applicationname %}
34+
<div class="sf-toolbar-info-group">
35+
{% if collector.applicationname %}
36+
<div class="sf-toolbar-info-piece">
37+
<b>{{ collector.applicationname }}</b>
38+
<span>{{ collector.applicationversion }}</span>
39+
</div>
40+
{% endif %}
41+
3542
<div class="sf-toolbar-info-piece">
36-
<b>{{ collector.applicationname }}</b>
37-
<span>{{ collector.applicationversion }}</span>
43+
<b>Profiler token</b>
44+
<span>
45+
{% if profiler_url %}
46+
<a href="{{ profiler_url }}">{{ collector.token }}</a>
47+
{% else %}
48+
{{ collector.token }}
49+
{% endif %}
50+
</span>
3851
</div>
39-
{% endif %}
4052

41-
<div class="sf-toolbar-info-piece">
42-
<b>Profiler token</b>
43-
<span>
44-
{% if profiler_url %}
45-
<a href="{{ profiler_url }}">{{ collector.token }}</a>
46-
{% else %}
47-
{{ collector.token }}
48-
{% endif %}
49-
</span>
53+
{% if 'n/a' != collector.appname %}
54+
<div class="sf-toolbar-info-piece">
55+
<b>Kernel name</b>
56+
<span>{{ collector.appname }}</span>
57+
</div>
58+
{% endif %}
59+
60+
{% if 'n/a' != collector.env %}
61+
<div class="sf-toolbar-info-piece">
62+
<b>Environment</b>
63+
<span>{{ collector.env }}</span>
64+
</div>
65+
{% endif %}
66+
67+
{% if 'n/a' != collector.debug %}
68+
<div class="sf-toolbar-info-piece">
69+
<b>Debug</b>
70+
<span class="{{ debug_status_class }}">{{ collector.debug ? 'enabled' : 'disabled' }}</span>
71+
</div>
72+
{% endif %}
5073
</div>
5174

52-
{% if 'n/a' != collector.appname %}
53-
<div class="sf-toolbar-info-piece">
54-
<b>Kernel name</b>
55-
<span>{{ collector.appname }}</span>
75+
<div class="sf-toolbar-info-group">
76+
<div class="sf-toolbar-info-piece sf-toolbar-info-php">
77+
<b>PHP version</b>
78+
<span>
79+
{{ collector.phpversion }}
80+
&nbsp; <a href="{{ path('_profiler_phpinfo') }}">View phpinfo()</a>
81+
</span>
5682
</div>
57-
{% endif %}
5883

59-
{% if 'n/a' != collector.env %}
60-
<div class="sf-toolbar-info-piece">
61-
<b>Environment</b>
62-
<span>{{ collector.env }}</span>
84+
<div class="sf-toolbar-info-piece sf-toolbar-info-php-ext">
85+
<b>PHP Extensions</b>
86+
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.hasxdebug ? 'green' : 'red' }}">xdebug</span>
87+
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.hasaccelerator ? 'green' : 'red' }}">accel</span>
6388
</div>
64-
{% endif %}
6589

66-
{% if 'n/a' != collector.debug %}
6790
<div class="sf-toolbar-info-piece">
68-
<b>Debug</b>
69-
<span class="{{ debug_status_class }}">{{ collector.debug ? 'enabled' : 'disabled' }}</span>
91+
<b>PHP SAPI</b>
92+
<span>{{ collector.sapiName }}</span>
7093
</div>
71-
{% endif %}
72-
73-
<div class="sf-toolbar-info-piece sf-toolbar-info-php">
74-
<b>PHP version</b>
75-
<span>
76-
{{ collector.phpversion }}
77-
&nbsp; <a href="{{ path('_profiler_phpinfo') }}">View phpinfo()</a>
78-
</span>
7994
</div>
8095

81-
<div class="sf-toolbar-info-piece sf-toolbar-info-php-ext">
82-
<b>PHP Extensions</b>
83-
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.hasxdebug ? 'green' : 'red' }}">xdebug</span>
84-
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.hasaccelerator ? 'green' : 'red' }}">accel</span>
85-
</div>
86-
87-
<div class="sf-toolbar-info-piece">
88-
<b>PHP SAPI</b>
89-
<span>{{ collector.sapiName }}</span>
96+
<div class="sf-toolbar-info-group">
97+
{% if collector.symfonyversion is defined %}
98+
<div class="sf-toolbar-info-piece">
99+
<b>Resources</b>
100+
<span>
101+
{% if 'Silex' == collector.applicationname %}
102+
<a href="http://silex.sensiolabs.org/documentation" rel="help">
103+
Read Silex Docs
104+
</a>
105+
{% else %}
106+
<a href="https://symfony.com/doc/{{ collector.symfonyversion }}/index.html" rel="help">
107+
Read Symfony {{ collector.symfonyversion }} Docs
108+
</a>
109+
{% endif %}
110+
</span>
111+
</div>
112+
{% endif %}
90113
</div>
91-
92-
93-
{% if collector.symfonyversion is defined %}
94-
<div class="sf-toolbar-info-piece">
95-
<b>Resources</b>
96-
<span>
97-
{% if 'Silex' == collector.applicationname %}
98-
<a href="http://silex.sensiolabs.org/documentation" rel="help">
99-
Read Silex Docs
100-
</a>
101-
{% else %}
102-
<a href="https://symfony.com/doc/{{ collector.symfonyversion }}/index.html" rel="help">
103-
Read Symfony {{ collector.symfonyversion }} Docs
104-
</a>
105-
{% endif %}
106-
</span>
107-
</div>
108-
{% endif %}
109114
{% endset %}
110115

111116
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: true, name: 'config', status: block_status, additional_classes: 'sf-toolbar-block-right' }) }}

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@
104104
.sf-toolbar-block .sf-toolbar-info-piece-additional-detail {
105105
display: none;
106106
}
107+
.sf-toolbar-block .sf-toolbar-info-group {
108+
margin-bottom: 4px;
109+
padding-bottom: 2px;
110+
border-bottom: 1px solid #333333;
111+
}
112+
.sf-toolbar-block .sf-toolbar-info-group:last-child {
113+
margin-bottom: 0;
114+
padding-bottom: 0;
115+
border-bottom: none;
116+
}
107117

108118
.sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status {
109119
padding: 2px 5px;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy