Skip to content

Commit 5b758c1

Browse files
committed
Format mql_query and fix dhtml pre-commit hook
1 parent 783a966 commit 5b758c1

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ repos:
2020
hooks:
2121
- id: djhtml
2222
entry: djhtml --tabwidth 2
23-
files: django_mongodb_extensions/templates/debug_toolbar/panels/mql.html

django_mongodb_extensions/templates/mql_panel/mql_query.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ <h3>{% translate "Query Results" %}</h3>
1414
<dd>{{ alias }}</dd>
1515
</dl>
1616
<h4>{% translate "Query Results" %}</h4>
17-
<table>
18-
<thead>
17+
<table>
18+
<thead>
19+
<tr>
20+
{% for h in headers %}
21+
<th>{{ h|upper }}</th>
22+
{% endfor %}
23+
</tr>
24+
</thead>
25+
<tbody>
26+
{% for row in result %}
1927
<tr>
20-
{% for h in headers %}
21-
<th>{{ h|upper }}</th>
28+
{% for column in row %}
29+
<td>
30+
{% if column.is_json %}
31+
<pre style="margin: 0; padding: 0; border: none; background: none; white-space: pre-wrap; word-wrap: break-word; font-family: inherit;">{{ column.value|escape }}</pre>
32+
{% else %}
33+
{{ column.value|escape }}
34+
{% endif %}
35+
</td>
2236
{% endfor %}
2337
</tr>
24-
</thead>
25-
<tbody>
26-
{% for row in result %}
27-
<tr>
28-
{% for column in row %}
29-
<td>
30-
{% if column.is_json %}
31-
<pre style="margin: 0; padding: 0; border: none; background: none; white-space: pre-wrap; word-wrap: break-word; font-family: inherit;">{{ column.value|escape }}</pre>
32-
{% else %}
33-
{{ column.value|escape }}
34-
{% endif %}
35-
</td>
36-
{% endfor %}
37-
</tr>
38-
{% empty %}
39-
<tr><td colspan="{{ headers|length }}">{% translate "Empty set" %}</td></tr>
40-
{% endfor %}
41-
</tbody>
42-
</table>
38+
{% empty %}
39+
<tr><td colspan="{{ headers|length }}">{% translate "Empty set" %}</td></tr>
40+
{% endfor %}
41+
</tbody>
42+
</table>
4343
</div>
4444
</div>

0 commit comments

Comments
 (0)