forked from tangled.org/core
this repo has no description

better error templates

anirudh.fi 1a81770e eb6dd9fe

verified
Changed files
+21 -3
appview
pages
templates
state
+4
appview/pages/pages.go
···
func (p *Pages) Error404(w io.Writer) error {
return p.execute("errors/404", w, nil)
}
+
+
func (p *Pages) Error503(w io.Writer) error {
+
return p.execute("errors/503", w, nil)
+
}
+4 -1
appview/pages/templates/errors/404.html
···
{{ define "title" }}404 · tangled{{ end }}
{{ define "content" }}
-
<h3>404 &mdash; nothing like that here!</h3>
+
<h1>404 &mdash; nothing like that here!</h1>
+
<p>
+
It seems we couldn't find what you were looking for. Sorry about that!
+
</p>
{{ end }}
+2 -1
appview/pages/templates/errors/500.html
···
{{ define "title" }}500 &middot; tangled{{ end }}
{{ define "content" }}
-
<h3>500 &mdash; something broke!</h3>
+
<h1>500 &mdash; something broke!</h1>
+
<p>We're working on getting service back up. Hang tight!</p>
{{ end }}
+9
appview/pages/templates/errors/503.html
···
+
{{ define "title" }}503 &middot; tangled{{ end }}
+
+
{{ define "content" }}
+
<h1>503 &mdash; unable to reach knot</h1>
+
<p>
+
We were unable to reach the knot hosting this repository. Try again
+
later.
+
</p>
+
{{ end }}
+1 -1
appview/pages/templates/layouts/topbar.html
···
{{ end }}
</nav>
{{ else }}
-
<a href="/login" class="btn my-2">login</a>
+
<a href="/login" class="btn my-2 no-underline">login</a>
{{ end }}
{{ end }}
+1
appview/state/repo.go
···
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s", f.Knot, f.OwnerDid(), f.RepoName))
if err != nil {
+
s.pages.Error503(w)
log.Println("failed to reach knotserver", err)
return
}