1
0
dwelling-home/web/errorXXX.templ

29 lines
598 B
Plaintext
Raw Normal View History

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