ansible/roles/caddy/templates/error.html.j2

108 lines
3.9 KiB
Text
Raw Normal View History

2024-05-02 22:28:50 +02:00
<!doctype html>
{{ ansible_managed | comment("xml") }}
<html>
<head>
<meta charset="utf-8"/>
<title>{{ '{{placeholder "http.error.status_code"}}' }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<style>
* {
line-height: 1.2;
margin: 0;
}
html {
font-family: sans-serif;
text-align: center;
color: #888;
display: grid;
min-height: 100vh;
}
body {
margin: 2em auto;
place-self: center;
}
a {
text-decoration: underline dotted;
color: #888;
}
h1 {
color: #555;
font-size: 2em;
font-weight: 400;
margin: 1em 0;
}
p {
margin: 1em auto;
max-width: 480px;
}
@media only screen and (max-width: 280px) {
body, p {
width: 95vw;
}
h1 {
font-size: 1.5em;
margin: 0 0 0.3em;
}
}
#switch {
margin: 0 0 1em 0;
justify-content: center;
}
#switch a {
padding: .5em;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
document.getElementById("switch").hidden = false;
});
function translate(lang) {
document.querySelectorAll('[lang]').forEach((element) => {
element.hidden = element.getAttribute("lang") !== lang;
});
}
</script>
</head>
<body>
<nav id="switch" hidden>
<a href="javascript:translate('en')">English</a>
<a href="javascript:translate('fr')">Français</a>
</nav>
<h1 lang="fr" hidden>Erreur {{ '{{placeholder "http.error.status_code"}}' }}</h1>
<h1 lang="en">Error {{ '{{placeholder "http.error.status_code"}}' }}</h1>
{{ '{{$http_code := atoi (placeholder "http.error.status_code")}}' }}
{{ '{{if eq $http_code 502 503}}' }}
<p lang="fr" hidden>Whoops, le service est temporairement indisponible ou en maintenance…<br/>Essayez de rafraîchir la page plus tard.</p>
<p lang="en">Whoops, the service is temporarily unavailable or under maintenance…<br/>Try refreshing the page later.</p>
{{ '{{else if eq $http_code 504}}' }}
<p lang="fr" hidden>Whoops, le service prend trop de temps à répondre…<br/>Essayez de rafraîchir la page plus tard.</p>
<p lang="en">Whoops, the service takes too long to respond…<br/>Try refreshing the page later.</p>
{{ '{{end}}' }}
{{ '{{if and (lt $http_code 600) (gt $http_code 499)}}' }}
2024-05-02 22:43:25 +02:00
<p lang="fr" hidden>Si le problème persiste, contactez <a href="{{ 'mailto:' + caddy__contact_email }}">léquipe technique dAurore</a>.</p>
<p lang="en">If the problem persists, contact <a href="{{ 'mailto:' + caddy__contact_email }}">the Aurore technical team</a>.</p>
2024-05-02 22:28:50 +02:00
{{ '{{end}}' }}
{{ '{{if eq $http_code 403}}' }}
<p lang="fr" hidden>Whoops, cette page vous est interdite.</p>
<p lang="en">Whoops, you are not allowed on this page.</p>
{{ '{{else if eq $http_code 404}}' }}
<p lang="fr" hidden>Whoops, cette page nexiste pas.</p>
<p lang="en">Whoops, this page doesn't exist.</p>
{{ '{{else if and (lt $http_code 499) (gt $http_code 399)}}' }}
<p lang="fr" hidden>Whoops, requête malformée.</p>
<p lang="en">Whoops, malformed request.</p>
{{ '{{end}}' }}
<p lang="fr" hidden>ID pour le support : <code>{{ '{{placeholder "http.error.id"}}' }}</code></p>
<p lang="en">Support ID: <code>{{ '{{placeholder "http.error.id"}}' }}</code></p>
</body>
</html>