Skip to content

Commit

Permalink
Merge pull request #608 from nationalarchives/chore/switch-to-djlint
Browse files Browse the repository at this point in the history
Chore/switch to djlint
  • Loading branch information
timcowlishaw authored Mar 27, 2023
2 parents 8afa012 + be59a33 commit e754392
Show file tree
Hide file tree
Showing 44 changed files with 887 additions and 677 deletions.
20 changes: 17 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,24 @@ repos:
- id: flake8
args: ["--config=setup.cfg"]

- repo: https://github.com/thibaudcolas/curlylint
rev: v0.13.1
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.19.16
hooks:
- id: curlylint
- id: djlint-django
name: djLint Reformatting for Django
entry: djlint --profile=django --reformat
types_or: [html]
language: python

- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.19.16
hooks:
- id: djlint-django
name: djLint Checks for Django
entry: djlint --profile=django
types_or: [html]
language: python


# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
Expand Down
24 changes: 17 additions & 7 deletions ds_judgements_public_ui/templates/403.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
{% extends "base.html" %}

{% block title %}Forbidden - Find Case Law{% endblock %}

{% block title %}
Forbidden - Find Case Law
{% endblock title %}
{% block content %}
<header class="page-header">
<div class="page-header__breadcrumb">
<nav class="page-header__breadcrumb-container" aria-label="Breadcrumb">
<span class="page-header__breadcrumb-you-are-in">You are in: </span>
<span class="page-header__breadcrumb-you-are-in">You are in:</span>
<ol>
<li><a href="{% url 'home' %}">Find case law</a></li>
<li>
<a href="{% url 'home' %}">Find case law</a>
</li>
<li>Forbidden</li>
</ol>
</nav>
</div>
</header>
<div class="standard-text-template">
<h1>Forbidden</h1>
<p>{% if exception %}{{ exception }}{% else %}Access to this page is forbidden.{% endif %}</p>
<p><a href="{% url 'home' %}">Return to Find case law</a></p>
<p>
{% if exception %}
{{ exception }}
{% else %}
Access to this page is forbidden.
{% endif %}
</p>
<p>
<a href="{% url 'home' %}">Return to Find case law</a>
</p>
</div>
{% endblock content %}
16 changes: 8 additions & 8 deletions ds_judgements_public_ui/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{% extends "base.html" %}

{% block title %}
Page not found - Find case law
{% endblock %}

{% endblock title %}
{% block content %}
<header class="page-header">
<div class="page-header__breadcrumb">
<nav class="page-header__breadcrumb-container" aria-label="Breadcrumb">
<span class="page-header__breadcrumb-you-are-in">You are in: </span>
<span class="page-header__breadcrumb-you-are-in">You are in:</span>
<ol>
<li><a href="{% url 'home' %}">Find case law</a></li>
<li>
<a href="{% url 'home' %}">Find case law</a>
</li>
<li>Page not found</li>
</ol>
</nav>
</div>
</header>

<div class="standard-text-template">
<h1>Page not found</h1>

<p>If you typed the web address, check it is correct.</p>
<p>If you pasted the web address, check you copied the entire address.</p>
<p><a href="{% url 'home' %}">Return to Find case law</a></p>
<p>
<a href="{% url 'home' %}">Return to Find case law</a>
</p>
</div>
{% endblock content %}
16 changes: 10 additions & 6 deletions ds_judgements_public_ui/templates/500.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{% extends "base.html" %}

{% block title %}Server Error - Find Case Law{% endblock %}

{% block title %}
Server Error - Find Case Law
{% endblock title %}
{% block content %}
<header class="page-header">
<div class="page-header__breadcrumb">
<nav class="page-header__breadcrumb-container" aria-label="Breadcrumb">
<span class="page-header__breadcrumb-you-are-in">You are in: </span>
<span class="page-header__breadcrumb-you-are-in">You are in:</span>
<ol>
<li><a href="{% url 'home' %}">Find case law</a></li>
<li>
<a href="{% url 'home' %}">Find case law</a>
</li>
<li>Server error</li>
</ol>
</nav>
Expand All @@ -17,6 +19,8 @@
<div class="standard-text-template">
<h1>Server Error</h1>
<p>Sorry, there seems to be an error. Please try again soon.</p>
<p><a href="{% url 'home' %}">Return to Find case law</a></p>
<p>
<a href="{% url 'home' %}">Return to Find case law</a>
</p>
</div>
{% endblock content %}
45 changes: 21 additions & 24 deletions ds_judgements_public_ui/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
{% load static i18n %}<!DOCTYPE html>
{% load static i18n %}
<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}

<html lang="{{ LANGUAGE_CODE }}">
<head>
<meta charset="utf-8">

<meta charset="utf-8" />
{% block robots %}
<meta name="robots" content="noindex,nofollow">
<meta name="robots" content="noindex,nofollow" />
{% endblock robots %}

<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{% block title %}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="icon" href="{% static 'images/favicons/favicon.png' %}">

<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>
{% block title %}
{% endblock title %}
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="{% static 'images/favicons/favicon.png' %}" />
{% block css %}
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&amp;family=Roboto:wght@400;600;700&amp;display=swap" rel="stylesheet">
<link href="{% static 'css/main.css' %}" rel="stylesheet">
{% endblock %}

<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&amp;family=Roboto:wght@400;600;700&amp;display=swap"
rel="stylesheet"/>
<link href="{% static 'css/main.css' %}" rel="stylesheet" />
{% endblock css %}
{% block javascript %}
<script defer src="{% static 'js/dist/app.js' %}"></script>
<script defer src="{% static 'js/dist/cookie_consent.js' %}"></script>
{% endblock javascript %}

{% include 'includes/gtm/gtm_head.html' %}
{% include "includes/gtm/gtm_head.html" %}
</head>

<body>
<script>
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
</script>
{% include 'includes/cookie_consent/cookie_banner.html' %}
{% include "includes/cookie_consent/cookie_banner.html" %}
<a id="skip-to-main-content" href="#main-content">{% translate "skiplink" %}</a>
{% include 'includes/gtm/gtm_body.html' %}
{% include 'includes/phase_banner.html' %}
{% include "includes/gtm/gtm_body.html" %}
{% include "includes/phase_banner.html" %}
<main id="main-content">
{% block content %}
{% endblock content %}
</main>
{% include 'includes/how_can_this_service_be_improved.html' %}
{% include 'includes/footer.html' %}
{% include "includes/how_can_this_service_be_improved.html" %}
{% include "includes/footer.html" %}
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<div class="announcement-banner">
<div class="announcement-banner__container">
<div class="announcement-banner__notice">
<p class="announcement-banner__message">Her Majesty Queen Elizabeth II <span class="announcement-banner__sub-message">21 April 1926 to 8 September 2022</span></p>
<p class="announcement-banner__message">
Her Majesty Queen Elizabeth II <span class="announcement-banner__sub-message">21 April 1926 to 8 September 2022</span>
</p>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
<div class="search-component">
<div class="search-component__container">
<h2 class="search-component__header--sr-only">{% translate "basicsearchform.title" %}</h2>
<form action="{% url 'results' %}" class="search-term-component" role="search" aria-label="Search by keyword or neutral citation" id="analytics-basic-search">
<form action="{% url 'results' %}"
class="search-term-component"
role="search"
aria-label="Search by keyword or neutral citation"
id="analytics-basic-search">
{% include "includes/search_term_component.html" %}
</form>

<div class="search-component__more-options">
<a href="{% url 'structured_search' %}">{% translate "basicsearchform.structured_search" %}</a>
</div>
Expand Down
12 changes: 4 additions & 8 deletions ds_judgements_public_ui/templates/includes/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{% load i18n %}
<div class="page-header__breadcrumb">
<nav class="page-header__breadcrumb-container" aria-label="Breadcrumb">
<span class="page-header__breadcrumb-you-are-in">You are in: </span>
<span class="page-header__breadcrumb-you-are-in">You are in:</span>
<ol>
<li>
{% if current == "home" %}
{% if current == "home" %}
{% translate "common.findcaselaw" %}
{% else %}
<a href="{% url 'home' %}">
{% translate "common.findcaselaw" %}
</a>
<a href="{% url 'home' %}">{% translate "common.findcaselaw" %}</a>
{% endif %}
</li>
{% if title and link %}
<li>{{ title }}</li>
{% endif %}
{% if title and link %}<li>{{ title }}</li>{% endif %}
</ol>
</nav>
</div>
20 changes: 10 additions & 10 deletions ds_judgements_public_ui/templates/includes/browse_by_court.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ <h3 id="browse-by-court" class="judgment-browse__sub-header">By court</h3>
<ul class="judgment-browse__list">
{% for court in courts %}
<li class="judgment-browse__list-item">
<a class="judgment-browse__link" href="/judgments/advanced_search?court={{ court.canonical_param }}">{{ court.list_name }}</a>
<span class="judgment-browse__year-range">
{{ court|get_court_date_range }}
</span>
<a class="judgment-browse__link"
href="{% url "advanced_search" %}?court={{ court.canonical_param }}">{{ court.list_name }}</a>
<span class="judgment-browse__year-range">{{ court|get_court_date_range }}</span>
</li>
{% endfor %}
</ul>
</div>
<div class="judgment-browse__by-type">
<h3 id="browse-by-tribunal" class="judgment-browse__sub-header">By tribunal</h3>
<p class="judgment-browse__information-box">We have a limited number of tribunal decisions available as part of our alpha service.</p>
<p class="judgment-browse__information-box">
We have a limited number of tribunal decisions available as part of our alpha service.
</p>
<ul class="judgment-browse__list">
{% for tribunal in tribunals %}
<li class="judgment-browse__list-item">
<a class="judgment-browse__link" href="/judgments/advanced_search?court={{ tribunal.canonical_param }}">{{ tribunal.list_name }}</a>
<span class="judgment-browse__year-range">
{{ tribunal|get_court_date_range }}
</span>
<a class="judgment-browse__link"
href="{% url "advanced_search" %}?court={{ tribunal.canonical_param }}">{{ tribunal.list_name }}</a>
<span class="judgment-browse__year-range">{{ tribunal|get_court_date_range }}</span>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endblock %}
{% endblock content %}
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
{% if not dontShowCookieNotice %}
<div id="ds-cookie-consent-banner" class="cookieConsent" role="region" aria-label="Cookie banner">
<div class="container" role="region" aria-label="Cookies on The National Archives">
<div id="ds-cookie-consent-banner"
class="cookieConsent"
role="region"
aria-label="Cookie banner">
<div class="container"
role="region"
aria-label="Cookies on The National Archives">
<div class="row">
<p class="cookie_head">This website uses cookies</p>
<p class="cookie-p">
We place some essential cookies on your device to make this website work. <br><br>
We'd like to use additional cookies to remember your settings and understand how you use our services. <br><br>
We place some essential cookies on your device to make this website work.
<br />
<br />
We'd like to use additional cookies to remember your settings and understand how you use our services.
<br />
<br />
This information will help us make improvements to the website.
</p>
<a href="https://www.nationalarchives.gov.uk/legal/cookies/" id="btn_preferences" class="button">Set cookie preferences</a>
<a href="https://www.nationalarchives.gov.uk/legal/cookies/"
id="btn_preferences"
class="button">Set cookie preferences</a>
</div>
</div>
</div>
Expand Down
14 changes: 8 additions & 6 deletions ds_judgements_public_ui/templates/includes/courts_options.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{% for court in context.courts %}
<div class="structured-search__court-option">
<label for="court_{{court.canonical_param}}">
<input type="checkbox" name="court"
value="{{court.canonical_param}}"
id="court_{{court.canonical_param}}"
{% for alias in context.court %}{% if alias in court.param_aliases %}checked="checked"{% endif %}{% endfor %}>
<span class="structured-search__court-option-label">{{court.name}}</span>
<label for="court_{{ court.canonical_param }}">
<input type="checkbox"
name="court"
value="{{ court.canonical_param }}"
id="court_{{ court.canonical_param }}"
{% for alias in context.court %}{% if alias in court.param_aliases %}checked="checked"{% endif %}
{% endfor %}/>
<span class="structured-search__court-option-label">{{ court.name }}</span>
</label>
</div>
{% endfor %}
Loading

0 comments on commit e754392

Please sign in to comment.