directory can paginate
This commit is contained in:
@@ -116,13 +116,14 @@
|
|||||||
{{ else }}
|
{{ else }}
|
||||||
<table width="100%" class="table table-hover">
|
<table width="100%" class="table table-hover">
|
||||||
{{ $path := .Path }}
|
{{ $path := .Path }}
|
||||||
|
{{ $limit := .Limit }}
|
||||||
{{ $showDirDel := .ShowDirectoryDelete }}
|
{{ $showDirDel := .ShowDirectoryDelete }}
|
||||||
{{ range $entry_index, $entry := .Entries }}
|
{{ range $entry_index, $entry := .Entries }}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{ if $entry.IsDirectory }}
|
{{ if $entry.IsDirectory }}
|
||||||
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
|
||||||
<a href="{{ printpath $path "/" $entry.Name "/"}}" >
|
<a href="{{ printpath $path "/" $entry.Name "/" "?" "limit" "=" }}{{ print $limit }}" >
|
||||||
{{ $entry.Name }}
|
{{ $entry.Name }}
|
||||||
</a>
|
</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|||||||
@@ -9,9 +9,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func printpath(parts ...string) string {
|
func printpath(parts ...string) string {
|
||||||
concat := strings.Join(parts, "")
|
var escapedParts []string
|
||||||
escaped := url.PathEscape(concat)
|
for _, p := range parts {
|
||||||
return strings.ReplaceAll(escaped, "%2F", "/")
|
if len(p) == 1 {
|
||||||
|
escapedParts = append(escapedParts, p)
|
||||||
|
} else {
|
||||||
|
escapedParts = append(escapedParts, url.PathEscape(p))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return strings.Join(escapedParts, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
var funcMap = template.FuncMap{
|
var funcMap = template.FuncMap{
|
||||||
|
|||||||
Reference in New Issue
Block a user