Skip to content

Commit 55a6aef

Browse files
authored
Merge pull request #103 from GeriLife/add-djade-pre-commit
Refactor template block titles for consistency and clarity
2 parents c0a838f + 9209dac commit 55a6aef

File tree

11 files changed

+22
-18
lines changed

11 files changed

+22
-18
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,8 @@ repos:
5454
hooks:
5555
- id: keep-sorted
5656
exclude: ".*migrations/.*"
57+
- repo: https://github.com/adamchainz/djade-pre-commit
58+
rev: "1.3.2"
59+
hooks:
60+
- id: djade
61+
args: [--target-version, "5.1"]

accounts/templates/registration/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{% load i18n %}
44

5-
{% block title %}Log in{% endblock title %}
5+
{% block title %}Log in{% endblock %}
66

77
{% block content %}
88
<div class="card bg-base-100 shadow-xl max-w-md mx-auto">

accounts/templates/registration/signup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{% load i18n %}
44

5-
{% block title %}{% translate "Sign up" %}{% endblock title %}
5+
{% block title %}{% translate "Sign up" %}{% endblock %}
66

77
{% block content %}
88
<div class="card bg-base-100 shadow-xl max-w-md mx-auto">

activities/templates/activities/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ <h1>Activities</h1>
2727
{% endfor %}
2828
</tbody>
2929
</table>
30-
{% endblock %}
30+
{% endblock content %}

activities/templates/activities/resident_activity_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ <h1 class="card-title text-2xl mb-4">{% translate "Create Resident Activity" %}<
172172
</form>
173173
</div>
174174
</div>
175-
{% endblock %}
175+
{% endblock content %}
176176

177177
{% block extra_js %}
178178
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/tom-select.complete.min.js"></script>

activities/templates/activities/resident_activity_list.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{% extends "base.html" %}
22

3-
{% load i18n %}
4-
{% load l10n %}
3+
{% load i18n l10n %}
54

65
{% block title %}
76
{% translate "Activities" %}
8-
{% endblock %}
7+
{% endblock title %}
98

109
{% block content %}
1110
<div class="flex justify-between items-center mb-6">
@@ -81,4 +80,4 @@ <h1 class="text-2xl font-bold">{% translate "Activities" %}</h1>
8180
{% endif %}
8281
</div>
8382
</div>
84-
{% endblock %}
83+
{% endblock content %}

common/templates/403.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
{% block title %}
66
{% translate "Forbidden" %}
7-
{% endblock %}
7+
{% endblock title %}
88

99
{% block content %}
1010
<h1>
1111
{% translate "Forbidden" %}
1212
</h1>
1313

1414
<p>{% translate "You do not have permission to access this page." %}</p>
15-
{% endblock %}
15+
{% endblock content %}

common/templates/base.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<meta charset="UTF-8" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
88
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
9-
<title>{% block title %}{% endblock title %}</title>
9+
<title>{% block title %}{% endblock %}</title>
1010

1111
{% tailwind_css %}
1212

1313
<!-- extra CSS to load after primary CSS -->
1414
<link rel="stylesheet" href="{% static 'style.css' %}" />
15-
{% block extra_css %}{% endblock extra_css %}
15+
{% block extra_css %}{% endblock %}
1616
</head>
1717
<body>
1818
{% include "navigation.html" %} {% if messages %}
@@ -34,10 +34,10 @@
3434
{% endif %}
3535

3636
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
37-
{% block content %} {% endblock content %}
37+
{% block content %} {% endblock %}
3838
</div>
3939

4040
<!-- extra JavaScript to load after other page elements -->
41-
{% block extra_js %}{% endblock extra_js %}
41+
{% block extra_js %}{% endblock %}
4242
</body>
4343
</html>

common/templates/home.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends 'base.html' %}
22
{% load i18n %}
3-
{% block title %}{% translate "Home" %}{% endblock title %}
3+
{% block title %}{% translate "Home" %}{% endblock %}
4+
45
{% block content %}
56
<div class="card bg-base-100 shadow-xl">
67
<div class="card-body">

homes/templates/homes/home_residents_activity_percents.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div
77
class="h-full {% if item.activity_level_class == 'success' %}bg-success{% elif item.activity_level_class == 'warning' %}bg-warning{% elif item.activity_level_class == 'danger' %}bg-error{% else %}bg-info{% endif %}"
88
style="width: {{ item.value|unlocalize }}%;"
9-
aria-label="{{ item.activity_level_label }}: {{ item.value|floatformat:'0'}}%"
9+
aria-label="{{ item.activity_level_label }}: {{ item.value|floatformat:'0' }}%"
1010
title="{{ item.activity_level_label }}: {{ item.value|floatformat:'0' }}%"></div>
1111
{% endfor %}
1212
</div>

0 commit comments

Comments
 (0)