aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--debug_toolbar/locale/de/LC_MESSAGES/django.po168
-rw-r--r--debug_toolbar/locale/es/LC_MESSAGES/django.mobin0 -> 1645 bytes
-rw-r--r--debug_toolbar/locale/es/LC_MESSAGES/django.po190
-rw-r--r--debug_toolbar/locale/he/LC_MESSAGES/django.mobin0 -> 825 bytes
-rw-r--r--debug_toolbar/locale/he/LC_MESSAGES/django.po167
-rw-r--r--debug_toolbar/media/debug_toolbar/back.pngbin0 -> 1039 bytes
-rw-r--r--debug_toolbar/media/debug_toolbar/back_hover.pngbin0 -> 1030 bytes
-rw-r--r--debug_toolbar/media/debug_toolbar/close.pngbin0 -> 1045 bytes
-rw-r--r--debug_toolbar/media/debug_toolbar/close_hover.pngbin0 -> 1155 bytes
-rw-r--r--debug_toolbar/media/debug_toolbar/djdt_vertical.pngbin0 -> 1349 bytes
-rw-r--r--debug_toolbar/media/debug_toolbar/indicator.pngbin0 -> 607 bytes
-rw-r--r--debug_toolbar/media/debug_toolbar/panel_bg.pngbin0 -> 110 bytes
-rw-r--r--debug_toolbar/media/debug_toolbar/toolbar.css447
-rw-r--r--debug_toolbar/media/debug_toolbar/toolbar.js65
-rw-r--r--debug_toolbar/media/debug_toolbar/toolbar.min.css2
-rw-r--r--debug_toolbar/media/debug_toolbar/toolbar.min.js2
-rw-r--r--debug_toolbar/panels/__init__.py9
-rw-r--r--debug_toolbar/panels/cache.py5
-rw-r--r--debug_toolbar/panels/headers.py3
-rw-r--r--debug_toolbar/panels/logger.py9
-rw-r--r--debug_toolbar/panels/request_vars.py5
-rw-r--r--debug_toolbar/panels/settings_vars.py7
-rw-r--r--debug_toolbar/panels/signals.py4
-rw-r--r--debug_toolbar/panels/sql.py81
-rw-r--r--debug_toolbar/panels/template.py4
-rw-r--r--debug_toolbar/panels/timer.py14
-rw-r--r--debug_toolbar/panels/version.py10
-rw-r--r--debug_toolbar/templates/debug_toolbar/base.html37
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/cache.html20
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/headers.html6
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/logger.html12
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/request_vars.html38
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/settings_vars.html6
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/signals.html34
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql.html27
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql_explain.html53
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql_profile.html62
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql_select.html61
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/template_source.html17
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/templates.html21
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/timer.html6
-rw-r--r--debug_toolbar/templates/debug_toolbar/redirect.html7
-rw-r--r--debug_toolbar/views.py36
44 files changed, 1261 insertions, 377 deletions
diff --git a/.gitignore b/.gitignore
index 2f78cf5..d404d9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*.pyc
-
+*.DS_Store
+*~
diff --git a/debug_toolbar/locale/de/LC_MESSAGES/django.po b/debug_toolbar/locale/de/LC_MESSAGES/django.po
new file mode 100644
index 0000000..0d661a7
--- /dev/null
+++ b/debug_toolbar/locale/de/LC_MESSAGES/django.po
@@ -0,0 +1,168 @@
+# Django Debug Toolbar auf Deutsch.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Jannis Leidel, 2009.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-08-21 15:26-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: templates/debug_toolbar/base.html:24
+msgid "Hide"
+msgstr "Verbergen"
+
+#: templates/debug_toolbar/base.html:56
+msgid "Close"
+msgstr "Schließen"
+
+#: templates/debug_toolbar/panels/cache.html:14
+msgid "Total Calls"
+msgstr "Aufrufe gesamt"
+
+#: templates/debug_toolbar/panels/cache.html:16
+msgid "Total Time"
+msgstr "Zeit gesamt"
+
+#: templates/debug_toolbar/panels/cache.html:18
+msgid "Hits"
+msgstr "Aufrufe"
+
+#: templates/debug_toolbar/panels/cache.html:20
+msgid "Misses"
+msgstr ""
+
+#: templates/debug_toolbar/panels/cache.html:35
+msgid "Breakdown"
+msgstr ""
+
+#: templates/debug_toolbar/panels/cache.html:39
+#: templates/debug_toolbar/panels/logger.html:8
+#: templates/debug_toolbar/panels/sql.html:6
+#: templates/debug_toolbar/panels/sql_explain.html:7
+#: templates/debug_toolbar/panels/sql_profile.html:7
+#: templates/debug_toolbar/panels/sql_select.html:7
+msgid "Time"
+msgstr "Zeit"
+
+#: templates/debug_toolbar/panels/cache.html:40
+msgid "Type"
+msgstr "Typ"
+
+#: templates/debug_toolbar/panels/cache.html:41
+msgid "Parameters"
+msgstr "Parameter"
+
+#: templates/debug_toolbar/panels/cache.html:42
+msgid "Function"
+msgstr "Funktion"
+
+#: templates/debug_toolbar/panels/headers.html:6
+msgid "Key"
+msgstr "Schlüssel"
+
+#: templates/debug_toolbar/panels/headers.html:7
+#: templates/debug_toolbar/panels/request_vars.html:13
+#: templates/debug_toolbar/panels/request_vars.html:41
+#: templates/debug_toolbar/panels/request_vars.html:65
+#: templates/debug_toolbar/panels/request_vars.html:89
+#: templates/debug_toolbar/panels/settings_vars.html:7
+#: templates/debug_toolbar/panels/timer.html:11
+msgid "Value"
+msgstr "Wert"
+
+#: templates/debug_toolbar/panels/logger.html:7
+msgid "Level"
+msgstr "Niveau"
+
+#: templates/debug_toolbar/panels/logger.html:9
+msgid "Message"
+msgstr "Nachricht"
+
+#: templates/debug_toolbar/panels/logger.html:10
+msgid "Location"
+msgstr "Ort"
+
+#: templates/debug_toolbar/panels/logger.html:25
+msgid "No messages logged"
+msgstr "Keine Nachricht gespeichert"
+
+#: templates/debug_toolbar/panels/request_vars.html:26
+msgid "None"
+msgstr "Nichts"
+
+#: templates/debug_toolbar/panels/request_vars.html:54
+msgid "No SESSION data"
+msgstr "Keine SESSION-Daten"
+
+#: templates/debug_toolbar/panels/request_vars.html:78
+msgid "No GET data"
+msgstr "Keine GET-Daten"
+
+#: templates/debug_toolbar/panels/request_vars.html:102
+msgid "No POST data"
+msgstr "Keine POST-Daten"
+
+#: templates/debug_toolbar/panels/settings_vars.html:6
+msgid "Setting"
+msgstr "Einstellung"
+
+#: templates/debug_toolbar/panels/signals.html:6
+msgid "Signal"
+msgstr "Signal"
+
+#: templates/debug_toolbar/panels/sql.html:7
+msgid "Action"
+msgstr "Aktion"
+
+#: templates/debug_toolbar/panels/sql.html:31
+msgid "Line"
+msgstr "Zeile"
+
+#: templates/debug_toolbar/panels/sql.html:32
+msgid "Method"
+msgstr "Methode"
+
+#: templates/debug_toolbar/panels/sql.html:33
+msgid "File"
+msgstr "Datei"
+
+#: templates/debug_toolbar/panels/sql_explain.html:2
+#: templates/debug_toolbar/panels/sql_profile.html:2
+#: templates/debug_toolbar/panels/sql_select.html:2
+#: templates/debug_toolbar/panels/template_source.html:2
+msgid "Back"
+msgstr "Zurück"
+
+#: templates/debug_toolbar/panels/sql_explain.html:5
+#: templates/debug_toolbar/panels/sql_profile.html:5
+#: templates/debug_toolbar/panels/sql_select.html:5
+msgid "Executed SQL"
+msgstr "Ausgeführtes SQL"
+
+#: templates/debug_toolbar/panels/sql_select.html:30
+msgid "Empty set"
+msgstr "Leeres Set"
+
+#: templates/debug_toolbar/panels/templates.html:14
+msgid "Template"
+msgstr "Template"
+
+#: templates/debug_toolbar/panels/timer.html:10
+msgid "Resource"
+msgstr "Ressource"
+
+#: templates/debug_toolbar/panels/request_vars.html:12
+#: templates/debug_toolbar/panels/request_vars.html:40
+#: templates/debug_toolbar/panels/request_vars.html:64
+#: templates/debug_toolbar/panels/request_vars.html:88
+msgid "Variable"
+msgstr "Variable"
diff --git a/debug_toolbar/locale/es/LC_MESSAGES/django.mo b/debug_toolbar/locale/es/LC_MESSAGES/django.mo
new file mode 100644
index 0000000..98e8c4d
--- /dev/null
+++ b/debug_toolbar/locale/es/LC_MESSAGES/django.mo
Binary files differ
diff --git a/debug_toolbar/locale/es/LC_MESSAGES/django.po b/debug_toolbar/locale/es/LC_MESSAGES/django.po
new file mode 100644
index 0000000..fe7e60b
--- /dev/null
+++ b/debug_toolbar/locale/es/LC_MESSAGES/django.po
@@ -0,0 +1,190 @@
+# Django Debug Toolbar en Español.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Percy Pérez-Pinedo <percyp3@gmail.com>, 2009.
+#
+# Caracteres especiales: á, é, í, ó, ú, ñ,
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-08-21 15:26-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: panels/logger.py:56
+msgid "Logging"
+msgstr "Registros"
+
+#: panels/settings_vars.py:16
+msgid "Settings"
+msgstr "Configuraciones"
+
+#: panels/signals.py:39
+msgid "Signals"
+msgstr "Señales"
+
+#: panels/template.py:46
+msgid "Templates"
+msgstr "Plantillas"
+
+#: panels/timer.py:35 templates/debug_toolbar/panels/cache.html:39
+#: templates/debug_toolbar/panels/logger.html:8
+#: templates/debug_toolbar/panels/sql.html:6
+#: templates/debug_toolbar/panels/sql_explain.html:7
+#: templates/debug_toolbar/panels/sql_profile.html:7
+#: templates/debug_toolbar/panels/sql_select.html:7
+msgid "Time"
+msgstr "Tiempo"
+
+#: panels/version.py:12
+msgid "Django Version"
+msgstr "Versión Django"
+
+#: templates/debug_toolbar/base.html:24
+msgid "Hide"
+msgstr "Ocultar"
+
+#: templates/debug_toolbar/base.html:56
+msgid "Close"
+msgstr "Cerrar"
+
+#: templates/debug_toolbar/panels/cache.html:14
+msgid "Total Calls"
+msgstr "Total Llamadas"
+
+#: templates/debug_toolbar/panels/cache.html:16
+msgid "Total Time"
+msgstr "Tiempo Total"
+
+#: templates/debug_toolbar/panels/cache.html:40
+msgid "Type"
+msgstr "Tipo"
+
+#: templates/debug_toolbar/panels/cache.html:41
+msgid "Parameters"
+msgstr "Parámetros"
+
+#: templates/debug_toolbar/panels/cache.html:42
+msgid "Function"
+msgstr "Función"
+
+#: templates/debug_toolbar/panels/headers.html:6
+msgid "Key"
+msgstr "Llave"
+
+#: templates/debug_toolbar/panels/headers.html:7
+#: templates/debug_toolbar/panels/request_vars.html:13
+#: templates/debug_toolbar/panels/request_vars.html:41
+#: templates/debug_toolbar/panels/request_vars.html:65
+#: templates/debug_toolbar/panels/request_vars.html:89
+#: templates/debug_toolbar/panels/settings_vars.html:7
+#: templates/debug_toolbar/panels/timer.html:11
+msgid "Value"
+msgstr "Valor"
+
+#: templates/debug_toolbar/panels/logger.html:7
+msgid "Level"
+msgstr "Nivel"
+
+#: templates/debug_toolbar/panels/logger.html:9
+msgid "Message"
+msgstr "Mensaje"
+
+#: templates/debug_toolbar/panels/request_vars.html:26
+msgid "None"
+msgstr "Ninguno"
+
+#: templates/debug_toolbar/panels/request_vars.html:54
+msgid "No SESSION data"
+msgstr "No SESSION datos"
+
+#: templates/debug_toolbar/panels/request_vars.html:78
+msgid "No GET data"
+msgstr "No GET datos"
+
+#: templates/debug_toolbar/panels/request_vars.html:102
+msgid "No POST data"
+msgstr "No POST datos"
+
+#: templates/debug_toolbar/panels/settings_vars.html:6
+msgid "Setting"
+msgstr "Configuración"
+
+#: templates/debug_toolbar/panels/signals.html:6
+msgid "Signal"
+msgstr "Señal"
+
+#: templates/debug_toolbar/panels/sql.html:7
+msgid "Action"
+msgstr "Acción"
+
+#: templates/debug_toolbar/panels/sql.html:31
+msgid "Line"
+msgstr "Línea"
+
+#: templates/debug_toolbar/panels/sql.html:32
+msgid "Method"
+msgstr "Método"
+
+#: templates/debug_toolbar/panels/sql.html:33
+msgid "File"
+msgstr "Archivo"
+
+#: templates/debug_toolbar/panels/sql_explain.html:2
+#: templates/debug_toolbar/panels/sql_profile.html:2
+#: templates/debug_toolbar/panels/sql_select.html:2
+#: templates/debug_toolbar/panels/template_source.html:2
+msgid "Back"
+msgstr "Regresar"
+
+#: templates/debug_toolbar/panels/sql_explain.html:5
+#: templates/debug_toolbar/panels/sql_profile.html:5
+#: templates/debug_toolbar/panels/sql_select.html:5
+msgid "Executed SQL"
+msgstr "SQL Ejecutado"
+
+#: templates/debug_toolbar/panels/sql_select.html:30
+msgid "Empty set"
+msgstr "Set Vacío"
+
+#: templates/debug_toolbar/panels/templates.html:15
+msgid "Template"
+msgstr "Plantilla"
+
+#: templates/debug_toolbar/panels/timer.html:10
+msgid "Resource"
+msgstr "Recurso"
+
+#: templates/debug_toolbar/panels/cache.html:18
+msgid "Hits"
+msgstr "Visitas"
+
+#: templates/debug_toolbar/panels/cache.html:35
+msgid "Breakdown"
+msgstr ""
+
+#: templates/debug_toolbar/panels/cache.html:20
+msgid "Misses"
+msgstr ""
+
+#: templates/debug_toolbar/panels/request_vars.html:12
+#: templates/debug_toolbar/panels/request_vars.html:40
+#: templates/debug_toolbar/panels/request_vars.html:64
+#: templates/debug_toolbar/panels/request_vars.html:88
+#, fuzzy
+msgid "Variable"
+msgstr "Variable"
+
+#: templates/debug_toolbar/panels/logger.html:25
+msgid "No messages logged"
+msgstr "No hay mensajes registrados"
+
+#: templates/debug_toolbar/panels/logger.html:10
+msgid "Location"
+msgstr ""
diff --git a/debug_toolbar/locale/he/LC_MESSAGES/django.mo b/debug_toolbar/locale/he/LC_MESSAGES/django.mo
new file mode 100644
index 0000000..e94f840
--- /dev/null
+++ b/debug_toolbar/locale/he/LC_MESSAGES/django.mo
Binary files differ
diff --git a/debug_toolbar/locale/he/LC_MESSAGES/django.po b/debug_toolbar/locale/he/LC_MESSAGES/django.po
new file mode 100644
index 0000000..7365992
--- /dev/null
+++ b/debug_toolbar/locale/he/LC_MESSAGES/django.po
@@ -0,0 +1,167 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-08-24 22:59-0500\n"
+"PO-Revision-Date: 2009-08-24 23:08-0600\n"
+"Last-Translator: Alex <alex.gaynor@gmail.com>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: templates/debug_toolbar/base.html:24
+msgid "Hide"
+msgstr "הסתיר"
+
+#: templates/debug_toolbar/base.html:55
+msgid "Close"
+msgstr "סגור"
+
+#: templates/debug_toolbar/panels/cache.html:14
+msgid "Total Calls"
+msgstr ""
+
+#: templates/debug_toolbar/panels/cache.html:16
+msgid "Total Time"
+msgstr "זמן"
+
+#: templates/debug_toolbar/panels/cache.html:20
+msgid "Misses"
+msgstr ""
+
+#: templates/debug_toolbar/panels/cache.html:35
+msgid "Breakdown"
+msgstr ""
+
+#: templates/debug_toolbar/panels/cache.html:39
+#: templates/debug_toolbar/panels/logger.html:8
+#: templates/debug_toolbar/panels/sql.html:6
+#: templates/debug_toolbar/panels/sql_explain.html:10
+#: templates/debug_toolbar/panels/sql_profile.html:10
+#: templates/debug_toolbar/panels/sql_select.html:10
+msgid "Time"
+msgstr "זמן"
+
+#: templates/debug_toolbar/panels/cache.html:40
+msgid "Type"
+msgstr "סוג"
+
+#: templates/debug_toolbar/panels/cache.html:41
+msgid "Parameters"
+msgstr ""
+
+#: templates/debug_toolbar/panels/cache.html:42
+msgid "Function"
+msgstr ""
+
+#: templates/debug_toolbar/panels/headers.html:6
+msgid "Key"
+msgstr ""
+
+#: templates/debug_toolbar/panels/headers.html:7
+#: templates/debug_toolbar/panels/request_vars.html:13
+#: templates/debug_toolbar/panels/request_vars.html:41
+#: templates/debug_toolbar/panels/request_vars.html:65
+#: templates/debug_toolbar/panels/request_vars.html:89
+#: templates/debug_toolbar/panels/settings_vars.html:7
+#: templates/debug_toolbar/panels/timer.html:11
+msgid "Value"
+msgstr ""
+
+#: templates/debug_toolbar/panels/logger.html:9
+msgid "Message"
+msgstr "הודעה"
+
+#: templates/debug_toolbar/panels/logger.html:10
+msgid "Location"
+msgstr "מקום"
+
+#: templates/debug_toolbar/panels/logger.html:25
+msgid "No messages logged"
+msgstr "אין הודעות"
+
+#: templates/debug_toolbar/panels/request_vars.html:12
+#: templates/debug_toolbar/panels/request_vars.html:40
+#: templates/debug_toolbar/panels/request_vars.html:64
+#: templates/debug_toolbar/panels/request_vars.html:88
+msgid "Variable"
+msgstr ""
+
+#: templates/debug_toolbar/panels/request_vars.html:26
+msgid "No COOKIE data"
+msgstr ""
+
+#: templates/debug_toolbar/panels/request_vars.html:54
+msgid "No SESSION data"
+msgstr ""
+
+#: templates/debug_toolbar/panels/request_vars.html:78
+msgid "No GET data"
+msgstr ""
+
+#: templates/debug_toolbar/panels/request_vars.html:102
+msgid "No POST data"
+msgstr ""
+
+#: templates/debug_toolbar/panels/signals.html:6
+msgid "Signal"
+msgstr "סימן"
+
+#: templates/debug_toolbar/panels/sql.html:31
+msgid "Line"
+msgstr "שורה"
+
+#: templates/debug_toolbar/panels/sql.html:32
+msgid "Method"
+msgstr ""
+
+#: templates/debug_toolbar/panels/sql.html:33
+msgid "File"
+msgstr "קובץ"
+
+#: templates/debug_toolbar/panels/sql_explain.html:3
+#: templates/debug_toolbar/panels/sql_profile.html:3
+#: templates/debug_toolbar/panels/sql_select.html:3
+#: templates/debug_toolbar/panels/template_source.html:3
+msgid "Back"
+msgstr "חזרה"
+
+#: templates/debug_toolbar/panels/sql_explain.html:8
+#: templates/debug_toolbar/panels/sql_profile.html:8
+#: templates/debug_toolbar/panels/sql_select.html:8
+msgid "Executed SQL"
+msgstr ""
+
+#: templates/debug_toolbar/panels/templates.html:15
+msgid "Template"
+msgstr ""
+
+#: templates/debug_toolbar/panels/timer.html:10
+msgid "Resource"
+msgstr ""
+
+#: templates/debug_toolbar/panels/cache.html:18
+msgid "Hits"
+msgstr "הצלחות"
+
+#: templates/debug_toolbar/panels/logger.html:7
+msgid "Level"
+msgstr "רמה"
+
+#: templates/debug_toolbar/panels/sql.html:7
+msgid "Action"
+msgstr ""
+
+#: templates/debug_toolbar/panels/settings_vars.html:6
+msgid "Setting"
+msgstr ""
+
+#: templates/debug_toolbar/panels/sql_select.html:33
+msgid "Empty set"
+msgstr "תוצאות ריק"
diff --git a/debug_toolbar/media/debug_toolbar/back.png b/debug_toolbar/media/debug_toolbar/back.png
new file mode 100644
index 0000000..6ac8a52
--- /dev/null
+++ b/debug_toolbar/media/debug_toolbar/back.png
Binary files differ
diff --git a/debug_toolbar/media/debug_toolbar/back_hover.png b/debug_toolbar/media/debug_toolbar/back_hover.png
new file mode 100644
index 0000000..452b673
--- /dev/null
+++ b/debug_toolbar/media/debug_toolbar/back_hover.png
Binary files differ
diff --git a/debug_toolbar/media/debug_toolbar/close.png b/debug_toolbar/media/debug_toolbar/close.png
new file mode 100644
index 0000000..c0e8135
--- /dev/null
+++ b/debug_toolbar/media/debug_toolbar/close.png
Binary files differ
diff --git a/debug_toolbar/media/debug_toolbar/close_hover.png b/debug_toolbar/media/debug_toolbar/close_hover.png
new file mode 100644
index 0000000..5b2c812
--- /dev/null
+++ b/debug_toolbar/media/debug_toolbar/close_hover.png
Binary files differ
diff --git a/debug_toolbar/media/debug_toolbar/djdt_vertical.png b/debug_toolbar/media/debug_toolbar/djdt_vertical.png
new file mode 100644
index 0000000..000c60f
--- /dev/null
+++ b/debug_toolbar/media/debug_toolbar/djdt_vertical.png
Binary files differ
diff --git a/debug_toolbar/media/debug_toolbar/indicator.png b/debug_toolbar/media/debug_toolbar/indicator.png
new file mode 100644
index 0000000..1a2c578
--- /dev/null
+++ b/debug_toolbar/media/debug_toolbar/indicator.png
Binary files differ
diff --git a/debug_toolbar/media/debug_toolbar/panel_bg.png b/debug_toolbar/media/debug_toolbar/panel_bg.png
new file mode 100644
index 0000000..73add17
--- /dev/null
+++ b/debug_toolbar/media/debug_toolbar/panel_bg.png
Binary files differ
diff --git a/debug_toolbar/media/debug_toolbar/toolbar.css b/debug_toolbar/media/debug_toolbar/toolbar.css
index 9ef6dc3..316f4df 100644
--- a/debug_toolbar/media/debug_toolbar/toolbar.css
+++ b/debug_toolbar/media/debug_toolbar/toolbar.css
@@ -1,195 +1,378 @@
-#djDebug * {
- color: #000;
- float: none;
- margin: 0;
- padding: 0;
- position: static;
- text-align: left;
+/* Debug Toolbar CSS Reset, adapted from Eric Meyer's CSS Reset */
+#djDebug {color:#000;background:#FFF;}
+#djDebug, #djDebug div, #djDebug span, #djDebug applet, #djDebug object, #djDebug iframe,
+#djDebug h1, #djDebug h2, #djDebug h3, #djDebug h4, #djDebug h5, #djDebug h6, #djDebug p, blockquote, #djDebug pre,
+#djDebug a, #djDebug abbr, #djDebug acronym, #djDebug address, #djDebug big, #djDebug cite, #djDebug code,
+#djDebug del, #djDebug dfn, #djDebug em, #djDebug font, #djDebug img, #djDebug ins, #djDebug kbd, #djDebug q, #djDebug s, #djDebug samp,
+#djDebug small, #djDebug strike, #djDebug strong, #djDebug sub, #djDebug sup, #djDebug tt, #djDebug var,
+#djDebug b, #djDebug u, #djDebug i, #djDebug center,
+#djDebug dl, #djDebug dt, #djDebug dd, #djDebug ol, #djDebug ul, #djDebug li,
+#djDebug fieldset, #djDebug form, #djDebug label, #djDebug legend,
+#djDebug table, #djDebug caption, #djDebug tbody, #djDebug tfoot, #djDebug thead, #djDebug tr, #djDebug th, #djDebug td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-size: 12px;
+ line-height: 1.5em;
+ color: #000;
+ vertical-align: baseline;
+ background: transparent;
+ font-family: sans-serif;
}
-#djDebug a {
- color: #f7c757;
+
+#djDebug #djDebugToolbar {
+ background:#111;
+ width:200px;
+ z-index:100000000;
+ position:fixed;
+ top:0;
+ bottom:0;
+ right:0;
+ opacity:0.9;
}
-#djDebug a:hover {
- color: #aaa;
+
+#djDebug #djDebugToolbar small {
+ color:#999;
}
-#djDebugToolbar {
- background: #326342;
- height: 30px;
- z-index: 100000000;
- border-bottom: 2px solid #234f32;
- position:absolute;
- top:0;
- left:0;
- right:0;
+#djDebug #djDebugToolbar ul {
+ margin:0;
+ padding:0;
+ list-style:none;
}
-#djDebugToolbarHandle {
- background: #326342;
- height: 30px;
- z-index: 100000000;
- border-bottom: 2px solid #234f32;
- position:absolute;
- top:0;
- left:0;
- right:0;
- width: 16px;
+#djDebug #djDebugToolbar li {
+ border-bottom:1px solid #222;
+ color:#fff;
+ display:block;
+ font-weight:bold;
+ float:none;
+ margin:0;
+ padding:0;
+ position:relative;
+ width:auto;
}
-#djDebugToolbarHandle ul li {
- padding: 3px 0px 0px 3px;
+#djDebug #djDebugToolbar li>a,
+#djDebug #djDebugToolbar li>div.contentless {
+ font-weight:normal;
+ font-style:normal;
+ text-decoration:none;
+ display:block;
+ font-size:16px;
+ padding:10px 10px 5px 25px;
+ color:#fff;
}
-#djDebugToolbarHandle ul li a {
- font-size: 16px;
- font-weight: bold;
+#djDebug #djDebugToolbar li a:hover {
+ color:#111;
+ background-color:#ffc;
}
-#djDebugToolbar ul {
- margin: 0;
- padding: 0;
- list-style: none;
+#djDebug #djDebugToolbar li.active {
+ background-image:url(indicator.png);
+ background-repeat:no-repeat;
+ background-position:left center;
+ background-color:#333;
+ padding-left:10px;
}
-#djDebugToolbar li {
- border-left: 1px solid #487858;
- color: #fff;
- display: inline;
- font-size: 11px;
- font-weight: bold;
- float: none;
- height: 20px;
- margin: 0;
- padding: 0;
- line-height: 30px;
- padding: 8px 9px 9px;
- position: relative;
- width: auto;
+#djDebug #djDebugToolbar li.active a:hover {
+ color:#b36a60;
+ background-color:transparent;
}
-#djDebugToolbar li:hover {
- background: #487858;
+#djDebug #djDebugToolbar li small {
+ font-size:12px;
+ color:#999;
+ font-style:normal;
+ text-decoration:none;
+ font-variant:small-caps;
}
-#djDebugToolbar li:hover a {
- color: #fff;
+#djDebug #djDebugToolbarHandle {
+ position:fixed;
+ background:#fff;
+ border:1px solid #111;
+ top:30px;
+ right:0;
+ z-index:100000000;
+ opacity:0.75;
}
-#djDebugToolbar li:last-child {
- border-right: 1px solid #487858;
+#djDebug a#djShowToolBarButton {
+ display:block;
+ height:75px;
+ width:30px;
+ border-right:none;
+ border-bottom:4px solid #fff;
+ border-top:4px solid #fff;
+ border-left:4px solid #fff;
+ color:#fff;
+ font-size:10px;
+ font-weight:bold;
+ text-decoration:none;
+ text-align:center;
+ text-indent:-999999px;
+ background:#000 url(djdt_vertical.png) no-repeat left center;
+ opacity:0.5;
}
-#djDebugToolbar #djDebugButton {
- color: #92ef3f;
+#djDebug a#djShowToolBarButton:hover {
+ background-color:#111;
+ padding-right:6px;
+ border-top-color:#FFE761;
+ border-left-color:#FFE761;
+ border-bottom-color:#FFE761;
+ opacity:1.0;
}
#djDebug pre {
- background-color: #ffffff;
+ background-color:#ffffff;
}
#djDebug tr.djDebugOdd pre {
- background-color: #eeeeee;
+ background-color:#eeeeee;
}
#djDebug .panelContent {
- background: #2a5738;
- border-bottom: 2px solid #234f32;
- border-top: 2px solid #487858;
- display: none;
- position: absolute;
- margin: 0;
- padding: 10px;
- top: 32px;
- width: auto;
- left: 0px;
- right: 0px;
- bottom: 5px;
- color: black;
- z-index: 1000000;
- overflow: auto;
+ display:none;
+ position:fixed;
+ margin:0;
+ top:0;
+ right:200px;
+ bottom:0;
+ left:0px;
+ background-color:#eee;
+ color:#666;
+ z-index:100000000;
+}
+
+#djDebug .panelContent > div {
+ border-bottom:1px solid #ddd;
+}
+
+#djDebug .djDebugPanelTitle {
+ position:absolute;
+ background-color:#ffc;
+ color:#666;
+ padding-left:20px;
+ top:0;
+ right:0;
+ left:0;
+ height:50px;
}
-#djDebug .panelContent p a, #djDebug .panelContent dl a {
- color: #40684c;
+#djDebug .djDebugPanelContent {
+ position:absolute;
+ top:50px;
+ right:0;
+ bottom:0;
+ left:0;
+ height:auto;
+ padding:0 0 0 20px;
}
-#djDebug .panelContent p a:hover, #djDebug .panelContent dl a:hover {
- color: #92EF3F;
+
+#djDebug .djDebugPanelContent .scroll {
+ height:100%;
+ overflow:auto;
+ display:block;
+ padding:0 10px 0 0;
+}
+
+#djDebug h3 {
+ font-size:24px;
+ font-weight:normal;
+ line-height:50px;
}
-#djDebug .panelContent h3 {
- border-bottom: 1px solid #40684c;
- color: #92ef3f;
- padding: 0 0 5px;
+#djDebug h4 {
+ font-size:20px;
+ font-weight:bold;
+ margin-top:0.8em;
+}
+
+#djDebug .panelContent table {
+ border:1px solid #ccc;
+ border-collapse:collapse;
+ width:100%;
+ background-color:#fff;
+ display:block;
+ margin-top:0.8em;
+}
+#djDebug .panelContent tbody td,
+#djDebug .panelContent tbody th {
+ vertical-align:top;
+ padding:2px 3px;
+}
+#djDebug .panelContent thead th {
+ padding:1px 6px 1px 3px;
+ background:#fefefe;
+ text-align:left;
+ font-weight:normal;
+ font-size:11px;
+ border:1px solid #ddd;
+}
+#djDebug .panelContent tbody th {
+ width:12em;
+ text-align:right;
+ color:#666;
+ padding-right:.5em;
+}
+
+#djDebug .panelContent code {
+ font-family:Consolas, Monaco, "Bitstream Vera Sans Mono", "Lucida Console", monospace;
+}
+/*
+#djDebug .panelContent p a:hover, #djDebug .panelContent dd a:hover {
+ color:#111;
+ background-color:#ffc;
}
#djDebug .panelContent p {
- padding: 0 5px;
+ padding:0 5px;
}
#djDebug .panelContent p, #djDebug .panelContent table, #djDebug .panelContent ol, #djDebug .panelContent ul, #djDebug .panelContent dl {
- margin: 5px 0 15px;
- background-color: #fff;
+ margin:5px 0 15px;
+ background-color:#fff;
}
-
#djDebug .panelContent table {
- width: 100%;
- clear: both;
+ clear:both;
+ border:0;
+ padding:0;
+ margin:0;
+ border-collapse:collapse;
+ border-spacing:0;
}
#djDebug .panelContent table a {
- color: #40684C;
+ color:#000;
+ padding:2px 4px;
+}
+#djDebug .panelContent table a:hover {
+ background-color:#ffc;
}
#djDebug .panelContent table th {
- background-color: #9dcc49;
- font-weight: bold;
- color: #000;
- font-size: 11px;
- padding: 3px 7px 3px;
- text-align: left;
- cursor: pointer;
- border-right: 1px solid #b9d977;
+ background-color:#333;
+ font-weight:bold;
+ color:#fff;
+ padding:3px 7px 3px;
+ text-align:left;
+ cursor:pointer;
}
#djDebug .panelContent table td {
- padding: 5px 10px;
- font-size: 11px;
- background: #fff;
- color: #000;
- vertical-align: top;
+ padding:5px 10px;
+ font-size:14px;
+ background:#fff;
+ color:#000;
+ vertical-align:top;
+ border:0;
}
#djDebug .panelContent table tr.djDebugOdd td {
- background: #eee;
+ background:#eee;
}
+*/
#djDebug .panelContent .close {
- float: right;
- font-weight: bold;
+ text-indent:-9999999px;
+ display:block;
+ position:absolute;
+ top:4px;
+ right:15px;
+ height:40px;
+ width:40px;
+ background:url(close.png) no-repeat center center;
+}
+
+#djDebug .panelContent .close:hover {
+ background-image:url(close_hover.png);
+}
+
+#djDebug .panelContent .close.back {
+ background-image:url(back.png);
+}
+
+#djDebug .panelContent .close.back:hover {
+ background-image:url(back_hover.png);
}
#djDebug .panelContent dt, #djDebug .panelContent dd {
- display: block;
+ display:block;
+}
+
+#djDebug .panelContent dt {
+ margin-top:0.75em;
}
#djDebug .panelContent dd {
- margin-left: 10px;
-}
-
-#djDebug .highlight { color: #000; }
-#djDebug .highlight .err { color: #000; } /* Error */
-#djDebug .highlight .g { color: #000; } /* Generic */
-#djDebug .highlight .k { color: #40684C; font-weight: bold } /* Keyword */
-#djDebug .highlight .o { color: #000; } /* Operator */
-#djDebug .highlight .n { color: #000; } /* Name */
-#djDebug .highlight .mi { color: #40684C; font-weight: bold } /* Literal.Number.Integer */
-#djDebug .highlight .l { color: #000; } /* Literal */
-#djDebug .highlight .x { color: #000; } /* Other */
-#djDebug .highlight .p { color: #000; } /* Punctuation */
-#djDebug .highlight .m { color: #40684C; font-weight: bold } /* Literal.Number */
-#djDebug .highlight .s { color: #0086d2 } /* Literal.String */
-#djDebug .highlight .w { color: #888888 } /* Text.Whitespace */
-#djDebug .highlight .il { color: #40684C; font-weight: bold } /* Literal.Number.Integer.Long */
-#djDebug .highlight .na { color: #7D9029 } /* Name.Attribute */
-#djDebug .highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
-#djDebug .highlight .nv { color: #19177C } /* Name.Variable */
-#djDebug .highlight .s2 { color: #BA2121 } /* Literal.String.Double */
-#djDebug .highlight .cp { color: #BC7A00 } /* Comment.Preproc */
+ margin-left:10px;
+}
+
+#djDebug a.toggleTemplate {
+ padding:4px;
+ background-color:#bbb;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+}
+
+#djDebug a.toggleTemplate:hover {
+ padding:4px;
+ background-color:#444;
+ color:#ffe761;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+}
+
+
+#djDebug a.djTemplateShowContext, #djDebug a.djTemplateShowContext span.toggleArrow {
+ color:#999;
+}
+
+#djDebug a.djTemplateShowContext:hover, #djDebug a.djTemplateShowContext:hover span.toggleArrow {
+ color:#000;
+ cursor:pointer;
+}
+
+#djDebug .djDebugSqlWrap {
+ position:relative;
+}
+
+#djDebug .djDebugSql {
+ z-index:100000002;
+}
+
+#djDebug span.djDebugLineChart {
+ border-top:3px solid #777;
+ position:absolute;
+ bottom:0;
+ top:0;
+ left:0;
+ display:block;
+ z-index:1000000001;
+}
+#djDebug span.djDebugLineChartWarning {
+ border-top-color:#900;
+}
+
+#djDebug .highlight { color:#000; }
+#djDebug .highlight .err { color:#000; } /* Error */
+#djDebug .highlight .g { color:#000; } /* Generic */
+#djDebug .highlight .k { color:#000; font-weight:bold } /* Keyword */
+#djDebug .highlight .o { color:#000; } /* Operator */
+#djDebug .highlight .n { color:#000; } /* Name */
+#djDebug .highlight .mi { color:#000; font-weight:bold } /* Literal.Number.Integer */
+#djDebug .highlight .l { color:#000; } /* Literal */
+#djDebug .highlight .x { color:#000; } /* Other */
+#djDebug .highlight .p { color:#000; } /* Punctuation */
+#djDebug .highlight .m { color:#000; font-weight:bold } /* Literal.Number */
+#djDebug .highlight .s { color:#333 } /* Literal.String */
+#djDebug .highlight .w { color:#888888 } /* Text.Whitespace */
+#djDebug .highlight .il { color:#000; font-weight:bold } /* Literal.Number.Integer.Long */
+#djDebug .highlight .na { color:#333 } /* Name.Attribute */
+#djDebug .highlight .nt { color:#000; font-weight:bold } /* Name.Tag */
+#djDebug .highlight .nv { color:#333 } /* Name.Variable */
+#djDebug .highlight .s2 { color:#333 } /* Literal.String.Double */
+#djDebug .highlight .cp { color:#333 } /* Comment.Preproc */
diff --git a/debug_toolbar/media/debug_toolbar/toolbar.js b/debug_toolbar/media/debug_toolbar/toolbar.js
index 40e1a58..8155e2f 100644
--- a/debug_toolbar/media/debug_toolbar/toolbar.js
+++ b/debug_toolbar/media/debug_toolbar/toolbar.js
@@ -13,11 +13,14 @@ jQuery(function($j) {
}
current = $j('#djDebug #' + this.className);
if (current.is(':visible')) {
- $j(document).trigger('close.djDebug');
+ $j(document).trigger('close.djDebug');
+ $j(this).parent().removeClass('active');
} else {
- $j('.panelContent').hide();
+ $j('.panelContent').hide(); // Hide any that are already open
current.show();
$j.djDebug.open();
+ $j('#djDebugToolbar li').removeClass('active');
+ $j(this).parent().addClass('active');
}
return false;
});
@@ -28,7 +31,7 @@ jQuery(function($j) {
$j('#djDebug a.remoteCall').click(function() {
$j('#djDebugWindow').load(this.href, {}, function() {
$j('#djDebugWindow a.back').click(function() {
- $j(this).parent().hide();
+ $j(this).parent().parent().hide();
return false;
});
});
@@ -36,6 +39,7 @@ jQuery(function($j) {
return false;
});
$j('#djDebugTemplatePanel a.djTemplateShowContext').click(function() {
+ $j.djDebug.toggle_arrow($j(this).children('.toggleArrow'))
$j.djDebug.toggle_content($j(this).parent().next());
return false;
});
@@ -54,15 +58,11 @@ jQuery(function($j) {
if ($j.cookie(COOKIE_NAME)) {
$j.djDebug.hide_toolbar(false);
} else {
- $j('#djDebugToolbar').show();
+ $j.djDebug.show_toolbar(false);
}
},
open: function() {
- $j(document).bind('keydown.djDebug', function(e) {
- if (e.keyCode == 27) {
- $j.djDebug.close();
- }
- });
+ // TODO: Decide if we should remove this
},
toggle_content: function(elem) {
if (elem.is(':visible')) {
@@ -76,9 +76,16 @@ jQuery(function($j) {
return false;
},
hide_toolbar: function(setCookie) {
- $j('#djDebugToolbar').hide("fast");
- $j(document).trigger('close.djDebug');
+ // close any sub panels
+ $j('#djDebugWindow').hide();
+ // close all panels
+ $j('.panelContent').hide();
+ $j('#djDebugToolbar li').removeClass('active');
+ // finally close toolbar
+ $j('#djDebugToolbar').hide('fast');
$j('#djDebugToolbarHandle').show();
+ // Unbind keydown
+ $j(document).unbind('keydown.djDebug');
if (setCookie) {
$j.cookie(COOKIE_NAME, 'hide', {
path: '/',
@@ -86,18 +93,46 @@ jQuery(function($j) {
});
}
},
- show_toolbar: function() {
+ show_toolbar: function(animate) {
+ // Set up keybindings
+ $j(document).bind('keydown.djDebug', function(e) {
+ if (e.keyCode == 27) {
+ $j.djDebug.close();
+ }
+ });
$j('#djDebugToolbarHandle').hide();
- $j('#djDebugToolbar').show("fast");
+ if (animate) {
+ $j('#djDebugToolbar').show('fast');
+ } else {
+ $j('#djDebugToolbar').show();
+ }
$j.cookie(COOKIE_NAME, null, {
path: '/',
expires: -1
});
+ },
+ toggle_arrow: function(elem) {
+ var uarr = String.fromCharCode(0x25b6);
+ var darr = String.fromCharCode(0x25bc);
+ elem.html(elem.html() == uarr ? darr : uarr);
}
});
$j(document).bind('close.djDebug', function() {
- $j(document).unbind('keydown.djDebug');
- $j('.panelContent').hide();
+ // If a sub-panel is open, close that
+ if ($j('#djDebugWindow').is(':visible')) {
+ $j('#djDebugWindow').hide();
+ return;
+ }
+ // If a panel is open, close that
+ if ($j('.panelContent').is(':visible')) {
+ $j('.panelContent').hide();
+ return;
+ }
+ // Otherwise, just minimize the toolbar
+ if ($j('#djDebugToolbar').is(':visible')) {
+ $j.djDebug.hide_toolbar(true);
+ return;
+ }
});
});
jQuery(function() {
diff --git a/debug_toolbar/media/debug_toolbar/toolbar.min.css b/debug_toolbar/media/debug_toolbar/toolbar.min.css
index c172fbd..3de6dac 100644
--- a/debug_toolbar/media/debug_toolbar/toolbar.min.css
+++ b/debug_toolbar/media/debug_toolbar/toolbar.min.css
@@ -1 +1 @@
-#djDebug *{color:#000;float:none;margin:0;padding:0;position:static;text-align:left;}#djDebug a{color:#f7c757;}#djDebug a:hover{color:#aaa;}#djDebugToolbar{background:#326342;height:30px;z-index:100000000;border-bottom:2px solid #234f32;position:absolute;top:0;left:0;right:0;}#djDebugToolbarHandle{background:#326342;height:30px;z-index:100000000;border-bottom:2px solid #234f32;position:absolute;top:0;left:0;right:0;width:16px;}#djDebugToolbarHandle ul li{padding:3px 0 0 3px;}#djDebugToolbarHandle ul li a{font-size:16px;font-weight:bold;}#djDebugToolbar ul{margin:0;padding:0;list-style:none;}#djDebugToolbar li{border-left:1px solid #487858;color:#fff;display:inline;font-size:11px;font-weight:bold;float:none;height:20px;margin:0;padding:0;line-height:30px;padding:8px 9px 9px;position:relative;width:auto;}#djDebugToolbar li:hover{background:#487858;}#djDebugToolbar li:hover a{color:#fff;}#djDebugToolbar li:last-child{border-right:1px solid #487858;}#djDebugToolbar #djDebugButton{color:#92ef3f;}#djDebug pre{background-color:#fff;}#djDebug tr.djDebugOdd pre{background-color:#eee;}#djDebug .panelContent{background:#2a5738;border-bottom:2px solid #234f32;border-top:2px solid #487858;display:none;position:absolute;margin:0;padding:10px;top:32px;width:auto;left:0;right:0;bottom:5px;color:black;z-index:1000000;overflow:auto;}#djDebug .panelContent p a,#djDebug .panelContent dl a{color:#40684c;}#djDebug .panelContent p a:hover,#djDebug .panelContent dl a:hover{color:#92EF3F;}#djDebug .panelContent h3{border-bottom:1px solid #40684c;color:#92ef3f;padding:0 0 5px;}#djDebug .panelContent p{padding:0 5px;}#djDebug .panelContent p,#djDebug .panelContent table,#djDebug .panelContent ol,#djDebug .panelContent ul,#djDebug .panelContent dl{margin:5px 0 15px;background-color:#fff;}#djDebug .panelContent table{width:100%;clear:both;}#djDebug .panelContent table a{color:#40684C;}#djDebug .panelContent table th{background-color:#9dcc49;font-weight:bold;color:#000;font-size:11px;padding:3px 7px 3px;text-align:left;cursor:pointer;border-right:1px solid #b9d977;}#djDebug .panelContent table td{padding:5px 10px;font-size:11px;background:#fff;color:#000;vertical-align:top;}#djDebug .panelContent table tr.djDebugOdd td{background:#eee;}#djDebug .panelContent .close{float:right;font-weight:bold;}#djDebug .panelContent dt,#djDebug .panelContent dd{display:block;}#djDebug .panelContent dd{margin-left:10px;}#djDebug .highlight{color:#000;}#djDebug .highlight .err{color:#000;}#djDebug .highlight .g{color:#000;}#djDebug .highlight .k{color:#40684C;font-weight:bold;}#djDebug .highlight .o{color:#000;}#djDebug .highlight .n{color:#000;}#djDebug .highlight .mi{color:#40684C;font-weight:bold;}#djDebug .highlight .l{color:#000;}#djDebug .highlight .x{color:#000;}#djDebug .highlight .p{color:#000;}#djDebug .highlight .m{color:#40684C;font-weight:bold;}#djDebug .highlight .s{color:#0086d2;}#djDebug .highlight .w{color:#888;}#djDebug .highlight .il{color:#40684C;font-weight:bold;}#djDebug .highlight .na{color:#7D9029;}#djDebug .highlight .nt{color:#008000;font-weight:bold;}#djDebug .highlight .nv{color:#19177C;}#djDebug .highlight .s2{color:#BA2121;}#djDebug .highlight .cp{color:#BC7A00;} \ No newline at end of file
+#djDebug{color:#000;background:#FFF;}#djDebug,#djDebug div,#djDebug span,#djDebug applet,#djDebug object,#djDebug iframe,#djDebug h1,#djDebug h2,#djDebug h3,#djDebug h4,#djDebug h5,#djDebug h6,#djDebug p,blockquote,#djDebug pre,#djDebug a,#djDebug abbr,#djDebug acronym,#djDebug address,#djDebug big,#djDebug cite,#djDebug code,#djDebug del,#djDebug dfn,#djDebug em,#djDebug font,#djDebug img,#djDebug ins,#djDebug kbd,#djDebug q,#djDebug s,#djDebug samp,#djDebug small,#djDebug strike,#djDebug strong,#djDebug sub,#djDebug sup,#djDebug tt,#djDebug var,#djDebug b,#djDebug u,#djDebug i,#djDebug center,#djDebug dl,#djDebug dt,#djDebug dd,#djDebug ol,#djDebug ul,#djDebug li,#djDebug fieldset,#djDebug form,#djDebug label,#djDebug legend,#djDebug table,#djDebug caption,#djDebug tbody,#djDebug tfoot,#djDebug thead,#djDebug tr,#djDebug th,#djDebug td{margin:0;padding:0;border:0;outline:0;font-size:12px;line-height:1.5em;color:#000;vertical-align:baseline;background:transparent;font-family:sans-serif;}#djDebug #djDebugToolbar{background:#111;width:200px;z-index:100000000;position:fixed;top:0;bottom:0;right:0;opacity:.9;}#djDebug #djDebugToolbar small{color:#999;}#djDebug #djDebugToolbar ul{margin:0;padding:0;list-style:none;}#djDebug #djDebugToolbar li{border-bottom:1px solid #222;color:#fff;display:block;font-weight:bold;float:none;margin:0;padding:0;position:relative;width:auto;}#djDebug #djDebugToolbar li>a,#djDebug #djDebugToolbar li>div.contentless{font-weight:normal;font-style:normal;text-decoration:none;display:block;font-size:16px;padding:10px 10px 5px 25px;color:#fff;}#djDebug #djDebugToolbar li a:hover{color:#111;background-color:#ffc;}#djDebug #djDebugToolbar li.active{background-image:url(indicator.png);background-repeat:no-repeat;background-position:left center;background-color:#333;padding-left:10px;}#djDebug #djDebugToolbar li.active a:hover{color:#b36a60;background-color:transparent;}#djDebug #djDebugToolbar li small{font-size:12px;color:#999;font-style:normal;text-decoration:none;font-variant:small-caps;}#djDebug #djDebugToolbarHandle{position:fixed;background:#fff;border:1px solid #111;top:30px;right:0;z-index:100000000;opacity:.75;}#djDebug a#djShowToolBarButton{display:block;height:75px;width:30px;border-right:none;border-bottom:4px solid #fff;border-top:4px solid #fff;border-left:4px solid #fff;color:#fff;font-size:10px;font-weight:bold;text-decoration:none;text-align:center;text-indent:-999999px;background:#000 url(djdt_vertical.png) no-repeat left center;opacity:.5;}#djDebug a#djShowToolBarButton:hover{background-color:#111;padding-right:6px;border-top-color:#FFE761;border-left-color:#FFE761;border-bottom-color:#FFE761;opacity:1.0;}#djDebug pre{background-color:#fff;}#djDebug tr.djDebugOdd pre{background-color:#eee;}#djDebug .panelContent{display:none;position:fixed;margin:0;top:0;right:200px;bottom:0;left:0;background-color:#eee;color:#666;z-index:100000000;}#djDebug .panelContent>div{border-bottom:1px solid #ddd;}#djDebug .djDebugPanelTitle{position:absolute;background-color:#ffc;color:#666;padding-left:20px;top:0;right:0;left:0;height:50px;}#djDebug .djDebugPanelContent{position:absolute;top:50px;right:0;bottom:0;left:0;height:auto;padding:0 0 0 20px;}#djDebug .djDebugPanelContent .scroll{height:100%;overflow:auto;display:block;padding:0 10px 0 0;}#djDebug h3{font-size:24px;font-weight:normal;line-height:50px;}#djDebug h4{font-size:20px;font-weight:bold;margin-top:.8em;}#djDebug .panelContent table{border:1px solid #ccc;border-collapse:collapse;width:100%;background-color:#fff;display:block;margin-top:.8em;}#djDebug .panelContent tbody td,#djDebug .panelContent tbody th{vertical-align:top;padding:2px 3px;}#djDebug .panelContent thead th{padding:1px 6px 1px 3px;background:#fefefe;text-align:left;font-weight:normal;font-size:11px;border:1px solid #ddd;}#djDebug .panelContent tbody th{width:12em;text-align:right;color:#666;padding-right:.5em;}#djDebug .panelContent code{font-family:Consolas,Monaco,"Bitstream Vera Sans Mono","Lucida Console",monospace;}#djDebug .panelContent .close{text-indent:-9999999px;display:block;position:absolute;top:4px;right:15px;height:40px;width:40px;background:url(close.png) no-repeat center center;}#djDebug .panelContent .close:hover{background-image:url(close_hover.png);}#djDebug .panelContent .close.back{background-image:url(back.png);}#djDebug .panelContent .close.back:hover{background-image:url(back_hover.png);}#djDebug .panelContent dt,#djDebug .panelContent dd{display:block;}#djDebug .panelContent dt{margin-top:.75em;}#djDebug .panelContent dd{margin-left:10px;}#djDebug a.toggleTemplate{padding:4px;background-color:#bbb;-moz-border-radius:3px;-webkit-border-radius:3px;}#djDebug a.toggleTemplate:hover{padding:4px;background-color:#444;color:#ffe761;-moz-border-radius:3px;-webkit-border-radius:3px;}#djDebug a.djTemplateShowContext,#djDebug a.djTemplateShowContext span.toggleArrow{color:#999;}#djDebug a.djTemplateShowContext:hover,#djDebug a.djTemplateShowContext:hover span.toggleArrow{color:#000;cursor:pointer;}#djDebug .djDebugSqlWrap{position:relative;}#djDebug .djDebugSql{z-index:100000002;}#djDebug span.djDebugLineChart{border-top:3px solid #777;position:absolute;bottom:0;top:0;left:0;display:block;z-index:1000000001;}#djDebug span.djDebugLineChartWarning{border-top-color:#900;}#djDebug .highlight{color:#000;}#djDebug .highlight .err{color:#000;}#djDebug .highlight .g{color:#000;}#djDebug .highlight .k{color:#000;font-weight:bold;}#djDebug .highlight .o{color:#000;}#djDebug .highlight .n{color:#000;}#djDebug .highlight .mi{color:#000;font-weight:bold;}#djDebug .highlight .l{color:#000;}#djDebug .highlight .x{color:#000;}#djDebug .highlight .p{color:#000;}#djDebug .highlight .m{color:#000;font-weight:bold;}#djDebug .highlight .s{color:#333;}#djDebug .highlight .w{color:#888;}#djDebug .highlight .il{color:#000;font-weight:bold;}#djDebug .highlight .na{color:#333;}#djDebug .highlight .nt{color:#000;font-weight:bold;}#djDebug .highlight .nv{color:#333;}#djDebug .highlight .s2{color:#333;}#djDebug .highlight .cp{color:#333;} \ No newline at end of file
diff --git a/debug_toolbar/media/debug_toolbar/toolbar.min.js b/debug_toolbar/media/debug_toolbar/toolbar.min.js
index 7f8658f..4df4d68 100644
--- a/debug_toolbar/media/debug_toolbar/toolbar.min.js
+++ b/debug_toolbar/media/debug_toolbar/toolbar.min.js
@@ -1 +1 @@
-jQuery.noConflict();jQuery(function(b){var a="dj_debug_panel";b.djDebug=function(d,c){b.djDebug.init()};b.extend(b.djDebug,{init:function(){var c=null;b("#djDebugPanelList li a").click(function(){if(!this.className){return false}c=b("#djDebug #"+this.className);if(c.is(":visible")){b(document).trigger("close.djDebug")}else{b(".panelContent").hide();c.show();b.djDebug.open()}return false});b("#djDebug a.close").click(function(){b(document).trigger("close.djDebug");return false});b("#djDebug a.remoteCall").click(function(){b("#djDebugWindow").load(this.href,{},function(){b("#djDebugWindow a.back").click(function(){b(this).parent().hide();return false})});b("#djDebugWindow").show();return false});b("#djDebugTemplatePanel a.djTemplateShowContext").click(function(){b.djDebug.toggle_content(b(this).parent().next());return false});b("#djDebugSQLPanel a.djSQLShowStacktrace").click(function(){b.djDebug.toggle_content(b(this).parent().next());return false});b("#djHideToolBarButton").click(function(){b.djDebug.hide_toolbar(true);return false});b("#djShowToolBarButton").click(function(){b.djDebug.show_toolbar();return false});if(b.cookie(a)){b.djDebug.hide_toolbar(false)}else{b("#djDebugToolbar").show()}},open:function(){b(document).bind("keydown.djDebug",function(c){if(c.keyCode==27){b.djDebug.close()}})},toggle_content:function(c){if(c.is(":visible")){c.hide()}else{c.show()}},close:function(){b(document).trigger("close.djDebug");return false},hide_toolbar:function(c){b("#djDebugToolbar").hide("fast");b(document).trigger("close.djDebug");b("#djDebugToolbarHandle").show();if(c){b.cookie(a,"hide",{path:"/",expires:10})}},show_toolbar:function(){b("#djDebugToolbarHandle").hide();b("#djDebugToolbar").show("fast");b.cookie(a,null,{path:"/",expires:-1})}});b(document).bind("close.djDebug",function(){b(document).unbind("keydown.djDebug");b(".panelContent").hide()})});jQuery(function(){jQuery.djDebug()});jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}}; \ No newline at end of file
+jQuery.noConflict();jQuery(function(b){var a="dj_debug_panel";b.djDebug=function(d,c){b.djDebug.init()};b.extend(b.djDebug,{init:function(){var c=null;b("#djDebugPanelList li a").click(function(){if(!this.className){return false}c=b("#djDebug #"+this.className);if(c.is(":visible")){b(document).trigger("close.djDebug");b(this).parent().removeClass("active")}else{b(".panelContent").hide();c.show();b.djDebug.open();b("#djDebugToolbar li").removeClass("active");b(this).parent().addClass("active")}return false});b("#djDebug a.close").click(function(){b(document).trigger("close.djDebug");return false});b("#djDebug a.remoteCall").click(function(){b("#djDebugWindow").load(this.href,{},function(){b("#djDebugWindow a.back").click(function(){b(this).parent().parent().hide();return false})});b("#djDebugWindow").show();return false});b("#djDebugTemplatePanel a.djTemplateShowContext").click(function(){b.djDebug.toggle_arrow(b(this).children(".toggleArrow"));b.djDebug.toggle_content(b(this).parent().next());return false});b("#djDebugSQLPanel a.djSQLShowStacktrace").click(function(){b.djDebug.toggle_content(b(this).parent().next());return false});b("#djHideToolBarButton").click(function(){b.djDebug.hide_toolbar(true);return false});b("#djShowToolBarButton").click(function(){b.djDebug.show_toolbar();return false});if(b.cookie(a)){b.djDebug.hide_toolbar(false)}else{b.djDebug.show_toolbar(false)}},open:function(){},toggle_content:function(c){if(c.is(":visible")){c.hide()}else{c.show()}},close:function(){b(document).trigger("close.djDebug");return false},hide_toolbar:function(c){b("#djDebugWindow").hide();b(".panelContent").hide();b("#djDebugToolbar li").removeClass("active");b("#djDebugToolbar").hide("fast");b("#djDebugToolbarHandle").show();b(document).unbind("keydown.djDebug");if(c){b.cookie(a,"hide",{path:"/",expires:10})}},show_toolbar:function(c){b(document).bind("keydown.djDebug",function(d){if(d.keyCode==27){b.djDebug.close()}});b("#djDebugToolbarHandle").hide();if(c){b("#djDebugToolbar").show("fast")}else{b("#djDebugToolbar").show()}b.cookie(a,null,{path:"/",expires:-1})},toggle_arrow:function(d){var c=String.fromCharCode(9654);var e=String.fromCharCode(9660);d.html(d.html()==c?e:c)}});b(document).bind("close.djDebug",function(){if(b("#djDebugWindow").is(":visible")){b("#djDebugWindow").hide();return}if(b(".panelContent").is(":visible")){b(".panelContent").hide();return}if(b("#djDebugToolbar").is(":visible")){b.djDebug.hide_toolbar(true);return}})});jQuery(function(){jQuery.djDebug()});jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}}; \ No newline at end of file
diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py
index 54b3318..cf65aa8 100644
--- a/debug_toolbar/panels/__init__.py
+++ b/debug_toolbar/panels/__init__.py
@@ -14,7 +14,16 @@ class DebugPanel(object):
def dom_id(self):
return 'djDebug%sPanel' % (self.name.replace(' ', ''))
+ def nav_title(self):
+ """Title showing in toolbar"""
+ raise NotImplementedError
+
+ def nav_subtitle(self):
+ """Subtitle showing until title in toolbar"""
+ return ''
+
def title(self):
+ """Title showing in panel"""
raise NotImplementedError
def url(self):
diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py
index 613d4d9..a05d3cc 100644
--- a/debug_toolbar/panels/cache.py
+++ b/debug_toolbar/panels/cache.py
@@ -87,9 +87,12 @@ class CacheDebugPanel(DebugPanel):
self.cache = CacheStatTracker(cache.cache)
cache.cache = self.cache
- def title(self):
+ def nav_title(self):
return 'Cache: %.2fms' % self.cache.total_time
+ def title(self):
+ return 'Cache Usage'
+
def url(self):
return ''
diff --git a/debug_toolbar/panels/headers.py b/debug_toolbar/panels/headers.py
index 213198a..06858ef 100644
--- a/debug_toolbar/panels/headers.py
+++ b/debug_toolbar/panels/headers.py
@@ -31,6 +31,9 @@ class HeaderDebugPanel(DebugPanel):
'SERVER_SOFTWARE',
)
+ def nav_title(self):
+ return 'HTTP Headers'
+
def title(self):
return 'HTTP Headers'
diff --git a/debug_toolbar/panels/logger.py b/debug_toolbar/panels/logger.py
index cb88148..a16b933 100644
--- a/debug_toolbar/panels/logger.py
+++ b/debug_toolbar/panels/logger.py
@@ -5,6 +5,7 @@ try:
except ImportError:
threading = None
from django.template.loader import render_to_string
+from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
class ThreadTrackingHandler(logging.Handler):
@@ -51,8 +52,14 @@ class LoggingPanel(DebugPanel):
handler.clear_records()
return records
+ def nav_title(self):
+ return _("Logging")
+
+ def nav_subtitle(self):
+ return "%s message%s" % (len(handler.get_records()), (len(handler.get_records()) == 1) and '' or 's')
+
def title(self):
- return "Logging (%s message%s)" % (len(handler.get_records()), (len(handler.get_records()) == 1) and '' or 's')
+ return 'Log Messages'
def url(self):
return ''
diff --git a/debug_toolbar/panels/request_vars.py b/debug_toolbar/panels/request_vars.py
index 88a7204..d0a8c19 100644
--- a/debug_toolbar/panels/request_vars.py
+++ b/debug_toolbar/panels/request_vars.py
@@ -8,9 +8,12 @@ class RequestVarsDebugPanel(DebugPanel):
name = 'RequestVars'
has_content = True
+ def nav_title(self):
+ return 'Request Vars'
+
def title(self):
return 'Request Vars'
-
+
def url(self):
return ''
diff --git a/debug_toolbar/panels/settings_vars.py b/debug_toolbar/panels/settings_vars.py
index e090718..f30f601 100644
--- a/debug_toolbar/panels/settings_vars.py
+++ b/debug_toolbar/panels/settings_vars.py
@@ -1,8 +1,10 @@
from django.conf import settings
from django.template.loader import render_to_string
from django.views.debug import get_safe_settings
+from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
+
class SettingsVarsDebugPanel(DebugPanel):
"""
A panel to display all variables in django.conf.settings
@@ -10,8 +12,11 @@ class SettingsVarsDebugPanel(DebugPanel):
name = 'SettingsVars'
has_content = True
+ def nav_title(self):
+ return _('Settings')
+
def title(self):
- return 'Settings'
+ return 'Settings from <code>%s</code>' % settings.SETTINGS_MODULE
def url(self):
return ''
diff --git a/debug_toolbar/panels/signals.py b/debug_toolbar/panels/signals.py
index 7fe382e..56fbfd4 100644
--- a/debug_toolbar/panels/signals.py
+++ b/debug_toolbar/panels/signals.py
@@ -7,6 +7,7 @@ from django.db.models.signals import class_prepared, pre_init, post_init, \
pre_save, post_save, pre_delete, post_delete, post_syncdb
from django.dispatch.dispatcher import WEAKREF_TYPES
from django.template.loader import render_to_string
+from django.utils.translation import ugettext_lazy as _
try:
from django.db.backends.signals import connection_created
@@ -34,6 +35,9 @@ class SignalDebugPanel(DebugPanel):
'post_syncdb': post_syncdb,
}
+ def nav_title(self):
+ return _("Signals")
+
def title(self):
return "Signals"
diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py
index c8d50d9..3903b54 100644
--- a/debug_toolbar/panels/sql.py
+++ b/debug_toolbar/panels/sql.py
@@ -1,6 +1,6 @@
import os
import SocketServer
-import time
+from datetime import datetime
import traceback
import django
@@ -18,6 +18,21 @@ from debug_toolbar.panels import DebugPanel
django_path = os.path.realpath(os.path.dirname(django.__file__))
socketserver_path = os.path.realpath(os.path.dirname(SocketServer.__file__))
+# TODO:This should be set in the toolbar loader as a default and panels should
+# get a copy of the toolbar object with access to its config dictionary
+SQL_WARNING_THRESHOLD = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}).get('SQL_WARNING_THRESHOLD', 500)
+
+SQL_KEYWORDS = (
+ 'SELECT',
+ 'FROM',
+ 'WHERE',
+ 'INNER JOIN',
+ 'LEFT OUTER JOIN',
+ 'ORDER BY',
+ 'HAVING',
+ 'GROUP BY',
+)
+
def tidy_stacktrace(strace):
"""
Clean up stacktrace and remove all entries that:
@@ -41,11 +56,12 @@ class DatabaseStatTracker(util.CursorDebugWrapper):
in `connection.queries`.
"""
def execute(self, sql, params=()):
- start = time.time()
+ start = datetime.now()
try:
return self.cursor.execute(sql, params)
finally:
- stop = time.time()
+ stop = datetime.now()
+ duration = ms_from_timedelta(stop - start)
stacktrace = tidy_stacktrace(traceback.extract_stack())
_params = ''
try:
@@ -55,11 +71,14 @@ class DatabaseStatTracker(util.CursorDebugWrapper):
# We keep `sql` to maintain backwards compatibility
self.db.queries.append({
'sql': self.db.ops.last_executed_query(self.cursor, sql, params),
- 'time': (stop - start) * 1000, # convert to ms
+ 'duration': duration,
'raw_sql': sql,
'params': _params,
'hash': sha_constructor(settings.SECRET_KEY + sql + _params).hexdigest(),
'stacktrace': stacktrace,
+ 'start_time': start,
+ 'stop_time': stop,
+ 'is_slow': (duration > SQL_WARNING_THRESHOLD)
})
util.CursorDebugWrapper = DatabaseStatTracker
@@ -74,47 +93,53 @@ class SQLDebugPanel(DebugPanel):
def __init__(self):
self._offset = len(connection.queries)
self._sql_time = 0
+ self._queries = []
- def title(self):
- self._sql_time = sum(map(lambda q: float(q['time']), connection.queries))
- num_queries = len(connection.queries) - self._offset
- return '%d SQL %s (%.2fms)' % (
+ def nav_title(self):
+ return 'SQL'
+
+ def nav_subtitle(self):
+ self._queries = connection.queries[self._offset:]
+ self._sql_time = sum([q['duration'] for q in self._queries])
+ num_queries = len(self._queries)
+ return "%d %s in %.2fms" % (
num_queries,
(num_queries == 1) and 'query' or 'queries',
self._sql_time
)
+ def title(self):
+ return 'SQL Queries'
+
def url(self):
return ''
def content(self):
- sql_queries = connection.queries[self._offset:]
- for query in sql_queries:
+ width_ratio_tally = 0
+ for query in self._queries:
query['sql'] = reformat_sql(query['sql'])
+ try:
+ query['width_ratio'] = (query['duration'] / self._sql_time) * 100
+ except ZeroDivisionError:
+ query['width_ratio'] = 0
+ query['start_offset'] = width_ratio_tally
+ width_ratio_tally += query['width_ratio']
context = {
- 'queries': sql_queries,
+ 'queries': self._queries,
'sql_time': self._sql_time,
'is_mysql': settings.DATABASE_ENGINE == 'mysql',
}
return render_to_string('debug_toolbar/panels/sql.html', context)
+def ms_from_timedelta(td):
+ """
+ Given a timedelta object, returns a float representing milliseconds
+ """
+ return (td.seconds * 1000) + (td.microseconds / 1000.0)
+
def reformat_sql(sql):
- sql = sql.replace(',', ', ')
- sql = sql.replace('SELECT ', 'SELECT\n\t')
- sql = sql.replace(' FROM ', '\nFROM\n\t')
- sql = sql.replace(' WHERE ', '\nWHERE\n\t')
- sql = sql.replace(' INNER JOIN', '\n\tINNER JOIN')
- sql = sql.replace(' LEFT OUTER JOIN' , '\n\tLEFT OUTER JOIN')
- sql = sql.replace(' ORDER BY ', '\nORDER BY\n\t')
- sql = sql.replace(' HAVING ', '\nHAVING\n\t')
- sql = sql.replace(' GROUP BY ', '\nGROUP BY\n\t')
- # Use Pygments to highlight SQL if it's available
- try:
- from pygments import highlight
- from pygments.lexers import SqlLexer
- from pygments.formatters import HtmlFormatter
- sql = highlight(sql, SqlLexer(), HtmlFormatter())
- except ImportError:
- pass
+ for kwd in SQL_KEYWORDS:
+ sql = sql.replace(kwd, '<strong>%s</strong>' % (kwd,))
return sql
+
diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py
index e99b9c5..f090c78 100644
--- a/debug_toolbar/panels/template.py
+++ b/debug_toolbar/panels/template.py
@@ -7,6 +7,7 @@ from django.dispatch import Signal
from django.template.context import get_standard_processors
from django.template.loader import render_to_string
from django.test.signals import template_rendered
+from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
# Code taken and adapted from Simon Willison and Django Snippets:
@@ -41,6 +42,9 @@ class TemplateDebugPanel(DebugPanel):
def _store_template_info(self, sender, **kwargs):
self.templates.append(kwargs)
+ def nav_title(self):
+ return _('Templates')
+
def title(self):
num_templates = len([t for t in self.templates
if not t['template'].name.startswith('debug_toolbar/')])
diff --git a/debug_toolbar/panels/timer.py b/debug_toolbar/panels/timer.py
index 352bf55..4e390f6 100644
--- a/debug_toolbar/panels/timer.py
+++ b/debug_toolbar/panels/timer.py
@@ -4,9 +4,9 @@ except ImportError:
pass # Will fail on Win32 systems
import time
from django.template.loader import render_to_string
+from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
-
class TimerDebugPanel(DebugPanel):
"""
Panel that displays the time a response took in milliseconds.
@@ -31,13 +31,19 @@ class TimerDebugPanel(DebugPanel):
if self.has_resource:
self._end_rusage = resource.getrusage(resource.RUSAGE_SELF)
- def title(self):
+ def nav_title(self):
+ return _('Time')
+
+ def nav_subtitle(self):
if self.has_resource:
utime = self._end_rusage.ru_utime - self._start_rusage.ru_utime
stime = self._end_rusage.ru_stime - self._start_rusage.ru_stime
- return 'Time: %0.2fms, %0.2fms CPU' % (self.total_time, (utime + stime) * 1000.0)
+ return 'CPU: %0.2fms (%0.2fms)' % ((utime + stime) * 1000.0, self.total_time)
else:
- return 'Time: %0.2fms' % (self.total_time)
+ return 'TOTAL: %0.2fms' % (self.total_time)
+
+ def title(self):
+ return 'Resource Usage'
def url(self):
return ''
diff --git a/debug_toolbar/panels/version.py b/debug_toolbar/panels/version.py
index 7ea6543..3d82dd0 100644
--- a/debug_toolbar/panels/version.py
+++ b/debug_toolbar/panels/version.py
@@ -1,4 +1,5 @@
import django
+from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
class VersionDebugPanel(DebugPanel):
@@ -6,9 +7,12 @@ class VersionDebugPanel(DebugPanel):
Panel that displays the Django version.
"""
name = 'Version'
-
- def title(self):
- return 'Version: %s' % (django.get_version())
+
+ def nav_title(self):
+ return _('Django Version')
+
+ def nav_subtitle(self):
+ return django.get_version()
def url(self):
return ''
diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html
index 52b7a5b..f220b62 100644
--- a/debug_toolbar/templates/debug_toolbar/base.html
+++ b/debug_toolbar/templates/debug_toolbar/base.html
@@ -1,3 +1,5 @@
+{% load i18n %}
+{% spaceless %}
<script type="text/javascript" charset="utf-8">
// When jQuery is sourced, it's going to overwrite whatever might be in the
// '$' variable, so store a reference of it in a temporary variable...
@@ -16,36 +18,51 @@
@import url({{ BASE_URL }}/__debug__/m/toolbar.min.css);
</style>
<div id="djDebug">
- <div style="display: none;" id="djDebugToolbar">
+ <div style="display:none;" id="djDebugToolbar">
<ul id="djDebugPanelList">
{% if panels %}
- <li><a id="djHideToolBarButton" href="#" title="Hide Toolbar">&laquo; Hide</a></li>
+ <li><a id="djHideToolBarButton" href="#" title="Hide Toolbar">{% trans "Hide" %} &raquo;</a></li>
{% else %}
<li id="djDebugButton">DEBUG</li>
{% endif %}
{% for panel in panels %}
<li>
{% if panel.has_content %}
- <a href="{{ panel.url|default:"#" }}" title="{{ panel.title }}" class="{{ panel.dom_id }}">{{ panel.title }}</a>
+ <a href="{{ panel.url|default:"#" }}" title="{{ panel.title }}" class="{{ panel.dom_id }}">
{% else %}
- {{ panel.title }}
+ <div class="contentless">
+ {% endif %}
+ {{ panel.nav_title }}
+ {% with panel.nav_subtitle as subtitle %}
+ {% if subtitle %}<br><small>{{ subtitle }}</small>{% endif %}
+ {% endwith %}
+ {% if panel.has_content %}
+ </a>
+ {% else %}
+ </div>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
- <div style="display: none;" id="djDebugToolbarHandle">
- <ul id="djDebugPanelList">
- <li><a title="Show Toolbar" id="djShowToolBarButton" href="#">&raquo;</a></li>
- </ul>
+ <div style="display:none;" id="djDebugToolbarHandle">
+ <a title="Show Toolbar" id="djShowToolBarButton" href="#">&laquo;</a>
</div>
{% for panel in panels %}
{% if panel.has_content %}
<div id="{{ panel.dom_id }}" class="panelContent">
- <a href="" class="close">Close</a>
- {{ panel.content|safe }}
+ <div class="djDebugPanelTitle">
+ <a href="" class="close">{% trans "Close" %}</a>
+ <h3>{{ panel.title|safe }}</h3>
+ </div>
+ <div class="djDebugPanelContent">
+ <div class="scroll">
+ {{ panel.content|safe }}
+ </div>
+ </div>
</div>
{% endif %}
{% endfor %}
<div id="djDebugWindow" class="panelContent"></div>
</div>
+{% endspaceless %}
diff --git a/debug_toolbar/templates/debug_toolbar/panels/cache.html b/debug_toolbar/templates/debug_toolbar/panels/cache.html
index 3142783..5c5f13b 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/cache.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/cache.html
@@ -1,4 +1,4 @@
-<h3>Cache Usage</h3>
+{% load i18n %}
<table>
<colgroup>
<col width="12%"/>
@@ -11,13 +11,13 @@
<col width="12%"/>
</colgroup>
<tr>
- <th>Total Calls</th>
+ <th>{% trans "Total Calls" %}</th>
<td>{{ cache_calls }}</td>
- <th>Total Time</th>
+ <th>{% trans "Total Time" %}</th>
<td>{{ cache_time }}ms</td>
- <th>Hits</th>
+ <th>{% trans "Hits" %}</th>
<td>{{ cache.hits }}</td>
- <th>Misses</th>
+ <th>{% trans "Misses" %}</th>
<td>{{ cache.misses }}</td>
</tr>
<tr>
@@ -32,14 +32,14 @@
</tr>
</table>
{% if cache.calls %}
-<h3>Breakdown</h3>
+<h3>{% trans "Breakdown" %}</h3>
<table>
<thead>
<tr>
- <th>Time&nbsp;(ms)</th>
- <th>Type</th>
- <th>Parameters</th>
- <th>Function</th>
+ <th>{% trans "Time" %}&nbsp;(ms)</th>
+ <th>{% trans "Type" %}</th>
+ <th>{% trans "Parameters" %}</th>
+ <th>{% trans "Function" %}</th>
</tr>
</thead>
<tbody>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/headers.html b/debug_toolbar/templates/debug_toolbar/panels/headers.html
index 005ffe6..f251056 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/headers.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/headers.html
@@ -1,9 +1,9 @@
-<h3>HTTP Headers</h3>
+{% load i18n %}
<table>
<thead>
<tr>
- <th>Key</th>
- <th>Value</th>
+ <th>{% trans "Key" %}</th>
+ <th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/logger.html b/debug_toolbar/templates/debug_toolbar/panels/logger.html
index 2117529..5e8b652 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/logger.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/logger.html
@@ -1,12 +1,12 @@
-<h3>Log Messages</h3>
+{% load i18n %}
{% if records %}
<table>
<thead>
<tr>
- <th>Level</th>
- <th>Time</th>
- <th>Message</th>
- <th>Location</th>
+ <th>{% trans "Level" %}</th>
+ <th>{% trans "Time" %}</th>
+ <th>{% trans "Message" %}</th>
+ <th>{% trans "Location" %}</th>
</tr>
</thead>
<tbody>
@@ -21,6 +21,6 @@
</tbody>
</table>
{% else %}
- <p>No messages logged.</p>
+ <p>{% trans "No messages logged" %}.</p>
{% endif %}
diff --git a/debug_toolbar/templates/debug_toolbar/panels/request_vars.html b/debug_toolbar/templates/debug_toolbar/panels/request_vars.html
index b7d53ee..3fdbf74 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/request_vars.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/request_vars.html
@@ -1,4 +1,5 @@
-<h3>COOKIES Variables</h3>
+{% load i18n %}
+<h4>COOKIES Variables</h4>
{% if cookies %}
<table>
<colgroup>
@@ -7,8 +8,8 @@
</colgroup>
<thead>
<tr>
- <th>Key</th>
- <th>Value</th>
+ <th>{% trans "Variable" %}</th>
+ <th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
@@ -21,9 +22,10 @@
</tbody>
</table>
{% else %}
- <p>None</p>
+ <p>{% trans "No COOKIE data" %}</p>
{% endif %}
-<h3>SESSION Variables</h3>
+
+<h4>SESSION Variables</h4>
{% if session %}
<table>
<colgroup>
@@ -32,8 +34,8 @@
</colgroup>
<thead>
<tr>
- <th>Key</th>
- <th>Value</th>
+ <th>{% trans "Variable" %}</th>
+ <th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
@@ -46,15 +48,16 @@
</tbody>
</table>
{% else %}
- <p>None</p>
+ <p>{% trans "No SESSION data" %}</p>
{% endif %}
-<h3>GET Variables</h3>
+
+<h4>GET Variables</h4>
{% if get %}
<table>
<thead>
<tr>
- <th>Key</th>
- <th>Value</th>
+ <th>{% trans "Variable" %}</th>
+ <th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
@@ -67,15 +70,16 @@
</tbody>
</table>
{% else %}
- <p>None</p>
+ <p>{% trans "No GET data" %}</p>
{% endif %}
-<h3>POST Variables</h3>
+
+<h4>POST Variables</h4>
{% if post %}
<table>
<thead>
<tr>
- <th>Key</th>
- <th>Value</th>
+ <th>{% trans "Variable" %}</th>
+ <th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
@@ -88,5 +92,5 @@
</tbody>
</table>
{% else %}
- <p>None</p>
-{% endif %}
+ <p>{% trans "No POST data" %}</p>
+{% endif %} \ No newline at end of file
diff --git a/debug_toolbar/templates/debug_toolbar/panels/settings_vars.html b/debug_toolbar/templates/debug_toolbar/panels/settings_vars.html
index 93f0b34..99c43b6 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/settings_vars.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/settings_vars.html
@@ -1,9 +1,9 @@
-<h3>Settings from <code>{{ settings.SETTINGS_MODULE }}</code></h3>
+{% load i18n %}
<table>
<thead>
<tr>
- <th>Setting</th>
- <th>Value</th>
+ <th>{% trans "Setting" %}</th>
+ <th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/signals.html b/debug_toolbar/templates/debug_toolbar/panels/signals.html
index e9a189e..d6d681c 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/signals.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/signals.html
@@ -1,19 +1,19 @@
-<h3>Signals</h3>
+{% load i18n %}
<table>
- <thead>
- <tr>
- <th>Signal</th>
- <th>Providing Args</th>
- <th>Receivers</th>
- </tr>
- </thead>
- <tbody>
- {% for name, signal, receivers in signals %}
- <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
- <td>{{ name|escape }}</td>
- <td>{{ signal.providing_args|join:", " }}</td>
- <td>{{ receivers|join:", " }}</td>
- </tr>
- {% endfor %}
- </tbody>
+ <thead>
+ <tr>
+ <th>{% trans "Signal" %}</th>
+ <th>Providing Args</th>
+ <th>Receivers</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for name, signal, receivers in signals %}
+ <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
+ <td>{{ name|escape }}</td>
+ <td>{{ signal.providing_args|join:", " }}</td>
+ <td>{{ receivers|join:", " }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
</table>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html
index f05ea97..81188a9 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html
@@ -1,9 +1,9 @@
-<h3>SQL Queries</h3>
+{% load i18n %}
<table>
<thead>
<tr>
- <th>Time&nbsp;(ms)</th>
- <th>Action</th>
+ <th>{% trans "Time" %}&nbsp;(ms)</th>
+ <th>{% trans "Action" %}</th>
<th>Stacktrace</th>
<th>Query</th>
</tr>
@@ -11,13 +11,13 @@
<tbody>
{% for query in queries %}
<tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
- <td>{{ query.time|floatformat:"2" }}</td>
+ <td>{{ query.duration|floatformat:"2" }}</td>
<td>
{% if query.params %}
- <a class="remoteCall" href="/__debug__/sql_select/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&time={{ query.time|floatformat:"2"|urlencode }}&hash={{ query.hash }}">SELECT</a>
- <a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&time={{ query.time|floatformat:"2"|urlencode }}&hash={{ query.hash }}">EXPLAIN</a>
+ <a class="remoteCall" href="/__debug__/sql_select/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">SELECT</a><br>
+ <a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">EXPLAIN</a><br>
{% if is_mysql %}
- <a class="remoteCall" href="/__debug__/sql_profile/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&time={{ query.time|floatformat:"2"|urlencode }}&hash={{ query.hash }}">PROFILE</a>
+ <a class="remoteCall" href="/__debug__/sql_profile/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">PROFILE</a><br>
{% endif %}
{% endif %}
</td>
@@ -27,9 +27,9 @@
<div class="djSQLHideStacktraceDiv" style="display:none;">
<table>
<tr>
- <th>Line</th>
- <th>Method</th>
- <th>File</th>
+ <th>{% trans "Line" %}</th>
+ <th>{% trans "Method" %}</th>
+ <th>{% trans "File" %}</th>
</tr>
{% for file, line, method in query.stacktrace %}
<tr>
@@ -42,7 +42,12 @@
</div>
{% endif %}
</td>
- <td class="syntax">{{ query.sql|safe }}</td>
+ <td class="syntax">
+ <div class="djDebugSqlWrap">
+ <div class="djDebugSql">{{ query.sql|safe }}</div>
+ <span class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" style="width:{{ query.width_ratio }}%; left:{{ query.start_offset }}%;"</span>
+ </div>
+ </td>
</tr>
{% endfor %}
</tbody>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html b/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html
index a163b25..57fa538 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html
@@ -1,26 +1,31 @@
-<a class="back" href="">&laquo;&nbsp;Back</a>
-<h3>SQL Explained</h3>
-<dl>
- <dt>Executed SQL</dt>
- <dd><pre>{{ sql|safe }}</pre></dd>
- <dt>Time</dt>
- <dd>{{ time }} ms</dd>
-</dl>
-<table>
- <thead>
- <tr>
- {% for h in headers %}
- <th>{{ h|upper }}</th>
- {% endfor %}
- </tr>
- </thead>
- <tbody>
- {% for row in result %}
- <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
- {% for column in row %}
- <td>{{ column|escape }}</td>
+{% load i18n %}
+<div class="djDebugPanelTitle">
+ <a class="close back" href="">{% trans "Back" %}</a>
+ <h3>SQL Explained</h3>
+</div>
+<div class="djDebugPanelContent">
+ <dl>
+ <dt>{% trans "Executed SQL" %}</dt>
+ <dd>{{ sql|safe }}</dd>
+ <dt>{% trans "Time" %}</dt>
+ <dd>{{ duration }} ms</dd>
+ </dl>
+ <table>
+ <thead>
+ <tr>
+ {% for h in headers %}
+ <th>{{ h|upper }}</th>
{% endfor %}
</tr>
- {% endfor %}
- </tbody>
-</table>
+ </thead>
+ <tbody>
+ {% for row in result %}
+ <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
+ {% for column in row %}
+ <td>{{ column|escape }}</td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+</div>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html
index e46f41d..a3d3240 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html
@@ -1,26 +1,38 @@
-<a class="back" href="">&laquo;&nbsp;Back</a>
-<h3>SQL Profiled</h3>
-<dl>
- <dt>Executed SQL</dt>
- <dd><pre>{{ sql|safe }}</pre></dd>
- <dt>Time</dt>
- <dd>{{ time }} ms</dd>
-</dl>
-<table>
- <thead>
- <tr>
- {% for h in headers %}
- <th>{{ h|upper }}</th>
- {% endfor %}
- </tr>
- </thead>
- <tbody>
- {% for row in result %}
- <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
- {% for column in row %}
- <td>{{ column|escape }}</td>
+{% load i18n %}
+<div class="djDebugPanelTitle">
+ <a class="close back" href="">{% trans "Back" %}</a>
+ <h3>SQL Profiled</h3>
+</div>
+<div class="djDebugPanelContent">
+ {% if result %}
+ <dl>
+ <dt>{% trans "Executed SQL" %}</dt>
+ <dd>{{ sql|safe }}</dd>
+ <dt>{% trans "Time" %}</dt>
+ <dd>{{ duration }} ms</dd>
+ </dl>
+ <table>
+ <thead>
+ <tr>
+ {% for h in headers %}
+ <th>{{ h|upper }}</th>
+ {% endfor %}
+ </tr>
+ </thead>
+ <tbody>
+ {% for row in result %}
+ <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
+ {% for column in row %}
+ <td>{{ column|escape }}</td>
+ {% endfor %}
+ </tr>
{% endfor %}
- </tr>
- {% endfor %}
- </tbody>
-</table>
+ </tbody>
+ </table>
+ {% else %}
+ <dl>
+ <dt>{% trans 'Error' %}</dt>
+ <dd>{{ result_error }}</dd>
+ </dl>
+ {% endif %}
+</div>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_select.html b/debug_toolbar/templates/debug_toolbar/panels/sql_select.html
index 17e7d48..a240b07 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql_select.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql_select.html
@@ -1,30 +1,35 @@
-<a class="back" href="">&laquo;&nbsp;Back</a>
-<h3>SQL Selected</h3>
-<dl>
- <dt>Executed SQL</dt>
- <dd><pre>{{ sql|safe }}</pre></dd>
- <dt>Time</dt>
- <dd>{{ time }} ms</dd>
-</dl>
-{% if result %}
-<table>
- <thead>
- <tr>
- {% for h in headers %}
- <th>{{ h|upper }}</th>
- {% endfor %}
- </tr>
- </thead>
- <tbody>
- {% for row in result %}
- <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
- {% for column in row %}
- <td>{{ column|escape }}</td>
+{% load i18n %}
+<div class="djDebugPanelTitle">
+ <a class="close back" href="">{% trans "Back" %}</a>
+ <h3>SQL Selected</h3>
+</div>
+<div class="djDebugPanelContent">
+ <dl>
+ <dt>{% trans "Executed SQL" %}</dt>
+ <dd>{{ sql|safe }}</dd>
+ <dt>{% trans "Time" %}</dt>
+ <dd>{{ duration }} ms</dd>
+ </dl>
+ {% if result %}
+ <table>
+ <thead>
+ <tr>
+ {% for h in headers %}
+ <th>{{ h|upper }}</th>
{% endfor %}
</tr>
- {% endfor %}
- </tbody>
-</table>
-{% else %}
- <p>Empty set</p>
-{% endif %}
+ </thead>
+ <tbody>
+ {% for row in result %}
+ <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
+ {% for column in row %}
+ <td>{{ column|escape }}</td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% else %}
+ <p>{% trans "Empty set" %}</p>
+ {% endif %}
+</div>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/template_source.html b/debug_toolbar/templates/debug_toolbar/panels/template_source.html
index 572522b..7074f4f 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/template_source.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/template_source.html
@@ -1,3 +1,14 @@
-<a class="back" href="">&laquo;&nbsp;Back</a>
-<h3>Template Source: <samp>{{ template_name }}</samp></h3>
-{{ source }}
+{% load i18n %}
+<div class="djDebugPanelTitle">
+ <a class="close back" href="">{% trans "Back" %}</a>
+ <h3>Template Source: <code>{{ template_name }}</code></h3>
+</div>
+<div class="djDebugPanelContent">
+ <div class="scroll">
+ {% if not source.pygmentized %}
+ <pre>{{ source }}</pre>
+ {% else %}
+ {{ source }}
+ {% endif %}
+ </div>
+</div>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/templates.html b/debug_toolbar/templates/debug_toolbar/panels/templates.html
index e54c951..6107876 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/templates.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/templates.html
@@ -1,4 +1,5 @@
-<h3>Template path{{ template_dirs|length|pluralize }}:</h3>
+{% load i18n %}
+<h4>Template path{{ template_dirs|length|pluralize }}</h4>
{% if template_dirs %}
<ol>
{% for template in template_dirs %}
@@ -8,30 +9,32 @@
{% else %}
<p>None</p>
{% endif %}
-<h3>Template{{ templates|length|pluralize }}</h3>
+
+<h4>{% trans "Template" %}{{ templates|length|pluralize }}</h4>
{% if templates %}
<dl>
{% for template in templates %}
- <dt><strong><a class="remoteCall" href="/__debug__/template_source/?template={{ template.template.name }}">{{ template.template.name|addslashes }}</a></strong></dt>
+ <dt><strong><a class="remoteCall toggleTemplate" href="/__debug__/template_source/?template={{ template.template.name }}">{{ template.template.name|addslashes }}</a></strong></dt>
<dd><samp>{{ template.template.origin_name|addslashes }}</samp></dd>
{% if template.context %}
- <dd>
- <div class="djTemplateShowContextDiv"><a class="djTemplateShowContext">Toggle Context</a></div>
- <div class="djTemplateHideContextDiv" style="display:none;"><pre>{{ template.context }}</pre></div>
- </dd>
+ <dd>
+ <div class="djTemplateShowContextDiv"><a class="djTemplateShowContext"><span class="toggleArrow">&#x25B6;</span> Toggle Context</a></div>
+ <div class="djTemplateHideContextDiv" style="display:none;"><pre>{{ template.context }}</pre></div>
+ </dd>
{% endif %}
{% endfor %}
</dl>
{% else %}
<p>None</p>
{% endif %}
-<h3>Context processor{{ context_processors|length|pluralize }}</h3>
+
+<h4>Context processor{{ context_processors|length|pluralize }}</h4>
{% if context_processors %}
<dl>
{% for key, value in context_processors.iteritems %}
<dt><strong>{{ key|escape }}</strong></dt>
<dd>
- <div class="djTemplateShowContextDiv"><a class="djTemplateShowContext">Toggle Context</a></div>
+ <div class="djTemplateShowContextDiv"><a class="djTemplateShowContext"><span class="toggleArrow">&#x25B6;</span> Toggle Context</a></div>
<div class="djTemplateHideContextDiv" style="display:none;"><pre>{{ value|escape }}</pre></div>
</dd>
{% endfor %}
diff --git a/debug_toolbar/templates/debug_toolbar/panels/timer.html b/debug_toolbar/templates/debug_toolbar/panels/timer.html
index 831ff86..f267de1 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/timer.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/timer.html
@@ -1,4 +1,4 @@
-<h3>Resource Usage</h3>
+{% load i18n %}
<table>
<colgroup>
<col style="width:20%"/>
@@ -6,8 +6,8 @@
</colgroup>
<thead>
<tr>
- <th>Key</th>
- <th>Value</th>
+ <th>{% trans "Resource" %}</th>
+ <th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
diff --git a/debug_toolbar/templates/debug_toolbar/redirect.html b/debug_toolbar/templates/debug_toolbar/redirect.html
index 1f5c84b..068fe8c 100644
--- a/debug_toolbar/templates/debug_toolbar/redirect.html
+++ b/debug_toolbar/templates/debug_toolbar/redirect.html
@@ -1,3 +1,4 @@
+{% load i18n %}
<html>
<head>
</head>
@@ -5,11 +6,7 @@
<h1>HttpResponseRedirect</h1>
<p>Location: <a href="{{ redirect_to|urlencode }}">{{ redirect_to }}</a></p>
<p class="notice">
- The Django Debug Toolbar has intercepted a redirect to the above URL for
- debug viewing purposes. You can click the above link to continue with the
- redirect as normal. If you'd like to disable this feature, set the
- <code>DEBUG_TOOLBAR_CONFIG</code> dictionary's key
- <code>INTERCEPT_REDIRECTS</code> to <code>False</code>.
+ {% trans "The Django Debug Toolbar has intercepted a redirect to the above URL for debug viewing purposes. You can click the above link to continue with the redirect as normal. If you'd like to disable this feature, set the <code>DEBUG_TOOLBAR_CONFIG</code> dictionary's key <code>INTERCEPT_REDIRECTS</code> to <code>False</code>." %}
</p>
</body>
</html>
diff --git a/debug_toolbar/views.py b/debug_toolbar/views.py
index 9123a00..5a412af 100644
--- a/debug_toolbar/views.py
+++ b/debug_toolbar/views.py
@@ -33,7 +33,7 @@ def sql_select(request):
Expected GET variables:
sql: urlencoded sql with positional arguments
params: JSON encoded parameter values
- time: time for SQL to execute passed in from toolbar just for redisplay
+ duration: time for SQL to execute passed in from toolbar just for redisplay
hash: the hash of (secret + sql + params) for tamper checking
"""
from debug_toolbar.panels.sql import reformat_sql
@@ -52,7 +52,7 @@ def sql_select(request):
context = {
'result': result,
'sql': reformat_sql(cursor.db.ops.last_executed_query(cursor, sql, params)),
- 'time': request.GET.get('time', 0.0),
+ 'duration': request.GET.get('duration', 0.0),
'headers': headers,
}
return render_to_response('debug_toolbar/panels/sql_select.html', context)
@@ -65,7 +65,7 @@ def sql_explain(request):
Expected GET variables:
sql: urlencoded sql with positional arguments
params: JSON encoded parameter values
- time: time for SQL to execute passed in from toolbar just for redisplay
+ duration: time for SQL to execute passed in from toolbar just for redisplay
hash: the hash of (secret + sql + params) for tamper checking
"""
from debug_toolbar.panels.sql import reformat_sql
@@ -84,7 +84,7 @@ def sql_explain(request):
context = {
'result': result,
'sql': reformat_sql(cursor.db.ops.last_executed_query(cursor, sql, params)),
- 'time': request.GET.get('time', 0.0),
+ 'duration': request.GET.get('duration', 0.0),
'headers': headers,
}
return render_to_response('debug_toolbar/panels/sql_explain.html', context)
@@ -97,7 +97,7 @@ def sql_profile(request):
Expected GET variables:
sql: urlencoded sql with positional arguments
params: JSON encoded parameter values
- time: time for SQL to execute passed in from toolbar just for redisplay
+ duration: time for SQL to execute passed in from toolbar just for redisplay
hash: the hash of (secret + sql + params) for tamper checking
"""
from debug_toolbar.panels.sql import reformat_sql
@@ -109,21 +109,28 @@ def sql_profile(request):
if sql.lower().strip().startswith('select'):
params = simplejson.loads(params)
cursor = connection.cursor()
- cursor.execute("SET PROFILING=1") # Enable profiling
- cursor.execute(sql, params) # Execute SELECT
- cursor.execute("SET PROFILING=0") # Disable profiling
- # The Query ID should always be 1 here but I'll subselect to get the last one just in case...
- cursor.execute("SELECT * FROM information_schema.profiling WHERE query_id=(SELECT query_id FROM information_schema.profiling ORDER BY query_id DESC LIMIT 1)")
- headers = [d[0] for d in cursor.description]
- result = cursor.fetchall()
+ result = None
+ headers = None
+ result_error = None
+ try:
+ cursor.execute("SET PROFILING=1") # Enable profiling
+ cursor.execute(sql, params) # Execute SELECT
+ cursor.execute("SET PROFILING=0") # Disable profiling
+ # The Query ID should always be 1 here but I'll subselect to get the last one just in case...
+ cursor.execute("SELECT * FROM information_schema.profiling WHERE query_id=(SELECT query_id FROM information_schema.profiling ORDER BY query_id DESC LIMIT 1)")
+ headers = [d[0] for d in cursor.description]
+ result = cursor.fetchall()
+ except:
+ result_error = "Profiling is either not available or not supported by your database."
cursor.close()
context = {
'result': result,
+ 'result_error': result_error,
'sql': reformat_sql(cursor.db.ops.last_executed_query(cursor, sql, params)),
- 'time': request.GET.get('time', 0.0),
+ 'duration': request.GET.get('duration', 0.0),
'headers': headers,
}
- return render_to_response('debug_toolbar/panels/sql_explain.html', context)
+ return render_to_response('debug_toolbar/panels/sql_profile.html', context)
raise InvalidSQLError("Only 'select' queries are allowed.")
def template_source(request):
@@ -147,6 +154,7 @@ def template_source(request):
source = highlight(source, HtmlDjangoLexer(), HtmlFormatter())
source = mark_safe(source)
+ source.pygmentized = True
except ImportError:
pass