Move root path out from CurrentPath() func and localise it.
This commit is contained in:
parent
edd1d9f16d
commit
c63d59f0a4
@ -6,7 +6,6 @@ import (
|
||||
|
||||
func CurrentPath(path string) (curPath string) {
|
||||
parts := strings.Split(path, "/")[1:]
|
||||
curPath = "<a href=\"/\">root</a>"
|
||||
for i, part := range parts {
|
||||
var sb strings.Builder
|
||||
sb.WriteString("/<a href=\"/")
|
||||
|
@ -39,7 +39,7 @@ templ Index(currentPath, progVer string, stat *files.DirStat, entries *[]files.D
|
||||
</header>
|
||||
<main>
|
||||
<section>
|
||||
<span>@templ.Raw(currentPath)</span>
|
||||
<span><a href="/">{ i18n.T(ctx, "curpath-root") }</a>@templ.Raw(currentPath)</span>
|
||||
<p>{ i18n.T(ctx, "stats.files") }: { strconv.FormatInt(stat.Files, 10) } ({ stat.FilesSize }); { i18n.T(ctx, "stats.directories") }: { strconv.FormatInt(stat.Directories, 10) }.</p>
|
||||
<input type="text" name="filter" placeholder={ i18n.T(ctx, "stats.filter") } class="hidden">
|
||||
</section>
|
||||
|
@ -3,6 +3,7 @@ en:
|
||||
description: My file share
|
||||
keywords: files ftp share self-host
|
||||
back-home: Back home
|
||||
curpath-root: root
|
||||
stats:
|
||||
files: Files
|
||||
directories: Directories
|
||||
|
@ -3,6 +3,7 @@ ru:
|
||||
description: Моя файловая шара
|
||||
keywords: файлы шара ftp селф-хост само-хост self-host
|
||||
back-home: Назад домой
|
||||
curpath-root: корень
|
||||
stats:
|
||||
files: Файлы
|
||||
directories: Директории
|
||||
|
Loading…
Reference in New Issue
Block a user