package web
import "github.com/invopop/ctxi18n/i18n"
import "net/http"
import "dwelling-files/pkg/files"
import "dwelling-files/pkg/utils"
import "strconv"
import "strings"
func currentPathToLink(path string) (curPath string) {
parts := strings.Split(path, "/")[1:]
for i, part := range parts {
var sb strings.Builder
sb.WriteString("/")
sb.WriteString(part)
sb.WriteString("")
curPath += sb.String()
}
return
}
templ Index(currentPath, progVer string, stat *files.DirStat, entries *[]files.DirEntry, r *http.Request) {
Arav's dwelling / { i18n.T(ctx, "title") }
{ i18n.T(ctx, "table.name") } |
{ i18n.T(ctx, "table.date") } |
{ i18n.T(ctx, "table.size") } |
../ |
for i, entry := range *entries {
{ entry.Name } |
{ utils.ToClientTimezone(entry.Datetime, r).Format(files.FileDateFormat) } |
{ entry.Size } |
}
{ i18n.T(ctx, "instruction") }
}