Templates + build
This commit is contained in:
parent
67e2e4d306
commit
7e821296a6
13 changed files with 202 additions and 15 deletions
26
templates/index.templ
Normal file
26
templates/index.templ
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package templates
|
||||
|
||||
type IndexParams struct {
|
||||
Error string
|
||||
}
|
||||
|
||||
templ Index(baseParams BaseTemplateParams, indexParams IndexParams) {
|
||||
@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>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue