From 76a9d548f4f09cb1c54b0bc467a9a61c6d91fd96 Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Tue, 9 Sep 2008 14:48:36 -0700 Subject: Adding a `has_content` boolean to panels to avoid issues with checking if content exists and displaying it in the templates. --- debug_toolbar/templates/debug_toolbar/base.html | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'debug_toolbar/templates') diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index 7488b92..637e04d 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -41,7 +41,7 @@
  • DEBUG
  • {% for panel in panels %}
  • - {% if panel.content %} + {% if panel.has_content %} {{ panel.title }} {% else %} {{ panel.title }} @@ -51,15 +51,13 @@ {% for panel in panels %} - {% with panel.content as content %} - {% if content %} -
    -
    - Close -
    - {{ content|safe }} + {% if panel.has_content %} +
    +
    + Close
    - {% endif %} - {% endwith %} + {{ panel.content|safe }} +
    + {% endif %} {% endfor %}
    -- cgit v1.2.3