restructuration
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user