aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/templates
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-09 19:07:38 +0100
committerAymeric Augustin2013-11-10 10:39:42 +0100
commit2816c6fa2a1613e5eeb7967cde0793019ce62feb (patch)
tree2aaff3c512dd78f9686a81f626cba9702a3bd157 /debug_toolbar/templates
parent631bbd18c10f572e31ef30f4dc78df942beeffd4 (diff)
downloaddjango-debug-toolbar-2816c6fa2a1613e5eeb7967cde0793019ce62feb.tar.bz2
Load the content of panels dynamically.
This should drastically reduce the overhead of the browser toolbar when a page has a complex template structure or many SQL queries. This change is backwards-incompatible for third-party panels because it changes the signature of __init__. The JavaScript could probably be improved; I'm outside my comfort zone.
Diffstat (limited to 'debug_toolbar/templates')
-rw-r--r--debug_toolbar/templates/debug_toolbar/base.html13
1 files changed, 7 insertions, 6 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html
index e214044..d5a356c 100644
--- a/debug_toolbar/templates/debug_toolbar/base.html
+++ b/debug_toolbar/templates/debug_toolbar/base.html
@@ -8,7 +8,9 @@ if(!window.jQuery) document.write('<scr'+'ipt src="{{ STATIC_URL }}debug_toolbar
//]]></script>
<script src="{{ STATIC_URL }}debug_toolbar/js/jquery.cookie.js"></script>
<script src="{{ STATIC_URL }}debug_toolbar/js/toolbar.js"></script>
-<div id="djDebug" style="display:none;" dir="ltr" {{ TOOLBAR_ROOT_TAG_ATTRS|safe }}>
+<div id="djDebug" style="display:none;" dir="ltr"
+ data-toolbar-id="{{ toolbar_id }}" data-render-panel-url="/__debug__/render_panel/"
+ {{ TOOLBAR_ROOT_TAG_ATTRS|safe }}>
<div style="display:none;" id="djDebugToolbar">
<ul id="djDebugPanelList">
{% if panels %}
@@ -22,7 +24,7 @@ if(!window.jQuery) document.write('<scr'+'ipt src="{{ STATIC_URL }}debug_toolbar
{% if panel.has_content and panel.enabled %}
<a href="{{ panel.url|default:"#" }}" title="{{ panel.title }}" class="{{ panel.dom_id }}">
{% else %}
- <div class="contentless{% if panel.disabled %} disabled{% endif %}">
+ <div class="contentless{% if panel.disabled %} disabled{% endif %}">
{% endif %}
{{ panel.nav_title }}
{% if panel.enabled %}
@@ -33,7 +35,7 @@ if(!window.jQuery) document.write('<scr'+'ipt src="{{ STATIC_URL }}debug_toolbar
{% if panel.has_content and panel.enabled %}
</a>
{% else %}
- </div>
+ </div>
{% endif %}
</li>
{% endfor %}
@@ -50,9 +52,8 @@ if(!window.jQuery) document.write('<scr'+'ipt src="{{ STATIC_URL }}debug_toolbar
<h3>{{ panel.title|safe }}</h3>
</div>
<div class="djDebugPanelContent">
- <div class="scroll">
- {{ panel.content|safe }}
- </div>
+ <div class="scroll">
+ </div>
</div>
</div>
{% endif %}