Skip to content

Commit fbb179e

Browse files
authored
feat: pre-commit djhtml (#693)
1 parent 43ec771 commit fbb179e

24 files changed

+159
-154
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ repos:
2424
- id: conventional-pre-commit
2525
stages: [commit-msg]
2626
args: []
27+
- repo: https://github.com/rtts/djhtml
28+
rev: 3.0.6
29+
hooks:
30+
- id: djhtml
31+
files: .*/templates/.*\.html$

src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% load admin_urls i18n %}
33

44
{% block extrahead %}{{ block.super }}
5-
{{ form.media }}
5+
{{ form.media }}
66
{% endblock %}
77

88
{% block breadcrumbs %}{% if not is_popup %}

src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% load admin_urls i18n %}
44

55
{% block extrahead %}{{ block.super }}
6-
{{ form.media }}
6+
{{ form.media }}
77
{% endblock %}
88

99
{% block breadcrumbs %}{% if not is_popup %}

src/unfold/contrib/import_export/templates/admin/import_export/import.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@
4444
{% endblock %}
4545

4646
{% block content %}
47-
{% if confirm_form %}
48-
{% include "admin/import_export/import_confirm.html" %}
49-
{% else %}
50-
{% include "admin/import_export/import_form.html" %}
51-
{% endif %}
52-
53-
{% if result %}
54-
{% if result.has_errors %}
55-
{% include "admin/import_export/import_errors.html" %}
56-
{% elif result.has_validation_errors %}
57-
{% include "admin/import_export/import_validation.html" %}
47+
{% if confirm_form %}
48+
{% include "admin/import_export/import_confirm.html" %}
5849
{% else %}
59-
{% include "admin/import_export/import_preview.html" %}
50+
{% include "admin/import_export/import_form.html" %}
51+
{% endif %}
52+
53+
{% if result %}
54+
{% if result.has_errors %}
55+
{% include "admin/import_export/import_errors.html" %}
56+
{% elif result.has_validation_errors %}
57+
{% include "admin/import_export/import_validation.html" %}
58+
{% else %}
59+
{% include "admin/import_export/import_preview.html" %}
60+
{% endif %}
6061
{% endif %}
61-
{% endif %}
6262
{% endblock %}

src/unfold/contrib/import_export/templates/admin/import_export/import_errors.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<ul>
77
{% for error in result.base_errors %}
88
<li>
9-
{{ error.error }}
9+
{{ error.error }}
1010

11-
<div class="traceback">{{ error.traceback|linebreaks }}</div></li>
11+
<div class="traceback">{{ error.traceback|linebreaks }}</div></li>
1212
{% endfor %}
1313

1414
{% for line, errors in result.row_errors %}

src/unfold/templates/admin/app_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h3 class="font-medium my-3 text-gray-900 text-sm dark:text-gray-200">
2828
{% if model.admin_url %}
2929
<a href="{{ model.admin_url }}" id="link-{{ app.app_label }}-{{ model.object_name|lower }}"
3030
class="block -mx-3 px-3 py-3 rounded-md truncate {% if model.admin_url in request.path|urlencode %}bg-gray-100 font-semibold text-primary-600 dark:bg-white/[.06] dark:text-primary-500{% else %} hover:text-gray-700 dark:hover:text-gray-200{% endif %}">
31-
{{ model.name }}
31+
{{ model.name }}
3232
</a>
3333
{% else %}
3434
{{ model.name }}

src/unfold/templates/admin/auth/user/add_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
{% else %}
99
{% translate "Enter a username and password." %}x
1010
{% endif %}
11-
<p>
11+
<p>
1212
{% endblock %}

src/unfold/templates/admin/base_site.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
44

55
{% block branding %}
6-
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
6+
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
77
{% endblock %}
88

99
{% block nav-global %}{% endblock %}

src/unfold/templates/admin/change_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
{% endif %}
4545

4646
{% block nav-global %}{% spaceless %}
47-
{% if change and not is_popup %}
47+
{% if change and not is_popup %}
4848
{% block object-tools-items %}
4949
{% change_form_object_tools %}
5050
{% endblock %}

src/unfold/templates/admin/change_list.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
{% load i18n admin_urls static admin_list unfold_list %}
33

44
{% block extrastyle %}
5-
{{ block.super }}
5+
{{ block.super }}
66

7-
{% if cl.formset %}
8-
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">
9-
{% endif %}
7+
{% if cl.formset %}
8+
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">
9+
{% endif %}
1010

1111

1212
<script src="{% url 'admin:jsi18n' %}"></script>
1313

14-
{{ media.css }}
14+
{{ media.css }}
1515

16-
{% if not actions_on_top and not actions_on_bottom %}
17-
<style>
18-
#changelist table thead th:first-child {width: inherit}
19-
</style>
20-
{% endif %}
16+
{% if not actions_on_top and not actions_on_bottom %}
17+
<style>
18+
#changelist table thead th:first-child {width: inherit}
19+
</style>
20+
{% endif %}
2121
{% endblock %}
2222

2323
{% block extrahead %}

0 commit comments

Comments
 (0)