20 lines
496 B
Plaintext
20 lines
496 B
Plaintext
|
package pages
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"git.grosinger.net/tgrosinger/saasitone/pkg/page"
|
||
|
)
|
||
|
|
||
|
templ Error(p page.Page) {
|
||
|
if p.StatusCode >= 500 {
|
||
|
<p>Please try again.</p>
|
||
|
} else if p.StatusCode == http.StatusUnauthorized || p.StatusCode == http.StatusForbidden {
|
||
|
<p>You are not authorized to view the requested page.</p>
|
||
|
} else if p.StatusCode == http.StatusNotFound {
|
||
|
<p>Click <a href={ templ.URL(p.ToURL("home")) }>here</a> to return home</p>
|
||
|
} else {
|
||
|
<p>Something went wrong</p>
|
||
|
}
|
||
|
}
|