Skip to content

Commit 3946812

Browse files
committed
feature symfony#23680 [Webprofiler] Added blocks that allows extension of the profiler page. (Nyholm)
This PR was squashed before being merged into the 3.4 branch (closes symfony#23680). Discussion ---------- [Webprofiler] Added blocks that allows extension of the profiler page. | Q | A | ------------- | --- | Branch? | 3.4 (to be retargeted) | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Im not sure if we allow this but I thought I would try to submit this PR. The [TranslationBundle](https://github.com/php-translation/symfony-bundle) is extending the Symfony profiler page for translation. It would be great if it didn't have to replace all the contents but just replace some smaller blocks. Commits ------- ffd25fb [Webprofiler] Added blocks that allows extension of the profiler page.
2 parents cf1ff43 + ffd25fb commit 3946812

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282

8383
<h2>Translation Messages</h2>
8484

85+
{% block messages %}
86+
8587
{# sort translation messages in groups #}
8688
{% set messages_defined, messages_missing, messages_fallback = [], [], [] %}
8789
{% for message in collector.messages %}
@@ -108,7 +110,9 @@
108110
<p>None of the used translation messages are defined for the given locale.</p>
109111
</div>
110112
{% else %}
111-
{{ helper.render_table(messages_defined) }}
113+
{% block defined_messages %}
114+
{{ helper.render_table(messages_defined) }}
115+
{% endblock %}
112116
{% endif %}
113117
</div>
114118
</div>
@@ -127,7 +131,9 @@
127131
<p>No fallback translation messages were used.</p>
128132
</div>
129133
{% else %}
130-
{{ helper.render_table(messages_fallback) }}
134+
{% block fallback_messages %}
135+
{{ helper.render_table(messages_fallback) }}
136+
{% endblock %}
131137
{% endif %}
132138
</div>
133139
</div>
@@ -147,11 +153,16 @@
147153
<p>There are no messages of this category.</p>
148154
</div>
149155
{% else %}
150-
{{ helper.render_table(messages_missing) }}
156+
{% block missing_messages %}
157+
{{ helper.render_table(messages_missing) }}
158+
{% endblock %}
151159
{% endif %}
152160
</div>
153161
</div>
154162
</div>
163+
164+
{% endblock messages %}
165+
155166
{% endblock %}
156167

157168
{% macro render_table(messages) %}

0 commit comments

Comments
 (0)