2024-06-13 04:49:55 +04:00
|
|
|
package web
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
import "net/http"
|
|
|
|
|
2024-07-04 03:56:57 +04:00
|
|
|
templ ErrorXXX(errCode int, reason, message string, r *http.Request) {
|
2024-06-19 01:08:05 +04:00
|
|
|
{{ errText := http.StatusText(errCode) }}
|
2024-07-04 03:56:57 +04:00
|
|
|
@base(errText, errText, "", "", r, errorXXXHead()) {
|
2024-06-19 01:08:05 +04:00
|
|
|
<section id="error">
|
|
|
|
<h1>{ fmt.Sprint(errCode) }</h1>
|
|
|
|
{ errText }
|
|
|
|
if reason != "" {
|
|
|
|
<p>{ reason }</p>
|
|
|
|
}
|
|
|
|
if message != "" {
|
|
|
|
<p>{ message }</p>
|
|
|
|
}
|
|
|
|
</section>
|
2024-07-04 03:56:57 +04:00
|
|
|
if r.Referer() != "" {
|
2024-06-19 01:08:05 +04:00
|
|
|
<section>
|
2024-07-04 03:56:57 +04:00
|
|
|
<h2><a href={ templ.URL(r.Referer()) }>Go back</a></h2>
|
2024-06-19 01:08:05 +04:00
|
|
|
</section>
|
|
|
|
}
|
|
|
|
}
|
2024-06-13 04:49:55 +04:00
|
|
|
}
|
2024-06-19 01:08:05 +04:00
|
|
|
|
|
|
|
templ errorXXXHead() {
|
|
|
|
<link rel="stylesheet" href="/assets/css/error.css">
|
2024-06-13 04:49:55 +04:00
|
|
|
}
|