Skip to content

Commit 892f574

Browse files
committed
Add djade linter and format templates
1 parent adf83cf commit 892f574

File tree

88 files changed

+252
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+252
-192
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ locale/*/LC_MESSAGES/django.mo
1515
djangoproject/cache
1616
djangoproject/static/css/*.map
1717
djangoproject/static/css/*.css
18+
.DS_Store

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,8 @@ repos:
6464
rev: 0.2.2
6565
hooks:
6666
- id: checkmake
67+
- repo: https://github.com/adamchainz/djade-pre-commit
68+
rev: 1.6.0
69+
hooks:
70+
- id: djade
71+
args: [--target-version, "4.2"]
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
{% extends "base.html" %}
2-
{% load i18n %}
3-
{% load static %}
2+
{% load i18n static %}
43

54
{% block sectionid %}dashboard{% endblock %}
65

76
{% block title %}{% translate 'Development dashboard' %}{% endblock %}
7+
88
{% block layout_class %}full-width{% endblock %}
9+
910
{% block header %}
1011
<h1>Development <em>dashboard</em></h1>
11-
{% endblock %}
12+
{% endblock header %}
1213

1314
{% block javascript %}
1415
<script src="{% static "js/lib/jquery.min.js" %}"></script>
1516
<script src="{% static "js/lib/jquery.flot.min.js" %}"></script>
1617
<script src="{% static "js/dashboard/utils.js" %}"></script>
17-
{% endblock %}
18+
{% endblock javascript %}

dashboard/templates/dashboard/detail.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ <h2><a href="{{ metric.link }}">{{ metric }}</a></h2>
1111
</div>
1212
<a class="link-readmore back-link" href="{% url "dashboard-index" host "dashboard" %}">{% translate "All metrics" %}</a>
1313
</div>
14-
{% endblock %}
14+
{% endblock content %}
1515

1616
{% block javascript %}
1717
{{ block.super }}
1818

1919
<script src="{% static "js/dashboard/detail.js" %}"></script>
20-
{% endblock %}
20+
{% endblock javascript %}

dashboard/templates/dashboard/index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% extends "base_dashboard.html" %}
2-
{% load i18n %}
3-
{% load static %}
2+
{% load i18n static %}
43

54
{% block content %}
65
<div>
@@ -23,10 +22,10 @@ <h3><a href="{{ report.metric.link }}">{{ report.metric.name }}</a></h3>
2322
{% blocktranslate with timestamp=data.0.latest.timestamp|timesince %}Updated {{ timestamp }} ago.{% endblocktranslate %}
2423
</p>
2524
</div>
26-
{% endblock %}
25+
{% endblock content %}
2726

2827
{% block javascript %}
2928
{{ block.super }}
3029

3130
<script src="{% static "js/dashboard/index.js" %}"></script>
32-
{% endblock %}
31+
{% endblock javascript %}

djangoproject/templates/400.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
<h2>{% translate "Bad request" %}</h2>
1010

1111
<p>{% translate "Yikes, this was a bad request. Not sure why, but it sure was bad." %}</p>
12-
{% endblock %}
12+
{% endblock content %}

djangoproject/templates/403.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
<h2>{% translate "Permission denied" %}</h2>
1010

1111
<p>{% translate "Apologies, but it seems as if you're not allowed to access this page. We honestly hope this is just a mistake." %}</p>
12-
{% endblock %}
12+
{% endblock content %}

djangoproject/templates/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ <h2>{% translate "Page not found" %}</h2>
2020
Here's a link to the <a href="{{ homepage_url }}">homepage</a>. You know, just in case.
2121
{% endblocktranslate %}</p>
2222

23-
{% endblock %}
23+
{% endblock content %}

djangoproject/templates/410.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ <h2>{% translate "Page removed." %}</h2>
2323
{% endblocktranslate %}
2424
</p>
2525

26-
{% endblock %}
26+
{% endblock content %}

djangoproject/templates/500.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ <h2>{% translate "Page unavailable" %}</h2>
1313
<p>{% translate "We're messing around with things internally, and the server had a bit of a hiccup." %}</p>
1414

1515
<p>{% translate "Please try again later." %}</p>
16-
{% endblock %}
16+
{% endblock content %}

0 commit comments

Comments
 (0)