filer: UI ensure a correct foler link
This commit is contained in:
@@ -14,10 +14,14 @@ func ToBreadcrumb(fullpath string) (crumbs []Breadcrumb) {
|
|||||||
parts := strings.Split(fullpath, "/")
|
parts := strings.Split(fullpath, "/")
|
||||||
|
|
||||||
for i := 0; i < len(parts); i++ {
|
for i := 0; i < len(parts); i++ {
|
||||||
crumbs = append(crumbs, Breadcrumb{
|
crumb := Breadcrumb{
|
||||||
Name: parts[i] + "/",
|
Name: parts[i] + " /",
|
||||||
Link: "/" + filepath.ToSlash(filepath.Join(parts[0:i+1]...)),
|
Link: "/" + filepath.ToSlash(filepath.Join(parts[0:i+1]...)),
|
||||||
})
|
}
|
||||||
|
if !strings.HasSuffix(crumb.Link, "/") {
|
||||||
|
crumb.Link += "/"
|
||||||
|
}
|
||||||
|
crumbs = append(crumbs, crumb)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(`<!DOC
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div>
|
<div>
|
||||||
{{ range $entry := .Breadcrumbs }}
|
{{ range $entry := .Breadcrumbs }}
|
||||||
<a href={{ $entry.Link }} >
|
<a href="{{ $entry.Link }}" >
|
||||||
{{ $entry.Name }}
|
{{ $entry.Name }}
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user