restructuration

This commit is contained in:
rmanach
2025-01-08 10:55:27 +01:00
parent 708db35214
commit 60111911da
10 changed files with 351 additions and 295 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
{{ define "content" }}
<h3>A simple API to store, search and download books, articles, etc...</h3>
<div>No extra JS, CSS or fancy stuff. You click, you search, you found, you're happy.</div>
<div>No extra JS, CSS or fancy stuff. You click, you search, you download, you're happy.</div>
<form action="/home" method="post" enctype="multipart/form-data">
<div class="main-container">
<div class="form-item">
@@ -52,7 +52,7 @@
</td>
<td style="text-align: center">
<div class="col-item">
<a target="_blank" href="{{.GetPath | bookUrl}}">Download</a>
<a target="_blank" href="{{.Path | resourceUrl}}">Download</a>
</div>
</td>
</tr>
+1 -1
View File
@@ -68,7 +68,7 @@ var funcMap = template.FuncMap{
}
return ""
},
"bookUrl": func(path string) string {
"resourceUrl": func(path string) string {
_, filename := filepath.Split(path)
return fmt.Sprintf("%s?file=%s", download.URL, filename)
},
+2 -2
View File
@@ -1,5 +1,5 @@
{{define "content" }}
<h2>Upload a book</h2>
<h2>Upload a resource</h2>
<form action="/upload" method="post" enctype="multipart/form-data">
<div class="main-container">
<div class="form-item">
@@ -58,7 +58,7 @@
</div>
<div class="form-item">
<div class="form-container">
<input type="file" name="file" files="{{.File.Value.Header | filename}}" accept=".pdf" />
<input type="file" name="file" files="{{.File.Value.GetFilename}}" accept=".pdf" />
<button id="submit" type="submit">Upload</button>
</div>
</div>