Open jnns opened 2 years ago
I noticed that, when opening the panel, a request is made to /<page>/static/js/template_profiler.js and it returns with a 404.
/<page>/static/js/template_profiler.js
Using the static helper from contrib.staticfiles makes the panel find the javascript file:
static
contrib.staticfiles
from django.templatetags.static import static class TemplateProfilerPanel(Panel): @property def scripts(self): return [static("js/template_profiler.js")]
But now another problem arises: jQuery is not guaranteed to be available.
We could get around using JavaScript and jQuery altogether by adding a small CSS snippet to the panel's template:
<style> .timeline_item:hover { border: red 0.1px solid !important; } </style>
Please let me know what you think about this approach. I can submit a pull request if you like.
I noticed that, when opening the panel, a request is made to
/<page>/static/js/template_profiler.js
and it returns with a 404.Using the
static
helper fromcontrib.staticfiles
makes the panel find the javascript file:But now another problem arises: jQuery is not guaranteed to be available.
We could get around using JavaScript and jQuery altogether by adding a small CSS snippet to the panel's template:
Please let me know what you think about this approach. I can submit a pull request if you like.