Skip to content

Commit

Permalink
add icon to symfony profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
IndraGunawan committed Oct 4, 2024
1 parent 9de87a7 commit ba91d46
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
13 changes: 13 additions & 0 deletions src/Symfony/Bundle/Resources/views/DataCollector/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 19 additions & 17 deletions src/Symfony/Bundle/Resources/views/DataCollector/metadata.html.twig
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{% extends '@WebProfiler/Profiler/layout.html.twig' %}

{% block toolbar %}
{% set text %}
{% if collector.metadatas|length == 0 %}
<div class="sf-toolbar-info-piece">
<b>AutoMapper</b>
<span>No Mapper</span>
</div>
{% endif %}
{% for metadata in collector.metadatas %}
<div class="sf-toolbar-info-piece">
<b>AutoMapper</b>
<span>{{ metadata.source }} to {{ metadata.target }}</span>
</div>
{% endfor %}
{% endset %}

{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
{% if collector.metadatas|length > 0 %}
{% set icon %}
{{ source('@AutoMapper/DataCollector/icon.svg') }}
<span class="sf-toolbar-value">{{ collector.metadatas|length }}</span>
{% endset %}

{% set text %}
{% for metadata in collector.metadatas %}
<div class="sf-toolbar-info-piece">
<b>AutoMapper</b>
<span>{{ metadata.source }} to {{ metadata.target }}</span>
</div>
{% endfor %}
{% endset %}

{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
{% endif %}
{% endblock %}

{% block menu %}
<span class="label{{ collector.metadatas|length > 0 ? '' : ' disabled' }}">
<span class="icon">{{ source('@AutoMapper/DataCollector/icon.svg') }}</span>
<strong>AutoMapper</strong>
{% if collector.metadatas|length > 0 %}
<span class="count">
Expand Down Expand Up @@ -185,4 +187,4 @@
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% endblock %}

0 comments on commit ba91d46

Please sign in to comment.