Skip to content

Commit db93fb8

Browse files
committed
Merge pull request #1 from BertrandBordage/master
Fixes a localization issue and orders data more naturally
2 parents 06af553 + 96175e1 commit db93fb8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

template_profiler_panel/panels/template.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,5 @@ def process_response(self, request, response):
140140
self.total = len(self.templates)
141141

142142
self.record_stats(
143-
{'templates': self.templates, 'summary': dict(summary)})
143+
{'templates': sorted(self.templates, key=lambda d: d['start']),
144+
'summary': sorted(summary.items(), key=lambda t: -t[1])})

template_profiler_panel/templates/template_profiler_panel/template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ <h4>{{ templates|length }} {% trans 'calls to Template.render()' %}</h4>
2525
<td>{{ template.name }}</td>
2626
<td class="timeline">
2727
<div class="djDebugTimeline">
28-
<div class="djDebugLineChart" style="left: {{ template.offset_p }}%;">
29-
<strong title="Start {{ template.start }}" style="min-width: 1px; width: {{ template.rel_duration_p }}%; background-color: {{ template.color.bg }};">&nbsp;</strong>
28+
<div class="djDebugLineChart" style="left: {{ template.offset_p|stringformat:'f' }}%;">
29+
<strong title="Start {{ template.start }}" style="min-width: 1px; width: {{ template.rel_duration_p|stringformat:'f' }}%; background-color: {{ template.color.bg }};">&nbsp;</strong>
3030
</div>
3131
</div>
3232
</td>
@@ -46,7 +46,7 @@ <h4>{% trans 'Summary' %}</h4>
4646
</tr>
4747
</thead>
4848
<tbody>
49-
{% for k, v in summary.items %}
49+
{% for k, v in summary %}
5050
<tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
5151
<td>{{ k }}</td>
5252
<td>{{ v|floatformat }}</td>

0 commit comments

Comments
 (0)