diff options
Diffstat (limited to 'debug_toolbar/panels/templates/panel.py')
| -rw-r--r-- | debug_toolbar/panels/templates/panel.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/debug_toolbar/panels/templates/panel.py b/debug_toolbar/panels/templates/panel.py index c745b83..ec0fc47 100644 --- a/debug_toolbar/panels/templates/panel.py +++ b/debug_toolbar/panels/templates/panel.py @@ -48,10 +48,6 @@ class TemplatesPanel(Panel): """ A panel that lists all templates used during processing of a response. """ - name = 'Templates' - template = 'debug_toolbar/panels/templates.html' - has_content = True - def __init__(self, *args, **kwargs): super(TemplatesPanel, self).__init__(*args, **kwargs) self.templates = [] @@ -113,19 +109,23 @@ class TemplatesPanel(Panel): kwargs['context'] = [force_text(item) for item in context_list] self.templates.append(kwargs) - @classmethod - def get_urls(cls): - return patterns('debug_toolbar.panels.templates.views', # noqa - url(r'^template_source/$', 'template_source', name='template_source'), - ) + # Implement the Panel API - def nav_title(self): - return _('Templates') + nav_title = _('Templates') + @property def title(self): num_templates = len(self.templates) return _('Templates (%(num_templates)s rendered)') % {'num_templates': num_templates} + template = 'debug_toolbar/panels/templates.html' + + @classmethod + def get_urls(cls): + return patterns('debug_toolbar.panels.templates.views', # noqa + url(r'^template_source/$', 'template_source', name='template_source'), + ) + def process_response(self, request, response): context_processors = dict( [ |
