-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Redesigned the web debug toolbar #15160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c2fcadc
b6f413f
4eee931
64b8f38
2735346
51a79c9
ef53850
fac5391
acee052
af3dcb2
041d424
77d522a
c0bee9b
2bccdd4
b25b6dd
9d89841
e14fb6d
7c35d25
23dc884
e28f895
cd53210
0dfcb60
9e38a8a
f087ac0
3ab2e20
9b585b9
e94a6a0
002dda5
a0e03f6
1847285
ebb44e4
972a92e
084cca6
7ec1cd4
2fb3319
5070861
22f6bc5
9df0f8b
597637e
7d92cb8
b438ee5
b3ad83d
f237ff1
5a571b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,39 +2,47 @@ | |
|
||
{% block toolbar %} | ||
{% if collector.tokenClass %} | ||
{% 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' %} | ||
{% set is_authenticated = collector.enabled and collector.authenticated %} | ||
{% set color_code = is_authenticated ? '' : 'yellow' %} | ||
{% else %} | ||
{% set color_code = collector.enabled ? 'red' : 'black' %} | ||
{% set color_code = collector.enabled ? 'red' : '' %} | ||
{% endif %} | ||
|
||
{% set icon %} | ||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" height="24" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> | ||
<path fill="#AAAAAA" d="M21,20.4V22H3v-1.6c0-3.7,2.4-6.9,5.8-8c-1.7-1.1-2.9-3-2.9-5.2c0-3.4,2.7-6.1,6.1-6.1s6.1,2.7,6.1,6.1c0,2.2-1.2,4.1-2.9,5.2C18.6,13.5,21,16.7,21,20.4z"/> | ||
</svg> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WebProfilerBundle is putting SVG icons in separate templates. What about doing the same in SecurityBundle and DebugBundle to be consistent ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer to not do that. In the other icons make sense because we have a folder with lots of icons. In this case it woul be only 1 icon in 1 folder. I don't like that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There would be an advantage if we rename icon files to be named and icons are also used in the left menu of the profiler. In older versions of Symfony, we are duplicating the inline icon in both places. Having it in an include file allows to reuse the icon without duplication. |
||
<span class="sf-toolbar-value">{{ collector.user|default('n/a') }}</span> | ||
{% endset %} | ||
|
||
{% set text %} | ||
{% if collector.tokenClass %} | ||
<div class="sf-toolbar-info-piece"> | ||
<b>Logged in as</b> | ||
<span class="sf-toolbar-status sf-toolbar-status-{{ color_code }}">{{ collector.user }}</span> | ||
<span>{{ 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> | ||
<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"> | ||
<b>Token class</b> | ||
{{ collector.tokenClass|abbr_class }} | ||
<span>{{ collector.tokenClass|abbr_class }}</span> | ||
</div> | ||
{% endif %} | ||
{% elseif collector.enabled %} | ||
You are not authenticated. | ||
<div class="sf-toolbar-info-piece"> | ||
<span>You are not authenticated.</span> | ||
</div> | ||
{% else %} | ||
The security is disabled. | ||
<div class="sf-toolbar-info-piece"> | ||
<span>The security is disabled.</span> | ||
</div> | ||
{% 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="#3F3F3F" 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="#3F3F3F" 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-0.4-0.1-0.7-0.3-0.9C18.5 10.8 18.2 10.7 18 10.7z"/><path fill="#3F3F3F" d="M22.2 6H1.8C1.3 6 1 6.3 1 6.8v14.4c0 0.4 0.3 0.8 0.8 0.8h3.8v-0.8c-0.4 0-0.8-0.3-0.8-0.8 c0-0.4 0.3-0.8 0.8-0.8h1.5c0.4 0 0.8 0.3 0.8 0.8c0 0.4-0.3 0.8-0.8 0.8v0.8h9.9v-0.8c-0.4 0-0.8-0.3-0.8-0.8 c0-0.4 0.3-0.8 0.8-0.8h1.5c0.4 0 0.8 0.3 0.8 0.8c0 0.4-0.3 0.8-0.8 0.8v0.8h3.8c0.4 0 0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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-status sf-toolbar-status-{{ color_code }}">{{ collector.user }}</span> | ||
{% endset %} | ||
{% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} | ||
|
||
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: color_code }) }} | ||
{% endblock %} | ||
|
||
{% block menu %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz I would even suggest leaving holes between the priorities used in Symfony to make it easier to inject things between them