1
0

Move root path out from CurrentPath() func and localise it.

This commit is contained in:
Alexander Andreev 2024-12-27 16:31:16 +04:00
parent edd1d9f16d
commit c63d59f0a4
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34
4 changed files with 3 additions and 2 deletions

View File

@ -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=\"/")

View File

@ -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>

View File

@ -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

View File

@ -3,6 +3,7 @@ ru:
description: Моя файловая шара
keywords: файлы шара ftp селф-хост само-хост self-host
back-home: Назад домой
curpath-root: корень
stats:
files: Файлы
directories: Директории