29 lines
579 B
Plaintext
29 lines
579 B
Plaintext
package web
|
|
|
|
import "fmt"
|
|
import "net/http"
|
|
|
|
templ ErrorXXX(errCode int, reason, message, referer string) {
|
|
{{ errText := http.StatusText(errCode) }}
|
|
@base(errText, errText, "", "", errorXXXHead()) {
|
|
<section id="error">
|
|
<h1>{ fmt.Sprint(errCode) }</h1>
|
|
{ errText }
|
|
if reason != "" {
|
|
<p>{ reason }</p>
|
|
}
|
|
if message != "" {
|
|
<p>{ message }</p>
|
|
}
|
|
</section>
|
|
if referer != "" {
|
|
<section>
|
|
<h2><a href={ templ.URL(referer) }>Go back</a></h2>
|
|
</section>
|
|
}
|
|
}
|
|
}
|
|
|
|
templ errorXXXHead() {
|
|
<link rel="stylesheet" href="/assets/css/error.css">
|
|
} |