fix(web): make the try again button always go back to / (#907)

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso 2025-07-25 10:25:04 -04:00 committed by GitHub
parent bb434a3351
commit 221d9f2072
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 139 additions and 188 deletions

View file

@ -122,18 +122,10 @@ templ index(localizer *localization.SimpleLocalizer) {
</div>
}
script reload(redirect string) {
if (redirect === "") {
redirect = "/";
}
window.location = redirect;
}
templ errorPage(message, mail, redirect string, localizer *localization.SimpleLocalizer) {
templ errorPage(message, mail string, localizer *localization.SimpleLocalizer) {
<div class="centered-div">
<img id="image" alt="Sad Anubis" style="width:100%;max-width:256px;" src={ anubis.BasePrefix + "/.within.website/x/cmd/anubis/static/img/reject.webp?cacheBuster=" + anubis.Version }/>
<p>{ message }.</p>
<button onClick={ reload(redirect) }>{ localizer.T("try_again") }</button>
if mail != "" {
<p>
<a href="/">{ localizer.T("go_home") }</a> { localizer.T("contact_webmaster") }