Jelajahi Sumber

HUE-8139 [core] Fix django-debug-toolbar 1.9.1 in Django 1.11
* add template engine django in desktop/settings.py for django-debug-toolbar
* use desktop/ext/js/jquery/jquery-2.2.4.min.js in desktop/templates/debug_toolbar/base.html

Ying Chen 7 tahun lalu
induk
melakukan
173e13d651
22 mengubah file dengan 112 tambahan dan 83 penghapusan
  1. 1 1
      desktop/core/ext-py/django-debug-panel-0.8.3/debug_panel/views.py
  2. 1 1
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/__init__.py
  3. 1 1
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/redirects.py
  4. 3 3
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/views.py
  5. 1 1
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/timer.py
  6. 1 1
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/settings.py
  7. 1 1
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/toolbar.py
  8. 10 1
      desktop/core/src/desktop/settings.py
  9. 10 5
      desktop/core/src/desktop/static/debug_toolbar/css/toolbar.css
  10. 0 1
      desktop/core/src/desktop/static/debug_toolbar/jquery/2.1.4/jquery.min.js
  11. 4 1
      desktop/core/src/desktop/static/debug_toolbar/js/jquery_post.js
  12. 5 1
      desktop/core/src/desktop/static/debug_toolbar/js/jquery_pre.js
  13. 13 12
      desktop/core/src/desktop/static/debug_toolbar/js/toolbar.js
  14. 6 6
      desktop/core/src/desktop/static/debug_toolbar/js/toolbar.timer.js
  15. 11 11
      desktop/core/src/desktop/templates/debug_toolbar/base.html
  16. 1 1
      desktop/core/src/desktop/templates/debug_toolbar/panels/profiling.html
  17. 13 13
      desktop/core/src/desktop/templates/debug_toolbar/panels/request.html
  18. 10 8
      desktop/core/src/desktop/templates/debug_toolbar/panels/sql.html
  19. 1 2
      desktop/core/src/desktop/templates/debug_toolbar/panels/staticfiles.html
  20. 4 4
      desktop/core/src/desktop/templates/debug_toolbar/panels/templates.html
  21. 7 7
      desktop/core/src/desktop/templates/debug_toolbar/panels/timer.html
  22. 8 1
      desktop/core/src/desktop/templates/debug_toolbar/panels/versions.html

+ 1 - 1
desktop/core/ext-py/django-debug-panel-0.8.3/debug_panel/views.py

@@ -8,6 +8,6 @@ def debug_data(request, cache_key):
     html = cache.get(cache_key)
 
     if html is None:
-        return render_to_response('debug-data-unavailable.html')
+        return render_to_response('debug-data-unavailable.html', using='django')
 
     return HttpResponse(html, content_type="text/html; charset=utf-8")

+ 1 - 1
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/__init__.py

@@ -93,7 +93,7 @@ class Panel(object):
         template's context.
         """
         if self.has_content:
-            return render_to_string(self.template, self.get_stats())
+            return render_to_string(self.template, self.get_stats(), using='django')
 
     # URLs for panel-specific views
 

+ 1 - 1
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/redirects.py

@@ -23,7 +23,7 @@ class RedirectsPanel(Panel):
                 cookies = response.cookies
                 context = {'redirect_to': redirect_to, 'status_line': status_line}
                 # Using SimpleTemplateResponse avoids running global context processors.
-                response = SimpleTemplateResponse('debug_toolbar/redirect.html', context)
+                response = SimpleTemplateResponse('debug_toolbar/redirect.html', context, using='django')
                 response.cookies = cookies
                 response.render()
         return response

+ 3 - 3
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/views.py

@@ -30,7 +30,7 @@ def sql_select(request):
             'alias': form.cleaned_data['alias'],
         }
         # Using SimpleTemplateResponse avoids running global context processors.
-        return SimpleTemplateResponse('debug_toolbar/panels/sql_select.html', context)
+        return SimpleTemplateResponse('debug_toolbar/panels/sql_select.html', context, using='django')
     return HttpResponseBadRequest('Form errors')
 
 
@@ -67,7 +67,7 @@ def sql_explain(request):
             'alias': form.cleaned_data['alias'],
         }
         # Using SimpleTemplateResponse avoids running global context processors.
-        return SimpleTemplateResponse('debug_toolbar/panels/sql_explain.html', context)
+        return SimpleTemplateResponse('debug_toolbar/panels/sql_explain.html', context, using='django')
     return HttpResponseBadRequest('Form errors')
 
 
@@ -114,5 +114,5 @@ def sql_profile(request):
             'alias': form.cleaned_data['alias'],
         }
         # Using SimpleTemplateResponse avoids running global context processors.
-        return SimpleTemplateResponse('debug_toolbar/panels/sql_profile.html', context)
+        return SimpleTemplateResponse('debug_toolbar/panels/sql_profile.html', context, using='django')
     return HttpResponseBadRequest('Form errors')

+ 1 - 1
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/timer.py

@@ -48,7 +48,7 @@ class TimerPanel(Panel):
             (_("Elapsed time"), _("%(total_time)0.3f msec") % stats),
             (_("Context switches"), _("%(vcsw)d voluntary, %(ivcsw)d involuntary") % stats),
         )
-        return render_to_string(self.template, {'rows': rows})
+        return render_to_string(self.template, {'rows': rows}, using='django')
 
     def process_request(self, request):
         self._start_time = time.time()

+ 1 - 1
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/settings.py

@@ -17,7 +17,7 @@ CONFIG_DEFAULTS = {
     # Toolbar options
     'DISABLE_PANELS': {'debug_toolbar.panels.redirects.RedirectsPanel'},
     'INSERT_BEFORE': '</body>',
-    'JQUERY_URL': '//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js',
+    'JQUERY_URL': None, # Not used in desktop/templates/debug_toolbar/base.html
     'RENDER_PANELS': None,
     'RESULTS_CACHE_SIZE': 10,
     'ROOT_TAG_EXTRA_ATTRS': '',

+ 1 - 1
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/toolbar.py

@@ -61,7 +61,7 @@ class DebugToolbar(object):
             self.store()
         try:
             context = {'toolbar': self}
-            return render_to_string('debug_toolbar/base.html', context)
+            return render_to_string('debug_toolbar/base.html', context, using='django')
         except TemplateSyntaxError:
             if not apps.is_installed('django.contrib.staticfiles'):
                 raise ImproperlyConfigured(

+ 10 - 1
desktop/core/src/desktop/settings.py

@@ -230,6 +230,14 @@ TEMPLATES = [
       'loaders': GTEMPLATE_LOADERS,
     },
   },
+  {
+    'BACKEND': 'django.template.backends.django.DjangoTemplates',
+    'DIRS': [
+      get_desktop_root("core/templates/debug_toolbar"),
+    ],
+    'NAME': 'django',
+    'APP_DIRS': True,
+  },
 ]
 
 # Desktop doesn't use an auth profile module, because
@@ -553,7 +561,8 @@ def show_toolbar(request):
 
 if DEBUG and desktop.conf.ENABLE_DJANGO_DEBUG_TOOL.get():
   idx = MIDDLEWARE_CLASSES.index('desktop.middleware.ClusterMiddleware')
-  MIDDLEWARE_CLASSES.insert(idx + 1, 'debug_panel.middleware.DebugPanelMiddleware')
+  MIDDLEWARE_CLASSES.insert(idx + 1, 'debug_toolbar.middleware.DebugToolbarMiddleware')
+  MIDDLEWARE_CLASSES.insert(idx + 2, 'debug_panel.middleware.DebugPanelMiddleware')
 
   INSTALLED_APPS += (
       'debug_toolbar',

+ 10 - 5
desktop/core/src/desktop/static/debug_toolbar/css/toolbar.css

@@ -38,13 +38,14 @@
 	font-family:sans-serif;
 	text-align:left;
 	text-shadow: none;
+	white-space: normal;
 	-webkit-transition: none;
     -moz-transition: none;
     -o-transition: none;
     transition: none;
 }
 
-#djDebug button {
+#djDebug button, #djDebug a.button {
 	background-color: #eee;
 	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eee), color-stop(100%, #cccccc));
 	background-image: -webkit-linear-gradient(top, #eee, #cccccc);
@@ -64,7 +65,7 @@
 	text-shadow: 0 1px 0 #eee;
 }
 
-#djDebug button:hover {
+#djDebug button:hover, #djDebug a.button:hover {
     background-color: #ddd;
     background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ddd), color-stop(100%, #bbb));
     background-image: -webkit-linear-gradient(top, #ddd, #bbb);
@@ -78,7 +79,7 @@
     text-shadow: 0 1px 0 #ddd;
 }
 
-#djDebug button:active {
+#djDebug button:active, #djDebug a.button:active {
     border: 1px solid #aaa;
     border-bottom: 1px solid #888;
     -webkit-box-shadow: inset 0 0 5px 2px #aaa, 0 1px 0 0 #eee;
@@ -286,7 +287,7 @@
 	border-collapse:collapse;
 	width:100%;
 	background-color:#fff;
-	display:block;
+	display:table;
 	margin-top:0.8em;
 	overflow: auto;
 }
@@ -457,6 +458,7 @@
 }
 
 #djDebug .djDebugSql {
+	word-break:break-word;
 	z-index:100000002;
 }
 
@@ -502,7 +504,7 @@
 #djDebug .highlight .s2 { color:#333 } /* Literal.String.Double */
 #djDebug .highlight .cp { color:#333 } /* Comment.Preproc */
 
-#djDebug .timeline {
+#djDebug .djdt-timeline {
     width: 30%;
 }
 #djDebug .djDebugTimeline {
@@ -656,3 +658,6 @@
 #djDebug .djdt-highlighted {
     background-color: lightgrey;
 }
+.djdt-hidden {
+    display: none;
+}

File diff ditekan karena terlalu besar
+ 0 - 1
desktop/core/src/desktop/static/debug_toolbar/jquery/2.1.4/jquery.min.js


+ 4 - 1
desktop/core/src/desktop/static/debug_toolbar/js/jquery_post.js

@@ -1 +1,4 @@
-var djdt = {jQuery: jQuery.noConflict(true)}; window.define = _djdt_define_backup;
+var djdt = {jQuery: jQuery.noConflict(true)};
+if (window.define) {
+    window.define.amd = _djdt_define_amd_backup;
+}

+ 5 - 1
desktop/core/src/desktop/static/debug_toolbar/js/jquery_pre.js

@@ -1 +1,5 @@
-var _djdt_define_backup = window.define; window.define = undefined;
+var _djdt_define_amd_backup;
+if (window.define) {
+    _djdt_define_amd_backup = window.define.amd;
+    window.define.amd = undefined;
+}

+ 13 - 12
desktop/core/src/desktop/static/debug_toolbar/js/toolbar.js

@@ -19,16 +19,15 @@
                 } else {
                     $('.djdt-panelContent').hide(); // Hide any that are already open
                     var inner = current.find('.djDebugPanelContent .djdt-scroll'),
-                        store_id = $('#djDebug').data('store-id'),
-                        render_panel_url = $('#djDebug').data('render-panel-url');
-                    if (store_id !== '' && inner.children().length === 0) {
+                        store_id = $('#djDebug').data('store-id');
+                    if (store_id && inner.children().length === 0) {
                         var ajax_data = {
                             data: {
                                 store_id: store_id,
                                 panel_id: this.className
                             },
                             type: 'GET',
-                            url: render_panel_url
+                            url: $('#djDebug').data('render-panel-url')
                         };
                         $.ajax(ajax_data).done(function(data){
                             inner.prev().remove();  // Remove AJAX loader
@@ -64,16 +63,16 @@
 
                 if (name == 'button') {
                     var form = self.parents('form:eq(0)');
-                    ajax_data['url'] = self.attr('formaction');
+                    ajax_data.url = self.attr('formaction');
 
                     if (form.length) {
-                        ajax_data['data'] = form.serialize();
-                        ajax_data['type'] = form.attr('method') || 'POST';
+                        ajax_data.data = form.serialize();
+                        ajax_data.type = form.attr('method') || 'POST';
                     }
                 }
 
                 if (name == 'a') {
-                    ajax_data['url'] = self.attr('href');
+                    ajax_data.url = self.attr('href');
                 }
 
                 $.ajax(ajax_data).done(function(data){
@@ -141,13 +140,13 @@
                     // due to djdt.handleDragged being set to true.
                     if (djdt.handleDragged || event.pageY != startPageY) {
                         var top = baseY + event.clientY;
-                        
+
                         if (top < 0) {
                             top = 0;
                         } else if (top + handle.height() > windowHeight) {
                             top = windowHeight - handle.height();
                         }
-                        
+
                         handle.css({top: top});
                         djdt.handleDragged = true;
                     }
@@ -213,11 +212,13 @@
             $('#djDebugToolbar li').removeClass('djdt-active');
             // finally close toolbar
             $('#djDebugToolbar').hide('fast');
-            $('#djDebugToolbarHandle').show();
+            handle = $('#djDebugToolbarHandle');
+            handle.show();
             // set handle position
             var handleTop = djdt.cookie.get('djdttop');
             if (handleTop) {
-                $('#djDebugToolbarHandle').css({top: handleTop + 'px'});
+                handleTop = Math.min(handleTop, window.innerHeight - handle.outerHeight() - 10);
+                handle.css({top: handleTop + 'px'});
             }
             // Unbind keydown
             $(document).unbind('keydown.djDebug');

+ 6 - 6
desktop/core/src/desktop/static/debug_toolbar/js/toolbar.timer.js

@@ -23,16 +23,16 @@
         var $row = $('<tr class="' + ((rowCount % 2) ? 'djDebugOdd' : 'djDebugEven') + '"></tr>');
         if (endStat) {
             // Render a start through end bar
-            $row.html('<td>' + stat.replace('Start', '') + '</td>' +
-                      '<td class="timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong>&nbsp;</strong></div></div></td>' +
+	    $row.html('<td>' + stat.replace('Start', '') + '</td>' +
+                      '<td class="djdt-timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong>&#160;</strong></div></div></td>' +
                       '<td>' + (perf.timing[stat] - timingOffset) + ' (+' + (perf.timing[endStat] - perf.timing[stat]) + ')</td>');
             $row.find('strong').css({width: getCSSWidth(stat, endStat)});
         } else {
             // Render a point in time
-             $row.html('<td>' + stat + '</td>' +
-                       '<td class="timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong>&nbsp;</strong></div></div></td>' +
-                       '<td>' + (perf.timing[stat] - timingOffset) + '</td>');
-             $row.find('strong').css({width: 2});
+            $row.html('<td>' + stat + '</td>' +
+                      '<td class="djdt-timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong>&#160;</strong></div></div></td>' +
+                      '<td>' + (perf.timing[stat] - timingOffset) + '</td>');
+            $row.find('strong').css({width: 2});
         }
         $row.find('djDebugLineChart').css({left: getLeft(stat) + '%'});
         $('#djDebugBrowserTimingTableBody').append($row);

+ 11 - 11
desktop/core/src/desktop/templates/debug_toolbar/base.html

@@ -1,19 +1,19 @@
-{% load i18n %}{% load static from staticfiles %}{% load url from debug_toolbar_compat %}
+{% load i18n %}{% load static from staticfiles %}
 <link rel="stylesheet" href="{% static 'debug_toolbar/css/print.css' %}" type="text/css" media="print" />
 <link rel="stylesheet" href="{% static 'debug_toolbar/css/toolbar.css' %}" type="text/css" />
-{% if toolbar.config.JQUERY_URL %}
-<!-- Prevent our copy of jQuery from registering as an AMD module on sites that use RequireJS. -->
+
 <script src="{% static 'debug_toolbar/js/jquery_pre.js' %}"></script>
-<script src="{{ toolbar.config.JQUERY_URL }}"></script>
+<script src="{% static 'desktop/ext/js/jquery/jquery-2.2.4.min.js' %}"></script>
 <script src="{% static 'debug_toolbar/js/jquery_post.js' %}"></script>
-{% else %}
-<script src="{% static 'debug_toolbar/js/jquery_existing.js' %}"></script>
-{% endif %}
+
 <script src="{% static 'debug_toolbar/js/toolbar.js' %}"></script>
-<div id="djDebug" hidden="hidden" dir="ltr"
-     data-store-id="{{ toolbar.store_id }}" data-render-panel-url="{% url 'djdt:render_panel' %}"
+<div id="djDebug" class="djdt-hidden" dir="ltr"
+     {% if toolbar.store_id %}
+     data-store-id="{{ toolbar.store_id }}"
+     data-render-panel-url="{% url 'djdt:render_panel' %}"
+     {% endif %}
      {{ toolbar.config.ROOT_TAG_EXTRA_ATTRS|safe }}>
-	<div hidden="hidden" id="djDebugToolbar">
+	<div class="djdt-hidden" id="djDebugToolbar">
 		<ul id="djDebugPanelList">
 			{% if toolbar.panels %}
 			<li><a id="djHideToolBarButton" href="#" title="{% trans "Hide toolbar" %}">{% trans "Hide" %} &#187;</a></li>
@@ -43,7 +43,7 @@
 			{% endfor %}
 		</ul>
 	</div>
-	<div hidden="hidden" id="djDebugToolbarHandle">
+	<div class="djdt-hidden" id="djDebugToolbarHandle">
 		<span title="{% trans "Show toolbar" %}" id="djShowToolBarButton">&#171;</span>
 	</div>
 	{% for panel in toolbar.panels %}

+ 1 - 1
desktop/core/src/desktop/templates/debug_toolbar/panels/profiling.html

@@ -12,7 +12,7 @@
 	</thead>
 	<tbody>
 		{% for call in func_list %}
-			<tr class="djDebugProfileRow{% for parent_id in call.parent_ids %} djToggleDetails_{{ parent_id }}{% endfor %}" depth="{{ call.depth }}">
+			<tr class="{% cycle 'djDebugOdd' 'djDebugEven' %} djDebugProfileRow{% for parent_id in call.parent_ids %} djToggleDetails_{{ parent_id }}{% endfor %}" depth="{{ call.depth }}">
 				<td>
 					<div data-padding-left="{{ call.indent }}px">
 						{% if call.has_subfuncs %}

+ 13 - 13
desktop/core/src/desktop/templates/debug_toolbar/panels/request.html

@@ -11,11 +11,11 @@
 		</tr>
 	</thead>
 	<tbody>
-		<tr>
-			<td class="djDebugOdd"><code>{{ view_func }}</code></td>
-			<td class="djDebugEven"><code>{{ view_args|pprint }}</code></td>
-			<td class="djDebugOdd"><code>{{ view_kwargs|pprint }}</code></td>
-			<td class="djDebugEven"><code>{{ view_urlname }}</code></td>
+		<tr class="djDebugOdd">
+			<td><code>{{ view_func }}</code></td>
+			<td><code>{{ view_args|pprint }}</code></td>
+			<td><code>{{ view_kwargs|pprint }}</code></td>
+			<td><code>{{ view_urlname }}</code></td>
 		</tr>
 	</tbody>
 </table>
@@ -24,8 +24,8 @@
 	<h4>{% trans "Cookies" %}</h4>
 	<table>
 		<colgroup>
-			<col class="djdt-width-20"/>
-			<col/>
+			<col class="djdt-width-20" />
+			<col />
 		</colgroup>
 		<thead>
 			<tr>
@@ -50,8 +50,8 @@
 	<h4>{% trans "Session data" %}</h4>
 	<table>
 		<colgroup>
-			<col class="djdt-width-20"/>
-			<col/>
+			<col class="djdt-width-20" />
+			<col />
 		</colgroup>
 		<thead>
 			<tr>
@@ -76,8 +76,8 @@
 	<h4>{% trans "GET data" %}</h4>
 	<table>
 		<colgroup>
-			<col class="djdt-width-20"/>
-			<col/>
+			<col class="djdt-width-20" />
+			<col />
 		</colgroup>
 		<thead>
 			<tr>
@@ -102,8 +102,8 @@
 	<h4>{% trans "POST data" %}</h4>
 	<table>
 		<colgroup>
-			<col class="djdt-width-20"/>
-			<col/>
+			<col class="djdt-width-20" />
+			<col />
 		</colgroup>
 			<tr>
 				<th>{% trans "Variable" %}</th>

+ 10 - 8
desktop/core/src/desktop/templates/debug_toolbar/panels/sql.html

@@ -1,4 +1,4 @@
-{% load i18n l10n %}{% load static from staticfiles %}{% load url from debug_toolbar_compat %}
+{% load i18n l10n %}{% load static from staticfiles %}
 <div class="djdt-clearfix">
 	<ul class="djdt-stats">
 		{% for alias, info in databases %}
@@ -18,8 +18,8 @@
 		<thead>
 			<tr>
 				<th class="djdt-color">&#160;</th>
-				<th class="query" colspan="2">{% trans "Query" %}</th>
-				<th class="timeline">{% trans "Timeline" %}</th>
+				<th class="djdt-query" colspan="2">{% trans "Query" %}</th>
+				<th class="djdt-timeline">{% trans "Timeline" %}</th>
 				<th class="djdt-time">{% trans "Time (ms)" %}</th>
 				<th class="djdt-actions">{% trans "Action" %}</th>
 			</tr>
@@ -29,19 +29,21 @@
 				<tr class="djDebugHoverable {% cycle 'djDebugOdd' 'djDebugEven' %}{% if query.is_slow %} djDebugRowWarning{% endif %}{% if query.starts_trans %} djDebugStartTransaction{% endif %}{% if query.ends_trans %} djDebugEndTransaction{% endif %}{% if query.in_trans %} djDebugInTransaction{% endif %}" id="sqlMain_{{ forloop.counter }}">
 					<td class="djdt-color"><span data-background-color="rgb({{ query.rgb_color|join:", " }})">&#160;</span></td>
 					<td class="djdt-toggle">
-						<a class="djToggleSwitch" data-toggle-name="sqlMain" data-toggle-id="{{ forloop.counter }}" data-toggle-open="+" data-toggle-close="-" href>+</a>
+						<a class="djToggleSwitch" data-toggle-name="sqlMain" data-toggle-id="{{ forloop.counter }}" data-toggle-open="+" data-toggle-close="-" href="">+</a>
 					</td>
-					<td class="query">
+					<td class="djdt-query">
 						<div class="djDebugSqlWrap">
 							<div class="djDebugSql">{{ query.sql|safe }}</div>
 						</div>
 						{% if query.duplicate_count %}
-							<strong>{% blocktrans with dupes=query.duplicate_count %}Duplicated {{ dupes }} times.{% endblocktrans %}
+							<strong>
+								<span data-background-color="{{ query.duplicate_color }}">&#160;</span>
+								{% blocktrans with dupes=query.duplicate_count %}Duplicated {{ dupes }} times.{% endblocktrans %}
 							</strong>
 						{% endif %}
 					</td>
-					<td class="timeline">
-						<div class="djDebugTimeline"><div class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" data-left="{{ query.start_offset|unlocalize }}%"><strong data-width="{{ query.width_ratio_relative|unlocalize }}%" data-background-color"{{ query.trace_color }}">{{ query.width_ratio }}%</strong></div></div>
+					<td class="djdt-timeline">
+						<div class="djDebugTimeline"><div class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" data-left="{{ query.start_offset|unlocalize }}%"><strong data-width="{{ query.width_ratio_relative|unlocalize }}%" data-background-color="{{ query.trace_color }}">{{ query.width_ratio }}%</strong></div></div>
 					</td>
 					<td class="djdt-time">
 						{{ query.duration|floatformat:"2" }}

+ 1 - 2
desktop/core/src/desktop/templates/debug_toolbar/panels/staticfiles.html

@@ -1,5 +1,4 @@
-{% load i18n %}
-{% load static from staticfiles%}
+{% load i18n %}{% load static from staticfiles%}
 
 <h4>{% blocktrans count staticfiles_dirs|length as dirs_count %}Static file path{% plural %}Static file paths{% endblocktrans %}</h4>
 {% if staticfiles_dirs %}

+ 4 - 4
desktop/core/src/desktop/templates/debug_toolbar/panels/templates.html

@@ -1,4 +1,4 @@
-{% load i18n %}{% load static from staticfiles %}{% load url from debug_toolbar_compat %}
+{% load i18n %}{% load static from staticfiles %}
 <h4>{% blocktrans count template_dirs|length as template_count %}Template path{% plural %}Template paths{% endblocktrans %}</h4>
 {% if template_dirs %}
 	<ol>
@@ -14,12 +14,12 @@
 {% if templates %}
 <dl>
 {% for template in templates %}
-	<dt><strong><a class="remoteCall toggleTemplate" href="{% url 'djdt:template_source' %}?template={{ template.template.name }}">{{ template.template.name|addslashes }}</a></strong></dt>
+<dt><strong><a class="remoteCall toggleTemplate" href="{% url 'djdt:template_source' %}?template={{ template.template.name }}&amp;template_origin={{ template.template.origin_hash }}">{{ 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"><span class="toggleArrow">&#x25B6;</span> {% trans "Toggle context" %}</a></div>
-		<div class="djTemplateHideContextDiv" hidden="hidden"><code>{{ template.context }}</code></div>
+		<div class="djTemplateHideContextDiv djdt-hidden"><code>{{ template.context }}</code></div>
 	</dd>
 	{% endif %}
 {% endfor %}
@@ -35,7 +35,7 @@
 	<dt><strong>{{ key|escape }}</strong></dt>
 	<dd>
 		<div class="djTemplateShowContextDiv"><a class="djTemplateShowContext"><span class="toggleArrow">&#x25B6;</span> {% trans "Toggle context" %}</a></div>
-		<div class="djTemplateHideContextDiv" hidden="hidden"><code>{{ value|escape }}</code></div>
+		<div class="djTemplateHideContextDiv djdt-hidden"><code>{{ value|escape }}</code></div>
 	</dd>
 {% endfor %}
 </dl>

+ 7 - 7
desktop/core/src/desktop/templates/debug_toolbar/panels/timer.html

@@ -2,8 +2,8 @@
 <h4>{% trans "Resource usage" %}</h4>
 <table>
 	<colgroup>
-		<col class="djdt-width-20"/>
-		<col/>
+		<col class="djdt-width-20" />
+		<col />
 	</colgroup>
 	<thead>
 		<tr>
@@ -22,18 +22,18 @@
 </table>
 
 <!-- This hidden div is populated and displayed by code in toolbar.timer.js -->
-<div id="djDebugBrowserTiming" hidden="hidden">
+<div id="djDebugBrowserTiming" class="djdt-hidden">
 	<h4>{% trans "Browser timing" %}</h4>
 	<table>
 		<colgroup>
-			<col class="djdt-width-20"/>
-			<col class="djdt-width-60"/>
-			<col class="djdt-width-20"/>
+			<col class="djdt-width-20" />
+			<col class="djdt-width-60" />
+			<col class="djdt-width-20" />
 		</colgroup>
 		<thead>
 			<tr>
 				<th>{% trans "Timing attribute" %}</th>
-				<th class="timeline">{% trans "Timeline" %}</th>
+				<th class="djdt-timeline">{% trans "Timeline" %}</th>
 				<th class="djdt-time">{% trans "Milliseconds since navigation start (+length)" %}</th>
 			</tr>
 		</thead>

+ 8 - 1
desktop/core/src/desktop/templates/debug_toolbar/panels/versions.html

@@ -1,15 +1,22 @@
 {% load i18n %}
 <table>
+	<colgroup>
+		<col style="width:15%" />
+		<col style="width:15%" />
+		<col />
+	</colgroup>
 	<thead>
 		<tr>
+            <th>{% trans "Package" %}</th>
 			<th>{% trans "Name" %}</th>
 			<th>{% trans "Version" %}</th>
 		</tr>
 	</thead>
 	<tbody>
-		{% for package, version in versions.items %}
+		{% for package, name, version in versions %}
 			<tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
 				<td>{{ package }}</td>
+                <td>{{ name }}</td>
 				<td>{{ version }}</td>
 			</tr>
 		{% endfor %}

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini