Skip to content

Commit

Permalink
drop: djhtml formatting test
Browse files Browse the repository at this point in the history
  • Loading branch information
Restioson committed Oct 8, 2024
1 parent 7865e43 commit a252ebd
Show file tree
Hide file tree
Showing 32 changed files with 1,023 additions and 1,023 deletions.
2 changes: 1 addition & 1 deletion app/templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

{% block error_title %}{% trans "Internal Server Error (500)" %}{% endblock %}
{% block error_message %}
{% trans "The server encountered an unexpected condition that prevented it from fulfilling the request." %}
{% trans "The server encountered an unexpected condition that prevented it from fulfilling the request." %}
{% endblock %}
16 changes: 8 additions & 8 deletions app/templates/admin/base_site.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
{% endblock %}

{% block branding %}
<h1 class="header-title">
<a href="{% url 'home' %}">
<img src="{% static 'img/lwimilinks.svg' %}" class="main-logo" alt="{% trans 'LwimiLinks' %}">
</a>
</h1>
{% if user.is_anonymous %}
{% include "admin/color_theme_toggle.html" %}
{% endif %}
<h1 class="header-title">
<a href="{% url 'home' %}">
<img src="{% static 'img/lwimilinks.svg' %}" class="main-logo" alt="{% trans 'LwimiLinks' %}">
</a>
</h1>
{% if user.is_anonymous %}
{% include "admin/color_theme_toggle.html" %}
{% endif %}
{% endblock %}
6 changes: 3 additions & 3 deletions app/templates/app/_nav_item.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<li class="nav-item me-1">
<a href="{% url view %}"
{% if current_page == view %} class="nav-link active px-3" aria-current="page"
{% else %} class="nav-link px-3"
{% endif %}>
{% if current_page == view %} class="nav-link active px-3" aria-current="page"
{% else %} class="nav-link px-3"
{% endif %}>
{{ label }}
</a>
</li>
22 changes: 11 additions & 11 deletions app/templates/app/_navbar_items.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% load i18n %}
{% spaceless %}
<div class="collapse navbar-collapse" id="navbarPills" hx-swap-oob="true">
<ul class="nav-pills navbar-nav me-auto mb-2 mb-lg-0">
{% include "app/_nav_item.html" with view="home" label=_("Home") %}
{% include "app/_nav_item.html" with view="search" label=_("Search") %}
{% include "app/_nav_item.html" with view="institutions" label=_("Institutions") %}
{% include "app/_nav_item.html" with view="projects" label=_("Projects") %}
{% include "app/_nav_item.html" with view="documents" label=_("Documents") %}
{% include "app/_nav_item.html" with view="languages" label=_("Languages") %}
{% include "app/_nav_item.html" with view="subjects" label=_("Subjects") %}
</ul>
</div>
<div class="collapse navbar-collapse" id="navbarPills" hx-swap-oob="true">
<ul class="nav-pills navbar-nav me-auto mb-2 mb-lg-0">
{% include "app/_nav_item.html" with view="home" label=_("Home") %}
{% include "app/_nav_item.html" with view="search" label=_("Search") %}
{% include "app/_nav_item.html" with view="institutions" label=_("Institutions") %}
{% include "app/_nav_item.html" with view="projects" label=_("Projects") %}
{% include "app/_nav_item.html" with view="documents" label=_("Documents") %}
{% include "app/_nav_item.html" with view="languages" label=_("Languages") %}
{% include "app/_nav_item.html" with view="subjects" label=_("Subjects") %}
</ul>
</div>
{% endspaceless %}
80 changes: 40 additions & 40 deletions app/templates/app/_pagination.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% load i18n %}
{% spaceless %}
{% if page_obj.has_previous or page_obj.has_next %}
<nav aria-label="{% trans 'Pages' %}" class="my-3">
{% if page_obj.has_previous or page_obj.has_next %}
<nav aria-label="{% trans 'Pages' %}" class="my-3">
{# TODO: ideal accessibility combination of aria-label and h4? #}
<h4 class="d-sm-none">{% trans "Pages" %}</h4>
<h4 class="d-sm-none">{% trans "Pages" %}</h4>
{% comment %}
Notes:
* Below small or with long translations, there is likely not enough
Expand All @@ -27,43 +27,43 @@ <h4 class="d-sm-none">{% trans "Pages" %}</h4>
* &nbsp; is a non-breaking space that avoids an arrow wrapping separately
from the label.
{% endcomment %}
<style>
@media (max-width: 575px) {
.page-item:first-child .page-link { border-radius: 0 }
.page-item:last-child .page-link { border-radius: 0 }
}
</style>
{% with lefter='class="page-link pe-4 pe-sm-3"' righter='class="page-link ps-4 ps-sm-3"' %}
{% with disabled='class="page-item disabled d-none d-sm-block" aria-hidden="true"' %}
<ul class="pagination flex-wrap justify-content-center text-center list-group list-group-horizontal-sm px-5 px-sm-0">
{% if page_obj.has_previous %}
<li class="page-item"><a {{ lefter }} href="?{{ url_params }}&page=1">&laquo;&nbsp;{% trans "Start" %}</a></li>
<li class="page-item"><a {{ lefter }} href="?{{ url_params }}&page={{ page_obj.previous_page_number }}">&lsaquo;&nbsp;{% trans "Previous" %}</a></li>
{% else %}
<li {{ disabled }}><span {{ lefter }}>&laquo;&nbsp;{% trans "First" %}</span></li>
<li {{ disabled }}><span {{ lefter }}>&lsaquo;&nbsp;{% trans "Previous" %}</span></li>
{% endif %}
<style>
@media (max-width: 575px) {
.page-item:first-child .page-link { border-radius: 0 }
.page-item:last-child .page-link { border-radius: 0 }
}
</style>
{% with lefter='class="page-link pe-4 pe-sm-3"' righter='class="page-link ps-4 ps-sm-3"' %}
{% with disabled='class="page-item disabled d-none d-sm-block" aria-hidden="true"' %}
<ul class="pagination flex-wrap justify-content-center text-center list-group list-group-horizontal-sm px-5 px-sm-0">
{% if page_obj.has_previous %}
<li class="page-item"><a {{ lefter }} href="?{{ url_params }}&page=1">&laquo;&nbsp;{% trans "Start" %}</a></li>
<li class="page-item"><a {{ lefter }} href="?{{ url_params }}&page={{ page_obj.previous_page_number }}">&lsaquo;&nbsp;{% trans "Previous" %}</a></li>
{% else %}
<li {{ disabled }}><span {{ lefter }}>&laquo;&nbsp;{% trans "First" %}</span></li>
<li {{ disabled }}><span {{ lefter }}>&lsaquo;&nbsp;{% trans "Previous" %}</span></li>
{% endif %}

{% for num in page_obj.paginator.page_range %}
{% if page_obj.number == num %}
<li class="page-item active"><a aria-current="page" class="page-link" href="#">{{ num }}</a></li>
{% elif num > page_obj.number|add:-3 and num < page_obj.number|add:3 %}
<li class="page-item"><a class="page-link" href="?{{ url_params }}&page={{ num }}">{{ num }}</a></li>
{% elif num == page_obj.number|add:-4 or num == page_obj.number|add:4 %}
<li class="page-item"><span aria-hidden="true" class="page-link">...</span></li>
{% endif %}
{% endfor %}
{% for num in page_obj.paginator.page_range %}
{% if page_obj.number == num %}
<li class="page-item active"><a aria-current="page" class="page-link" href="#">{{ num }}</a></li>
{% elif num > page_obj.number|add:-3 and num < page_obj.number|add:3 %}
<li class="page-item"><a class="page-link" href="?{{ url_params }}&page={{ num }}">{{ num }}</a></li>
{% elif num == page_obj.number|add:-4 or num == page_obj.number|add:4 %}
<li class="page-item"><span aria-hidden="true" class="page-link">...</span></li>
{% endif %}
{% endfor %}

{% if page_obj.has_next %}
<li class="page-item"><a {{ righter }} href="?{{ url_params }}&page={{ page_obj.next_page_number }}" preload>{% trans "Next" %}&nbsp;&rsaquo;</a></li>
<li class="page-item"><a {{ righter }} href="?{{ url_params }}&page={{ page_obj.paginator.num_pages }}">{% trans "Last" %}&nbsp;&raquo;</a></li>
{% else %}
<li {{ disabled }}><span {{ righter }}>{% trans "Next" %}&nbsp;&rsaquo;</span></li>
<li {{ disabled }}><span {{ righter }}>{% trans "Last" %}&nbsp;&raquo;</span></li>
{% endif %}
</ul>
{% endwith %}
{% endwith %}
</nav>
{% endif %}
{% if page_obj.has_next %}
<li class="page-item"><a {{ righter }} href="?{{ url_params }}&page={{ page_obj.next_page_number }}" preload>{% trans "Next" %}&nbsp;&rsaquo;</a></li>
<li class="page-item"><a {{ righter }} href="?{{ url_params }}&page={{ page_obj.paginator.num_pages }}">{% trans "Last" %}&nbsp;&raquo;</a></li>
{% else %}
<li {{ disabled }}><span {{ righter }}>{% trans "Next" %}&nbsp;&rsaquo;</span></li>
<li {{ disabled }}><span {{ righter }}>{% trans "Last" %}&nbsp;&raquo;</span></li>
{% endif %}
</ul>
{% endwith %}
{% endwith %}
</nav>
{% endif %}
{% endspaceless %}
22 changes: 11 additions & 11 deletions app/templates/app/_search_filter.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% spaceless %}
<fieldset class="checkbox-container form-control mb-4">
<legend>{{ field.label }}</legend>
<details {% if field.value %}open{% endif%}>{# open if currently filtering on this field #}
<summary>{{ summary }}</summary>
{% for checkbox in field %}
<div class="form-check">
<label>{{ checkbox.tag }}{{ checkbox.choice_label }}</label>
</div>
{% endfor %}
</details>
</fieldset>
<fieldset class="checkbox-container form-control mb-4">
<legend>{{ field.label }}</legend>
<details {% if field.value %}open{% endif%}>{# open if currently filtering on this field #}
<summary>{{ summary }}</summary>
{% for checkbox in field %}
<div class="form-check">
<label>{{ checkbox.tag }}{{ checkbox.choice_label }}</label>
</div>
{% endfor %}
</details>
</fieldset>
{% endspaceless %}
84 changes: 42 additions & 42 deletions app/templates/app/_subj_lang_institution_filter.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{% load i18n %}
{% spaceless %}
<form method="GET" action="{% url view %}" class="mb-3">
<div class="d-flex flex-wrap gap-2">
<div class="form-group flex-fill mb-2">
<label for="subject">{% trans "Subject" %}</label>
<select id="subject" name="subject" class="form-select">
<option value="">{% trans "All Subjects" %}</option>
{% for subject in subjects %}
<option value="{{ subject.id }}"
{% if request.GET.subject == subject.id|stringformat:"s" %}selected{% endif %}>
{{ subject.name }}
</option>
{% endfor %}
</select>
<form method="GET" action="{% url view %}" class="mb-3">
<div class="d-flex flex-wrap gap-2">
<div class="form-group flex-fill mb-2">
<label for="subject">{% trans "Subject" %}</label>
<select id="subject" name="subject" class="form-select">
<option value="">{% trans "All Subjects" %}</option>
{% for subject in subjects %}
<option value="{{ subject.id }}"
{% if request.GET.subject == subject.id|stringformat:"s" %}selected{% endif %}>
{{ subject.name }}
</option>
{% endfor %}
</select>
</div>
<div class="form-group flex-fill mb-2">
<label for="language">{% trans "Language" %}</label>
<select id="language" name="language" class="form-select">
<option value="">{% trans "All Languages" %}</option>
{% for language in languages %}
<option value="{{ language.id }}"
{% if request.GET.language == language.id|stringformat:"s" %}selected{% endif %}>
{{ language.name }}
</option>
{% endfor %}
</select>
</div>
<div class="form-group flex-fill mb-2">
<label for="institution">{% trans "Institution" %}</label>
<select id="institution" name="institution" class="form-select">
<option value="">{% trans "All Institutions" %}</option>
{% for institution in institutions %}
<option value="{{ institution.id }}"
{% if request.GET.institution == institution.id|stringformat:"s" %}selected{% endif %}>
{{ institution }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group flex-fill mb-2">
<label for="language">{% trans "Language" %}</label>
<select id="language" name="language" class="form-select">
<option value="">{% trans "All Languages" %}</option>
{% for language in languages %}
<option value="{{ language.id }}"
{% if request.GET.language == language.id|stringformat:"s" %}selected{% endif %}>
{{ language.name }}
</option>
{% endfor %}
</select>
<div class="d-flex flex-wrap">
<button type="submit" class="btn btn-primary mt-2 me-2">{% trans "Filter" %}</button>
<a href="{% url view %}" class="btn btn-secondary mt-2">{% trans "Reset" %}</a>
</div>
<div class="form-group flex-fill mb-2">
<label for="institution">{% trans "Institution" %}</label>
<select id="institution" name="institution" class="form-select">
<option value="">{% trans "All Institutions" %}</option>
{% for institution in institutions %}
<option value="{{ institution.id }}"
{% if request.GET.institution == institution.id|stringformat:"s" %}selected{% endif %}>
{{ institution }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="d-flex flex-wrap">
<button type="submit" class="btn btn-primary mt-2 me-2">{% trans "Filter" %}</button>
<a href="{% url view %}" class="btn btn-secondary mt-2">{% trans "Reset" %}</a>
</div>
</form>
</form>
{% endspaceless %}
100 changes: 50 additions & 50 deletions app/templates/app/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,58 @@
{% load i18n %}

{% block content %}
{% spaceless %}
<div class="m-4">
<div class="card p-3">
<h1 id="main-heading" class="card-title">{% trans "Contact us" %}</h1>
<div class="row">
<div class="col-md-4 contact-info">
<h2 class="fs-4">{% trans "Contact details for more information" %}</h2>
<p>
{% blocktrans trimmed %}
Juan Steyn<br>
South African Centre for Digital Language Resources (SADiLaR)<br>
North-West University<br>
South Africa
{% endblocktrans %}
</p>
<p><a href="tel:+27182852750">+27 (0)18 285-2750</a></p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
</div>
{% spaceless %}
<div class="m-4">
<div class="card p-3">
<h1 id="main-heading" class="card-title">{% trans "Contact us" %}</h1>
<div class="row">
<div class="col-md-4 contact-info">
<h2 class="fs-4">{% trans "Contact details for more information" %}</h2>
<p>
{% blocktrans trimmed %}
Juan Steyn<br>
South African Centre for Digital Language Resources (SADiLaR)<br>
North-West University<br>
South Africa
{% endblocktrans %}
</p>
<p><a href="tel:+27182852750">+27 (0)18 285-2750</a></p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
</div>

<div class="col-md-4 contact-info">
<h2 class="fs-4">{% trans "Physical address" %}</h2>
<address>
{% blocktrans trimmed %}
Buildings F16 C & F16 D<br>
North-West University<br>
Potchefstroom Campus<br>
Potchefstroom<br>
South Africa
{% endblocktrans %}
</address>
<p>
<a href="https://www.google.com/maps/place/26%C2%B041'13.8%22S+27%C2%B005'41.4%22E/@-26.687157,27.094845,17z/data=!3m1!4b1!4m4!3m3!8m2!3d-26.687157!4d27.094845?entry=ttu">
{% trans "Directions" %}
</a>
</p>
</div>
<div class="col-md-4 contact-info">
<h2 class="fs-4">{% trans "Physical address" %}</h2>
<address>
{% blocktrans trimmed %}
Buildings F16 C & F16 D<br>
North-West University<br>
Potchefstroom Campus<br>
Potchefstroom<br>
South Africa
{% endblocktrans %}
</address>
<p>
<a href="https://www.google.com/maps/place/26%C2%B041'13.8%22S+27%C2%B005'41.4%22E/@-26.687157,27.094845,17z/data=!3m1!4b1!4m4!3m3!8m2!3d-26.687157!4d27.094845?entry=ttu">
{% trans "Directions" %}
</a>
</p>
</div>

<div class="col-md-4 contact-info">
<h2 class="fs-4">{% trans "Postal address" %}</h2>
<address>
{% blocktrans trimmed %}
SADiLaR<br>
Internal Box 340<br>
Private bag X6001<br>
Potchefstroom<br>
South Africa<br>
2520
{% endblocktrans %}
</address>
<div class="col-md-4 contact-info">
<h2 class="fs-4">{% trans "Postal address" %}</h2>
<address>
{% blocktrans trimmed %}
SADiLaR<br>
Internal Box 340<br>
Private bag X6001<br>
Potchefstroom<br>
South Africa<br>
2520
{% endblocktrans %}
</address>
</div>
</div>
</div>
</div>
</div>
</div>
{% endspaceless %}
{% endspaceless %}
{% endblock content %}
Loading

0 comments on commit a252ebd

Please sign in to comment.