Error page + config + docker
This commit is contained in:
parent
7e821296a6
commit
c6c533a503
13 changed files with 110 additions and 31 deletions
19
templates/errors.templ
Normal file
19
templates/errors.templ
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package templates
|
||||
|
||||
type ErrorParams struct {
|
||||
Error string
|
||||
}
|
||||
|
||||
templ Error(baseParams BaseTemplateParams, errorParams ErrorParams) {
|
||||
@BaseTemplate(baseParams) {
|
||||
<div id="main">
|
||||
<h1>GPX downloader</h1>
|
||||
|
||||
<div class="error-message">
|
||||
{ errorParams.Error }
|
||||
</div>
|
||||
|
||||
<a href="/">Retour</a>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +1,14 @@
|
|||
package templates
|
||||
|
||||
type IndexParams struct {
|
||||
Error string
|
||||
}
|
||||
|
||||
templ Index(baseParams BaseTemplateParams, indexParams IndexParams) {
|
||||
templ Index(baseParams BaseTemplateParams) {
|
||||
@BaseTemplate(baseParams) {
|
||||
<div id="main">
|
||||
<h1>GPX downloader</h1>
|
||||
|
||||
if len(indexParams.Error) <= 0 {
|
||||
<form method="post" action="/fetch">
|
||||
<input name="url" required />
|
||||
<button type="submit">Fetch</button>
|
||||
</form>
|
||||
} else {
|
||||
<div class="error-message">
|
||||
{ indexParams.Error }
|
||||
</div>
|
||||
|
||||
<a href="/">Retour</a>
|
||||
}
|
||||
<form method="post" action="/fetch">
|
||||
<input name="url" required />
|
||||
<button type="submit">Fetch</button>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue