Skip to content

Commit aef9778

Browse files
authored
Feature/add djade into pre commit config (#115)
* Add Djade into pre-commit config * Re-format templates
1 parent 838427a commit aef9778

Some content is hidden

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

56 files changed

+391
-400
lines changed

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ repos:
4040
hooks:
4141
- id: flake8
4242
args: ["--config=setup.cfg"]
43+
44+
- repo: https://github.com/adamchainz/djade-pre-commit
45+
rev: 1.3.2
46+
hooks:
47+
- id: djade
48+
args: [--target-version, "5.1"]

svjis/articles/templates/admin_board.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44

55
{% block content %}
66

7-
<h1 class="page-title" id="tbl-desc">{% trans 'Board' %}</h1>
8-
[<a href="{% url 'admin_board_edit' pk=0 %}">{% trans 'Add new member' %}</a>]
7+
<h1 class="page-title" id="tbl-desc">{% translate 'Board' %}</h1>
8+
[<a href="{% url 'admin_board_edit' pk=0 %}">{% translate 'Add new member' %}</a>]
99

1010
<table class="list" aria-describedby="tbl-desc">
1111
<tr>
1212
<th class="list" scope="col">&nbsp;</th>
1313
<th class="list" scope="col">&nbsp;</th>
1414
<th class="list" scope="col">&nbsp;</th>
15-
<th class="list" scope="col">{% trans 'Member' %}</th>
16-
<th class="list" scope="col">{% trans 'Position' %}</th>
15+
<th class="list" scope="col">{% translate 'Member' %}</th>
16+
<th class="list" scope="col">{% translate 'Position' %}</th>
1717
</tr>
1818

1919
{% if object_list %}
2020
{% for obj in object_list %}
2121
<tr>
2222
<td class="list">{{ forloop.counter }}</td>
23-
<td class="list"><a href="{% url 'admin_board_edit' pk=obj.pk %}"><img src="/static/gfx/pencil.png" border="0" title="{% trans 'Edit' %}" alt="{% trans 'Edit' %}"></a></td>
24-
<td class="list"><a onclick="if (!confirm('{% trans 'Do you want to delete' %} {{ obj.member.userprofile.salutation }}&nbsp;{{ obj.member.first_name }}&nbsp;{{ obj.member.last_name }} ?')) return false;" href="{% url 'admin_board_delete' pk=obj.id %}"><img src="/static/gfx/delete.png" border="0" title="{% trans 'Delete' %}" alt="{% trans 'Delete' %}"></a></td>
23+
<td class="list"><a href="{% url 'admin_board_edit' pk=obj.pk %}"><img src="/static/gfx/pencil.png" border="0" title="{% translate 'Edit' %}" alt="{% translate 'Edit' %}"></a></td>
24+
<td class="list"><a onclick="if (!confirm('{% translate 'Do you want to delete' %} {{ obj.member.userprofile.salutation }}&nbsp;{{ obj.member.first_name }}&nbsp;{{ obj.member.last_name }} ?')) return false;" href="{% url 'admin_board_delete' pk=obj.id %}"><img src="/static/gfx/delete.png" border="0" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
2525
<td class="list">{{ obj.member.userprofile.salutation }}&nbsp;{{ obj.member.first_name }}&nbsp;{{ obj.member.last_name }}</td>
2626
<td class="list">{{ obj.position }}</td>
2727
</tr>
2828
{% endfor %}
2929
{% endif %}
3030
</table>
3131

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

svjis/articles/templates/admin_board_edit.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
{% block content %}
66

7-
<h1 class="page-title">{% trans 'Board' %}</h1>
7+
<h1 class="page-title">{% translate 'Board' %}</h1>
88
<form action="{% url 'admin_board_save' %}" method="post">
99
{% csrf_token %}
1010
<input type="hidden" name="pk" value="{{ pk }}">
1111

1212
<fieldset>
13-
<legend>{% trans 'Board' %}</legend>
13+
<legend>{% translate 'Board' %}</legend>
1414
<p>
1515
<label class="common-label" for="{{ form.order.auto_id }}">{{ form.order.label }}</label>
1616
{{ form.order }}
@@ -25,8 +25,8 @@ <h1 class="page-title">{% trans 'Board' %}</h1>
2525
</p>
2626
</fieldset>
2727
<p>
28-
<input class="my-button" id="submit" type="submit" value="{% trans 'Save' %}" />
28+
<input class="my-button" id="submit" type="submit" value="{% translate 'Save' %}" />
2929
</p>
3030
</form>
3131

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

svjis/articles/templates/admin_building_edit.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
{% block content %}
66

7-
<h1 class="page-title">{% trans 'Building' %}</h1>
7+
<h1 class="page-title">{% translate 'Building' %}</h1>
88
<form action="{% url 'admin_building_save' %}" method="post">
99
{% csrf_token %}
1010
<fieldset>
11-
<legend>{% trans 'Building' %}</legend>
11+
<legend>{% translate 'Building' %}</legend>
1212
<p>
1313
<label class="common-label" for="{{ form.address.auto_id }}">{{ form.address.label }}</label>
1414
{{ form.address }}
@@ -27,8 +27,8 @@ <h1 class="page-title">{% trans 'Building' %}</h1>
2727
</p>
2828
</fieldset>
2929
<p>
30-
<input class="my-button" id="submit" type="submit" value="{% trans 'Save' %}" />
30+
<input class="my-button" id="submit" type="submit" value="{% translate 'Save' %}" />
3131
</p>
3232
</form>
3333

34-
{% endblock %}
34+
{% endblock content %}

svjis/articles/templates/admin_building_unit.html

+17-17
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,45 @@
44

55
{% block content %}
66

7-
<h1 class="page-title" id="tbl-desc">{% trans 'Building units' %}</h1>
7+
<h1 class="page-title" id="tbl-desc">{% translate 'Building units' %}</h1>
88

99
<div class="container">
1010
<div class="row">
1111

1212
<div class="left">
13-
<p>[<a href="{% url 'admin_building_unit_edit' pk=0 %}">{% trans 'Add new unit' %}</a>]</p>
13+
<p>[<a href="{% url 'admin_building_unit_edit' pk=0 %}">{% translate 'Add new unit' %}</a>]</p>
1414
</div>
1515

1616
<div class="middle">
17-
<p>[<a href="{% url 'admin_building_unit_export_to_excel' %}">{% trans 'Export to Excel' %}</a>]</p>
17+
<p>[<a href="{% url 'admin_building_unit_export_to_excel' %}">{% translate 'Export to Excel' %}</a>]</p>
1818
</div>
1919

2020
<div class="right">
21-
<p>{% trans 'Type' %}</p>
21+
<p>{% translate 'Type' %}</p>
2222
</div>
2323
<div class="middle">
2424
<p>
2525
<form action="{% url 'admin_building_unit' %}" method="get">
2626
<select name='type_filter' onchange='this.form.submit()'>
2727
<option value="0">-------</option>
2828
{% for t in type_list %}
29-
<option value="{{ t.pk }}" {% if type_filter == t.pk %}selected{% endif %}>{{ t.description }}</option>
29+
<option value="{{ t.pk }}" {% if type_filter == t.pk %}selected{% endif %}>{{ t.description }}</option>
3030
{% endfor %}
3131
</select>
3232
</form>
3333
</p>
3434
</div>
3535

3636
<div class="right">
37-
<p>{% trans 'Entrance' %}</p>
37+
<p>{% translate 'Entrance' %}</p>
3838
</div>
3939
<div class="right">
4040
<p>
4141
<form action="{% url 'admin_building_unit' %}" method="get">
4242
<select name='entrance_filter' onchange='this.form.submit()'>
4343
<option value="0">-------</option>
4444
{% for e in entrance_list %}
45-
<option value="{{ e.pk }}" {% if entrance_filter == e.pk %}selected{% endif %}>{{ e.description }}</option>
45+
<option value="{{ e.pk }}" {% if entrance_filter == e.pk %}selected{% endif %}>{{ e.description }}</option>
4646
{% endfor %}
4747
</select>
4848
</form>
@@ -58,21 +58,21 @@ <h1 class="page-title" id="tbl-desc">{% trans 'Building units' %}</h1>
5858
<th class="list" scope="col">&nbsp;</th>
5959
<th class="list" scope="col">&nbsp;</th>
6060
<th class="list" scope="col">&nbsp;</th>
61-
<th class="list" scope="col">{% trans 'Type' %}</th>
62-
<th class="list" scope="col">{% trans 'Entrance' %}</th>
63-
<th class="list" scope="col">{% trans 'Registration Id' %}</th>
64-
<th class="list" scope="col">{% trans 'Description' %}</th>
65-
<th class="list" scope="col">{% trans 'Numerator' %}</th>
66-
<th class="list" scope="col">{% trans 'Denominator' %}</th>
61+
<th class="list" scope="col">{% translate 'Type' %}</th>
62+
<th class="list" scope="col">{% translate 'Entrance' %}</th>
63+
<th class="list" scope="col">{% translate 'Registration Id' %}</th>
64+
<th class="list" scope="col">{% translate 'Description' %}</th>
65+
<th class="list" scope="col">{% translate 'Numerator' %}</th>
66+
<th class="list" scope="col">{% translate 'Denominator' %}</th>
6767
</tr>
6868

6969
{% if object_list %}
7070
{% for obj in object_list %}
7171
<tr>
7272
<td class="list">{{ forloop.counter }}</td>
73-
<td class="list"><a href="{% url 'admin_building_unit_edit' pk=obj.pk %}"><img src="/static/gfx/pencil.png" border="0" title="{% trans 'Edit' %}" alt="{% trans 'Edit' %}"></a></td>
74-
<td class="list"><a href="{% url 'admin_building_unit_owners' pk=obj.pk %}"><img src="/static/gfx/user.png" border="0" title="{% trans 'Owners' %}" alt="{% trans 'Owners' %}"></a></td>
75-
<td class="list"><a onclick="if (!confirm('{% trans 'Do you want to delete' %} {{ obj.type.description }} {{ obj.description }} ?')) return false;" href="{% url 'admin_building_unit_delete' pk=obj.id %}"><img src="/static/gfx/delete.png" border="0" title="{% trans 'Delete' %}" alt="{% trans 'Delete' %}"></a></td>
73+
<td class="list"><a href="{% url 'admin_building_unit_edit' pk=obj.pk %}"><img src="/static/gfx/pencil.png" border="0" title="{% translate 'Edit' %}" alt="{% translate 'Edit' %}"></a></td>
74+
<td class="list"><a href="{% url 'admin_building_unit_owners' pk=obj.pk %}"><img src="/static/gfx/user.png" border="0" title="{% translate 'Owners' %}" alt="{% translate 'Owners' %}"></a></td>
75+
<td class="list"><a onclick="if (!confirm('{% translate 'Do you want to delete' %} {{ obj.type.description }} {{ obj.description }} ?')) return false;" href="{% url 'admin_building_unit_delete' pk=obj.id %}"><img src="/static/gfx/delete.png" border="0" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
7676
<td class="list">{{ obj.type.description }}</td>
7777
<td class="list">{{ obj.entrance.description }}</td>
7878
<td class="list">{{ obj.registration_id }}</td>
@@ -84,4 +84,4 @@ <h1 class="page-title" id="tbl-desc">{% trans 'Building units' %}</h1>
8484
{% endif %}
8585
</table>
8686

87-
{% endblock %}
87+
{% endblock content %}

svjis/articles/templates/admin_building_unit_edit.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
{% block content %}
66

7-
<h1 class="page-title">{% trans 'Building unit' %}</h1>
7+
<h1 class="page-title">{% translate 'Building unit' %}</h1>
88
<form action="{% url 'admin_building_unit_save' %}" method="post">
99
{% csrf_token %}
1010
<input type="hidden" name="pk" value="{{ pk }}">
1111

1212
<fieldset>
13-
<legend>{% trans 'Building unit' %}</legend>
13+
<legend>{% translate 'Building unit' %}</legend>
1414
<p>
1515
<label class="common-label" for="{{ form.type.auto_id }}">{{ form.type.label }}</label>
1616
{{ form.type }}
@@ -38,8 +38,8 @@ <h1 class="page-title">{% trans 'Building unit' %}</h1>
3838
</fieldset>
3939

4040
<p>
41-
<input class="my-button" id="submit" type="submit" value="{% trans 'Save' %}" />
41+
<input class="my-button" id="submit" type="submit" value="{% translate 'Save' %}" />
4242
</p>
4343
</form>
4444

45-
{% endblock %}
45+
{% endblock content %}

svjis/articles/templates/admin_building_unit_owners_edit.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ <h1 class="page-title" id="tbl-desc">{{ bu.type.description }} - {{ bu.registrat
99
<table class="list" aria-describedby="tbl-desc">
1010
<tr>
1111
<th class="list" scope="col">&nbsp;</th>
12-
<th class="list" scope="col">{% trans 'First Name' %}</th>
13-
<th class="list" scope="col">{% trans 'Last Name' %}</th>
12+
<th class="list" scope="col">{% translate 'First Name' %}</th>
13+
<th class="list" scope="col">{% translate 'Last Name' %}</th>
1414
<th class="list" scope="col">&nbsp;</th>
1515
</tr>
1616

@@ -20,7 +20,7 @@ <h1 class="page-title" id="tbl-desc">{{ bu.type.description }} - {{ bu.registrat
2020
<td class="list">{{ forloop.counter }}</td>
2121
<td class="list">{{ obj.first_name }}</td>
2222
<td class="list">{{ obj.last_name }}</td>
23-
<td class="list"><a href="{% url 'admin_building_unit_owners_delete' pk=pk owner=obj.pk %}"><img src="/static/gfx/delete.png" border="0" title="{% trans 'Delete' %}" alt="{% trans 'Delete' %}"></a></td>
23+
<td class="list"><a href="{% url 'admin_building_unit_owners_delete' pk=pk owner=obj.pk %}"><img src="/static/gfx/delete.png" border="0" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
2424
</tr>
2525
{% endfor %}
2626
{% endif %}
@@ -36,8 +36,8 @@ <h1 class="page-title" id="tbl-desc">{{ bu.type.description }} - {{ bu.registrat
3636
<option value="{{ u.id }}">{{ u.last_name }} {{ u.first_name }}</option>
3737
{% endfor %}
3838
</select>
39-
<input id="submit" type="submit" value="{% trans 'Add' %}" />
39+
<input id="submit" type="submit" value="{% translate 'Add' %}" />
4040
</form>
4141
{% endif %}
4242

43-
{% endblock %}
43+
{% endblock content %}

svjis/articles/templates/admin_company_edit.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
{% block content %}
66

7-
<h1 class="page-title">{% trans 'Company' %}</h1>
7+
<h1 class="page-title">{% translate 'Company' %}</h1>
88
<form action="{% url 'admin_company_save' %}" method="post" enctype="multipart/form-data">
99
{% csrf_token %}
1010
<fieldset>
11-
<legend>{% trans 'Company' %}</legend>
11+
<legend>{% translate 'Company' %}</legend>
1212
<p>
1313
<label class="common-label" for="{{ form.name.auto_id }}">{{ form.name.label }}</label>
1414
{{ form.name }}
@@ -50,12 +50,12 @@ <h1 class="page-title">{% trans 'Company' %}</h1>
5050
{{ form.header_picture }}
5151
</p>
5252
{% if form.instance.header_picture %}
53-
<p><img src="/media/{{ form.instance.header_picture }}" alt="{% trans 'Company header' %}" width="80%" height="80%"></p>
53+
<p><img src="/media/{{ form.instance.header_picture }}" alt="{% translate 'Company header' %}" width="80%" height="80%"></p>
5454
{% endif %}
5555
</fieldset>
5656
<p>
57-
<input class="my-button" id="submit" type="submit" value="{% trans 'Save' %}" />
57+
<input class="my-button" id="submit" type="submit" value="{% translate 'Save' %}" />
5858
</p>
5959
</form>
6060

61-
{% endblock %}
61+
{% endblock content %}

svjis/articles/templates/admin_entrance.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44

55
{% block content %}
66

7-
<h1 class="page-title" id="tbl-desc">{% trans 'Entrances' %}</h1>
8-
[<a href="{% url 'admin_entrance_edit' pk=0 %}">{% trans 'Add new entrance' %}</a>]
7+
<h1 class="page-title" id="tbl-desc">{% translate 'Entrances' %}</h1>
8+
[<a href="{% url 'admin_entrance_edit' pk=0 %}">{% translate 'Add new entrance' %}</a>]
99

1010
<table class="list" aria-describedby="tbl-desc">
1111
<tr>
1212
<th class="list" scope="col">&nbsp;</th>
1313
<th class="list" scope="col">&nbsp;</th>
1414
<th class="list" scope="col">&nbsp;</th>
15-
<th class="list" scope="col">{% trans 'Description' %}</th>
16-
<th class="list" scope="col">{% trans 'Address' %}</th>
15+
<th class="list" scope="col">{% translate 'Description' %}</th>
16+
<th class="list" scope="col">{% translate 'Address' %}</th>
1717
</tr>
1818

1919
{% if object_list %}
2020
{% for obj in object_list %}
2121
<tr>
2222
<td class="list">{{ forloop.counter }}</td>
23-
<td class="list"><a href="{% url 'admin_entrance_edit' pk=obj.pk %}"><img src="/static/gfx/pencil.png" border="0" title="{% trans 'Edit' %}" alt="{% trans 'Edit' %}"></a></td>
24-
<td class="list"><a onclick="if (!confirm('{% trans 'Do you want to delete' %} {{ obj.description }} ?')) return false;" href="{% url 'admin_entrance_delete' pk=obj.id %}"><img src="/static/gfx/delete.png" border="0" title="{% trans 'Delete' %}" alt="{% trans 'Delete' %}"></a></td>
23+
<td class="list"><a href="{% url 'admin_entrance_edit' pk=obj.pk %}"><img src="/static/gfx/pencil.png" border="0" title="{% translate 'Edit' %}" alt="{% translate 'Edit' %}"></a></td>
24+
<td class="list"><a onclick="if (!confirm('{% translate 'Do you want to delete' %} {{ obj.description }} ?')) return false;" href="{% url 'admin_entrance_delete' pk=obj.id %}"><img src="/static/gfx/delete.png" border="0" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
2525
<td class="list">{{ obj.description }}</td>
2626
<td class="list">{{ obj.address }}</td>
2727
</tr>
2828
{% endfor %}
2929
{% endif %}
3030
</table>
3131

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

svjis/articles/templates/admin_entrance_edit.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
{% block content %}
66

7-
<h1 class="page-title">{% trans 'Entrances' %}</h1>
7+
<h1 class="page-title">{% translate 'Entrances' %}</h1>
88
<form action="{% url 'admin_entrance_save' %}" method="post">
99
{% csrf_token %}
1010
<input type="hidden" name="pk" value="{{ pk }}">
1111

1212
<fieldset>
13-
<legend>{% trans 'Entrance' %}</legend>
13+
<legend>{% translate 'Entrance' %}</legend>
1414
<p>
1515
<label class="common-label" for="{{ form.description.auto_id }}">{{ form.description.label }}</label>
1616
{{ form.description }}
@@ -22,8 +22,8 @@ <h1 class="page-title">{% trans 'Entrances' %}</h1>
2222
</fieldset>
2323

2424
<p>
25-
<input class="my-button" id="submit" type="submit" value="{% trans 'Save' %}" />
25+
<input class="my-button" id="submit" type="submit" value="{% translate 'Save' %}" />
2626
</p>
2727
</form>
2828

29-
{% endblock %}
29+
{% endblock content %}

svjis/articles/templates/admin_group.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44

55
{% block content %}
66

7-
<h1 class="page-title" id="tbl-desc">{% trans 'Group' %}</h1>
8-
[<a href="{% url 'admin_group_edit' pk=0 %}">{% trans 'Create new group' %}</a>]
7+
<h1 class="page-title" id="tbl-desc">{% translate 'Group' %}</h1>
8+
[<a href="{% url 'admin_group_edit' pk=0 %}">{% translate 'Create new group' %}</a>]
99

1010
<table class="list" aria-describedby="tbl-desc">
1111
<tr>
1212
<th class="list" scope="col">&nbsp;</th>
1313
<th class="list" scope="col">&nbsp;</th>
1414
<th class="list" scope="col">&nbsp;</th>
1515
<th class="list" scope="col">&nbsp;</th>
16-
<th class="list" scope="col">{% trans 'Name' %}</th>
16+
<th class="list" scope="col">{% translate 'Name' %}</th>
1717
</tr>
1818

1919
{% if object_list %}
2020
{% for obj in object_list %}
2121
<tr>
2222
<td class="list">{{ forloop.counter }}</td>
23-
<td class="list"><a href="{% url 'admin_group_edit' pk=obj.pk %}"><img src="/static/gfx/pencil.png" border="0" title="{% trans 'Edit' %}" alt="{% trans 'Edit' %}"></a></td>
24-
<td class="list"><a href="{% url 'admin_user' %}?group_filter={{ obj.pk }}"><img src="/static/gfx/user.png" border="0" title="{% trans 'List of users' %}" alt="{% trans 'List of users' %}"></a></td>
25-
<td class="list"><a onclick="if (!confirm('{% trans 'Do you want to delete' %} {{ obj.name }} ?')) return false;" href="{% url 'admin_group_delete' pk=obj.id %}"><img src="/static/gfx/delete.png" border="0" title="{% trans 'Delete' %}" alt="{% trans 'Delete' %}"></a></td>
23+
<td class="list"><a href="{% url 'admin_group_edit' pk=obj.pk %}"><img src="/static/gfx/pencil.png" border="0" title="{% translate 'Edit' %}" alt="{% translate 'Edit' %}"></a></td>
24+
<td class="list"><a href="{% url 'admin_user' %}?group_filter={{ obj.pk }}"><img src="/static/gfx/user.png" border="0" title="{% translate 'List of users' %}" alt="{% translate 'List of users' %}"></a></td>
25+
<td class="list"><a onclick="if (!confirm('{% translate 'Do you want to delete' %} {{ obj.name }} ?')) return false;" href="{% url 'admin_group_delete' pk=obj.id %}"><img src="/static/gfx/delete.png" border="0" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
2626
<td class="list">{{ obj.name }}</td>
2727
</tr>
2828
{% endfor %}
2929
{% endif %}
3030
</table>
3131

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

0 commit comments

Comments
 (0)