Skip to content

Commit 7eb081c

Browse files
committed
Add djade to dev tools & format the templates
1 parent 9bca204 commit 7eb081c

21 files changed

+96
-91
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,18 @@ Collect static files:
9393
```bash
9494
python source/manage.py collectstatic
9595
```
96+
97+
### Development
98+
99+
#### Check & format code
100+
101+
```bash
102+
ruff check
103+
ruff format
104+
```
105+
106+
### Format templates
107+
108+
```bash
109+
git ls-files -z -- '*.html' | xargs -0 djade --target-version '5.1'
110+
```

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
ruff
2+
djade

source/accounts/templates/accounts/emails/activate_profile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313

1414
<p>
15-
{% trans 'To activate your profile, please follow this link:' %}
15+
{% translate 'To activate your profile, please follow this link:' %}
1616
</p>
1717

1818
<p>

source/accounts/templates/accounts/emails/change_email.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313

1414
<p>
15-
{% trans 'To change your current email address, please follow the link:' %}
15+
{% translate 'To change your current email address, please follow the link:' %}
1616
</p>
1717

1818
<p>

source/accounts/templates/accounts/emails/forgotten_username.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313

1414
<p>
15-
{% trans 'Your username is:' %}
15+
{% translate 'Your username is:' %}
1616
</p>
1717

1818
<p>

source/accounts/templates/accounts/emails/restore_password_email.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<body>
1313

1414
<p>
15-
{% trans 'You received this email because you requested a password reset for your user account.' %}
15+
{% translate 'You received this email because you requested a password reset for your user account.' %}
1616
</p>
1717

1818
<p>
19-
{% trans 'Please, go to the following page and choose a new password:' %}
19+
{% translate 'Please, go to the following page and choose a new password:' %}
2020
</p>
2121

2222
<p>
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
{% extends 'layouts/default/page.html' %}
22

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

65
{% block content %}
76

8-
<h4>{% trans 'Log in' %}</h4>
7+
<h4>{% translate 'Log in' %}</h4>
98

109
<form method="post">
1110

1211
{% csrf_token %}
1312
{% bootstrap_form form %}
1413

15-
<button class="btn btn-primary">{% trans 'Log in' %}</button>
14+
<button class="btn btn-primary">{% translate 'Log in' %}</button>
1615

1716
</form>
1817

1918
<hr>
2019

2120
<ul>
2221
<li>
23-
<a href="{% url 'accounts:restore_password' %}">{% trans 'Forgot your password?' %}</a>
22+
<a href="{% url 'accounts:restore_password' %}">{% translate 'Forgot your password?' %}</a>
2423
</li>
2524
<li>
26-
<a href="{% url 'accounts:remind_username' %}">{% trans 'Forgot your username?' %}</a>
25+
<a href="{% url 'accounts:remind_username' %}">{% translate 'Forgot your username?' %}</a>
2726
</li>
2827
<li>
29-
<a href="{% url 'accounts:resend_activation_code' %}">{% trans 'Resend an activation code' %}</a>
28+
<a href="{% url 'accounts:resend_activation_code' %}">{% translate 'Resend an activation code' %}</a>
3029
</li>
3130
</ul>
3231

33-
{% endblock %}
32+
{% endblock content %}

source/accounts/templates/accounts/log_out.html

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

55
{% block content %}
66

7-
<h4>{% trans 'Logged out' %}</h4>
7+
<h4>{% translate 'Logged out' %}</h4>
88

99
<p>
10-
{% trans 'Thanks for spending some quality time with the site today.' %}
10+
{% translate 'Thanks for spending some quality time with the site today.' %}
1111
</p>
1212

1313
<p>
14-
<a href="{% url 'accounts:log_in' %}">{% trans 'Log in again' %}</a>
14+
<a href="{% url 'accounts:log_in' %}">{% translate 'Log in again' %}</a>
1515
</p>
1616

17-
{% endblock %}
17+
{% endblock content %}

source/accounts/templates/accounts/log_out_confirm.html

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

55
{% block content %}
66

7-
<h4>{% trans 'Log out' %}</h4>
7+
<h4>{% translate 'Log out' %}</h4>
88

99
<p>
10-
{% trans 'Confirm this action:' %}
10+
{% translate 'Confirm this action:' %}
1111
</p>
1212

1313
<form action="{% url 'accounts:log_out' %}" method="post">
1414
{% csrf_token %}
15-
<button class="btn btn-success">{% trans 'Log out' %}</button>
15+
<button class="btn btn-success">{% translate 'Log out' %}</button>
1616
</form>
1717

18-
{% endblock %}
18+
{% endblock content %}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{% extends 'layouts/default/page.html' %}
22

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

65
{% block content %}
76

8-
<h4>{% trans 'Change email' %}</h4>
7+
<h4>{% translate 'Change email' %}</h4>
98

109
<form method="post">
1110

1211
{% csrf_token %}
1312
{% bootstrap_form form %}
1413

15-
<button class="btn btn-success">{% trans 'Change' %}</button>
14+
<button class="btn btn-success">{% translate 'Change' %}</button>
1615

1716
</form>
1817

19-
{% endblock %}
18+
{% endblock content %}

0 commit comments

Comments
 (0)