Skip to content

Commit d2406ca

Browse files
committed
Apply djlint to all jinja2 templates
1 parent 4521f01 commit d2406ca

41 files changed

Lines changed: 1149 additions & 1037 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
{% extends '/core/home.jinja2' %}
2-
3-
{% block extra_css %}
4-
<link rel="stylesheet" href="{{ static('css/blog.css') }}">
5-
{% endblock %}
6-
2+
{% block extra_css %}<link rel="stylesheet" href="{{ static('css/blog.css') }}">{% endblock %}
73
{% block content %}
84
<div id="clipping-area">
9-
{% block button %}
10-
{% endblock %}
5+
{% block button %}{% endblock %}
116
{% block page_title %}
127
<h2>{{ _("Clipping") }}</h2>
138
{% endblock page_title %}
14-
<small id="warning">{{_( "The content below is in the original languages.")}}</small>
9+
<small id="warning">{{ _("The content below is in the original languages.") }}</small>
1510
{% for clipping in clippings %}
1611
<div class="clipping">
17-
<h3>{{ clipping.title }}</h3>
12+
<h3>{{ clipping.title }}</h3>
1813
<small>{{ clipping.created.date().strftime('%d %B %Y') }}</small>
1914
<p>{{ clipping.description }}</p>
2015
<small><a href="{{ clipping.link }}">{{ clipping.link }}</a></small>
21-
{%if clipping.file.url[-3:] == "pdf" %}
22-
<a href="{{ clipping.file.url }}">{{ _("View as PDF")}}</a>
16+
{% if clipping.file.url[-3:] == "pdf" %}
17+
<a href="{{ clipping.file.url }}">{{ _("View as PDF") }}</a>
2318
{% elif clipping.file.url[-3:] in ["png","jpg"] %}
24-
<a href="{{ clipping.file.url }}">{{ _("View as JPG")}}</a>
19+
<a href="{{ clipping.file.url }}">{{ _("View as JPG") }}</a>
2520
{% else %}
26-
<a href="{{ clipping.file.url }}">{{ _("View File")}}</a>
21+
<a href="{{ clipping.file.url }}">{{ _("View File") }}</a>
2722
{% endif %}
2823
</div>
2924
{% endfor %}
3025
</div>
31-
{% endblock %}
26+
{% endblock %}

src/blog/jinja2/blog/detail.jinja2

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{% extends "blog/index.jinja2" %}
2-
32
{% block content %}
43
<div id="post-area">
5-
<a id="back-button" href="{{ url('blog_index') }}">{{ _('< Back to Blog') }}</a>
4+
<a id="back-button" href="{{ url('blog_index') }}">{{ _("< Back to Blog") }}</a>
65
<br />
76
{% block page_title %}
87
<h2>{{ post.title }}</h2>
@@ -12,15 +11,11 @@
1211
{% for image in images %}
1312
<div class="post-image">
1413
<img class="post-image" src="{{ image.file.url }}" />
15-
{% if image.description %}
16-
<small>{{ image.description }}</small>
17-
{% endif %}
14+
{% if image.description %}<small>{{ image.description }}</small>{% endif %}
1815
</div>
1916
{% endfor %}
2017
</div>
21-
2218
</div>
2319
<br />
24-
<a href="#" id="back-to-top"> {{_("Back to Top")}}</a>
25-
26-
{% endblock %}
20+
<a href="#" id="back-to-top">{{ _("Back to Top") }}</a>
21+
{% endblock %}

src/blog/jinja2/blog/index.jinja2

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
{% extends '/core/home.jinja2' %}
2-
3-
{% block extra_css %}
4-
<link rel="stylesheet" href="{{ static('css/blog.css') }}">
5-
{% endblock %}
6-
2+
{% block extra_css %}<link rel="stylesheet" href="{{ static('css/blog.css') }}">{% endblock %}
73
{% block content %}
84
<div id="blog-area">
9-
{% block button %}
10-
{% endblock %}
5+
{% block button %}{% endblock %}
116
{% block page_title %}
127
<h2>{{ _("Memories") }}</h2>
138
{% endblock page_title %}
14-
<div id="posts-area">
15-
{% include "/blog/post_preview.jinja2" %}
16-
</div>
9+
<div id="posts-area">{% include "/blog/post_preview.jinja2" %}</div>
1710
</div>
18-
{% endblock %}
11+
{% endblock %}
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
{% for post in posts %}
22
<div class="post">
3-
<h3><a href="{{ url('post_detail', args=[post.pk])}}">{{ post.title }}</a></h3>
4-
<p>{{ post.body[:PREVIEW_SIZE] | safe }}... <a href="{{ url('post_detail', args=[post.pk])}}">{{ _("Read More") }}</a></p>
3+
<h3>
4+
<a href="{{ url('post_detail', args=[post.pk]) }}">{{ post.title }}</a>
5+
</h3>
6+
<p>
7+
{{ post.body[:PREVIEW_SIZE] | safe }}... <a href="{{ url('post_detail', args=[post.pk]) }}">{{ _("Read More") }}</a>
8+
</p>
59
</div>
610
{% endfor %}
711
{% if next_page_number <= total_pages %}
8-
<button hx-get="{{ page_url }}?page={{ next_page_number }}" hx-trigger="click" hx-swap="outerHTML"> {{_("See more")}}</button>
9-
{% endif %}
12+
<button hx-get="{{ page_url }}?page={{ next_page_number }}"
13+
hx-trigger="click"
14+
hx-swap="outerHTML">{{ _("See more") }}</button>
15+
{% endif %}
Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<!-- Global site tag (gtag.js) - Google Analytics -->
@@ -15,35 +15,29 @@
1515
<title>Jandig</title>
1616
<meta name="Description" content="Augmented reality art!">
1717
<meta name="viewport" content="width=device-width, initial-scale=1">
18-
19-
<link href="https://fonts.googleapis.com/css?family=Istok+Web:400,400i,700,700i&display=swap" rel="stylesheet">
20-
21-
<link rel="shortcut icon" href="{{ static('images/icons/favicon.ico') }}" type="image/x-icon" />
22-
{% block extra_css %}
23-
{% endblock %}
24-
{% block extra_js %}
25-
{% endblock %}
18+
<link href="https://fonts.googleapis.com/css?family=Istok+Web:400,400i,700,700i&display=swap"
19+
rel="stylesheet">
20+
<link rel="shortcut icon"
21+
href="{{ static('images/icons/favicon.ico') }}"
22+
type="image/x-icon" />
23+
{% block extra_css %}{% endblock %}
24+
{% block extra_js %}{% endblock %}
2625
</head>
27-
28-
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8=" crossorigin="anonymous"></script>
29-
26+
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
27+
integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8="
28+
crossorigin="anonymous"></script>
3029
<script src="{{ static('js/bowser.js') }}"></script>
3130
<script src="{{ static('js/detect.js') }}"></script>
3231
<script src="{{ static('js/main.js') }}"></script>
33-
3432
<body class="colorful">
3533
{% if content is defined %}
3634
<section>
3735
{{ content }}
38-
<section>
39-
{% else %}
40-
{% block content %}
41-
{% if content_html %}
42-
<div class="container">
43-
{{ content_html|safe }}
44-
</div>
36+
<section>
37+
{% else %}
38+
{% block content %}
39+
{% if content_html %}<div class="container">{{ content_html|safe }}</div>{% endif %}
40+
{% endblock %}
4541
{% endif %}
46-
{% endblock %}
47-
{% endif %}
48-
</body>
49-
</html>
42+
</body>
43+
</html>

src/core/jinja2/core/base.jinja2

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<!-- Global site tag (gtag.js) - Google Analytics -->
@@ -21,30 +21,27 @@
2121
<script src="{{ static('artoolkit.three.js') }}" defer></script>
2222
<script src="{{ static('ar-gif.min.js') }}" defer></script>
2323
<script src="{{ static('js/rotationLock.js') }}"></script>
24-
2524
<title>Jandig ARte</title>
2625
<meta name="Description" content="Augmented reality artworks!">
2726
<meta name="viewport" content="width=device-width, initial-scale=1">
28-
29-
<link href="https://fonts.googleapis.com/css?family=Istok+Web:400,400i,700,700i&display=swap" rel="stylesheet">
30-
31-
<link rel="shortcut icon" href="{{ static('images/icons/favicon.ico') }}" type="image/x-icon" />
27+
<link href="https://fonts.googleapis.com/css?family=Istok+Web:400,400i,700,700i&display=swap"
28+
rel="stylesheet">
29+
<link rel="shortcut icon"
30+
href="{{ static('images/icons/favicon.ico') }}"
31+
type="image/x-icon" />
3232
</head>
33-
3433
<body>
3534
{% if content is defined %}
3635
{{ content }}
3736
{% else %}
3837
{% block content %}
3938
{% if content_html %}
40-
<div class="Container">
41-
{{ content_html|safe }}
42-
</div>
39+
<div class="Container">{{ content_html|safe }}</div>
4340
{% else %}
44-
<p>{{ _('Please override the "content" block of your template!') }}</p>
41+
<p>{{ _("Please override the \"content\" block of your template!") }}</p>
4542
{% endif %}
4643
{% endblock %}
4744
{% endif %}
4845
{% include "core/ui.jinja2" %}
4946
</body>
50-
</html>
47+
</html>
Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,78 @@
11
{% extends '/core/home.jinja2' %}
2-
3-
42
{% block content %}
5-
{% block subcontent %}
6-
{% endblock %}
3+
{% block subcontent %}{% endblock %}
74
<section class="profile-options-flex">
85
<div class="container">
96
{# FIXME: maybe this can be improved #}
107
<link rel="stylesheet" href="{{ static('css/repository-list.css') }}">
118
<link rel="stylesheet" href="{{ static ('css/generic-modal.css') }}">
129
<script src="{{ static('js/modal.js') }}"></script>
13-
1410
{% for element_type, repository_list, class_type in [
15-
("mr-exhibit",mr_exhibits, "titExb"),
16-
("ar-exhibit",ar_exhibits, "titExb"),
17-
("artwork",artworks, "titArt"),
18-
("marker",markers, "titMrk"),
19-
("object",objects, "titObj"),
20-
("sound",sounds, "titObj")
21-
]
22-
%}
23-
11+
("mr-exhibit",mr_exhibits, "titExb"),
12+
("ar-exhibit",ar_exhibits, "titExb"),
13+
("artwork",artworks, "titArt"),
14+
("marker",markers, "titMrk"),
15+
("object",objects, "titObj"),
16+
("sound",sounds, "titObj")
17+
]
18+
%}
2419
{% if repository_list %}
25-
26-
{% if element_type == "ar-exhibit" %}
27-
<h1 class={{class_type}} style="font-size: 1.5em;">{{_("Jandig AR Exhibits")}}</h1>
28-
{% elif element_type == "mr-exhibit" %}
29-
<h1 class={{class_type}} style="font-size: 1.5em;">{{_("Jandig MR Exhibits")}}</h1>
20+
{% if element_type == "ar-exhibit" %}
21+
<h1 class={{ class_type }} style="font-size: 1.5em;">{{ _("Jandig AR Exhibits") }}
22+
</h1>
23+
{% elif element_type == "mr-exhibit" %}
24+
<h1 class={{ class_type }} style="font-size: 1.5em;">{{ _("Jandig MR Exhibits") }}
25+
</h1>
3026
{% else %}
31-
<h1 class={{class_type}} style="font-size: 1.5em;">{{_("Jandig " + element_type.capitalize() + "s")}}</h1>
27+
<h1 class={{ class_type }} style="font-size: 1.5em;">{{ _("Jandig " + element_type.capitalize() + "s") }}
28+
</h1>
3229
{% endif %}
33-
3430
{% with repository_list = repository_list, element_type=element_type %}
3531
{% include "core/components/item-list.jinja2" %}
3632
{% endwith %}
3733
{% if seeall == False %}
38-
{% if element_type == "ar-exhibit" %}
39-
<a href = "/see_all/?which={{element_type}}" class="seeall">{{_("All AR Exhibits")}}</a>
34+
{% if element_type == "ar-exhibit" %}
35+
<a href = "/see_all/?which={{ element_type }}" class="seeall">{{ _("All AR Exhibits") }}</a>
4036
{% elif element_type == "mr-exhibit" %}
41-
<a href = "/see_all/?which={{element_type}}" class="seeall">{{_("All MR Exhibits")}}</a>
37+
<a href = "/see_all/?which={{ element_type }}" class="seeall">{{ _("All MR Exhibits") }}</a>
4238
{% else %}
43-
<a href = "/see_all/?which={{element_type}}" class="seeall">{{_("All " + element_type.capitalize() + "s")}}</a>
39+
<a href = "/see_all/?which={{ element_type }}" class="seeall">{{ _("All " + element_type.capitalize() + "s") }}</a>
4440
{% endif %}
4541
{% endif %}
4642
{% if seeall == True %}
47-
<nav>
48-
<div class="flex">
49-
{% for page_number in repository_list.adjusted_elided_pages %}
43+
<nav>
44+
<div class="flex">
45+
{% for page_number in repository_list.adjusted_elided_pages %}
5046
{% if page_number == repository_list.number %}
51-
<div class="active useful-links">
52-
<span class="page-link" style="background-color: #05f7ae; color: #fff; padding: 5px;">
53-
{{ page_number }}
54-
<span class="sr-only"></span>
55-
</div>
56-
{% else %}
57-
<div class="useful-links">
58-
<a class="page-link"
59-
href="?which={{element_type}}&page={{ page_number }}">
47+
<div class="active useful-links">
48+
<span class="page-link"
49+
style="background-color: #05f7ae;
50+
color: #fff;
51+
padding: 5px">
6052
{{ page_number }}
61-
</a>
62-
</div>
63-
{% endif %}
64-
{% endfor %}
65-
</div>
66-
</nav>
53+
<span class="sr-only"></span>
54+
</div>
55+
{% else %}
56+
<div class="useful-links">
57+
<a class="page-link"
58+
href="?which={{ element_type }}&page={{ page_number }}">
59+
{{ page_number }}
60+
</a>
61+
</div>
62+
{% endif %}
63+
{% endfor %}
64+
</div>
65+
</nav>
66+
{% endif %}
6767
{% endif %}
68+
{% endfor %}
69+
{% if not ar_exhibits and not mr_exhibits and not artworks and not markers and not objects and not sounds %}
70+
<h1 class="titObj" style="font-size: 1em;">
71+
{{ _("We found no content on your Collection, try uploading an object.") }}
72+
</h1>
6873
{% endif %}
69-
{% endfor %}
70-
{% if not ar_exhibits and not mr_exhibits and not artworks and not markers and not objects and not sounds %}
71-
<h1 class="titObj" style="font-size: 1em;">{{_("We found no content on your Collection, try uploading an object.")}}</h1>
72-
{% endif %}
73-
74-
<section id="modal" class="modal"></section>
75-
</div>
76-
</section>
77-
{% endblock %}
74+
<section id="modal" class="modal">
75+
</section>
76+
</div>
77+
</section>
78+
{% endblock %}

0 commit comments

Comments
 (0)