feat(templates): clean up error page after feedback

This commit is contained in:
Trong Huu Nguyen
2024-10-16 10:24:04 +02:00
parent e7ab8e7c83
commit 7c2d6d3f71
4 changed files with 16 additions and 12 deletions

View File

@@ -112,6 +112,7 @@ func (s *Standalone) defaultErrorResponse(w http.ResponseWriter, r *http.Request
CorrelationID: middleware.GetReqID(r.Context()),
CSS: templates.CSS,
DefaultRedirectURI: defaultRedirect,
HttpStatusCode: statusCode,
RetryURI: s.Retry(r, loginCookie),
})
if err != nil {

View File

@@ -16,6 +16,7 @@ type ErrorVariables struct {
CorrelationID string
CSS template.CSS
DefaultRedirectURI string
HttpStatusCode int
RetryURI string
}

View File

@@ -5,28 +5,30 @@
<style>
{{ .CSS }}
</style>
<title>Innloggingsfeil</title>
<title>Teknisk feil</title>
</head>
<body>
<section class="bg-white">
<div class="py-8 px-6 mx-auto max-w-screen-xl lg:py-26 lg:px-12">
<div class="mx-auto max-w-screen-md text-left">
<h1 class="h-[4rem] mb-2 sm:mb-8 text-4xl tracking-tight font-extrabold sm:text-5xl bg-gradient-to-r from-indigo-700 via-primary-300 to-primary-500 inline-block text-transparent bg-clip-text">
<div class="flex h-screen py-8 px-6 lg:py-26 lg:px-12">
<div class="mx-auto sm:m-auto max-w-screen-md text-left">
<h1 class="mb-1 sm:mb-2 text-3xl tracking-tight font-bold sm:font-semibold sm:text-5xl text-gray-900">
Beklager, noe gikk galt.
</h1>
<p class="mb-2 text-xl tracking-tight font-bold text-gray-900 sm:text-2xl">
Vi kunne ikke logge deg på.
<p class="mb-4 font-light text-sm text-gray-500">
Statuskode {{.HttpStatusCode}}
</p>
<p class="mb-8 text-base tracking-tight font-normal text-gray-900">
En teknisk feil gjør at siden er utilgjengelig. Dette skyldes ikke noe du gjorde.<br />
Vent litt og prøv igjen.
</p>
<div class="flex flex-col gap-3 mt-8 sm:flex-row sm:items-center sm:gap-3">
<a href="{{.RetryURI}}" class="inline-flex items-center justify-center min-w-44 p-4 text-base font-normal text-white rounded-md bg-action-500 hover:bg-action-600">
<span class="w-full text-center">Prøv igjen</span>
<div class="flex flex-col gap-6 mt-8 sm:flex-row sm:items-center sm:gap-8">
{{if ne .HttpStatusCode 400}}
<a href="{{.RetryURI}}" class="text-base font-normal text-action-500 underline hover:no-underline hover:text-action-700">
Prøv igjen
</a>
<a href="{{.DefaultRedirectURI}}" class="inline-flex items-center justify-center min-w-44 p-4 text-base font-normal rounded-md border-2 border-action-500 text-action-500 hover:bg-action-100">
<span class="w-full text-center">Gå til forsiden</span>
{{end}}
<a href="{{.DefaultRedirectURI}}" class="text-base font-normal text-action-500 underline hover:no-underline hover:text-action-700">
Gå til forsiden
</a>
</div>
<p class="mt-8 font-light text-sm text-gray-500">

File diff suppressed because one or more lines are too long