package templates // Breadcrumb is one segment of the current directory path shown above the // file listing, e.g. "docs" linking to "/web/files/docs/". type Breadcrumb struct { Name string Path string // relative path (no leading slash) used to build the link } // FileEntry is a single row (directory or file) in the file browser. type FileEntry struct { Name string IsDir bool Size string // human-readable, empty for directories ModTime string RelPath string // relative path (no leading slash) used to build the link } templ FilesPage(username string, breadcrumbs []Breadcrumb, entries []FileEntry, currentPath string, sortBy string, sortDir string) { @Layout("Files", username) {
| if sortBy == "name" { if sortDir == "asc" { Name ↓ } else { Name ↑ } } else { Name } | Size | if sortBy == "modtime" { if sortDir == "asc" { Modified ↓ } else { Modified ↑ } } else { Modified } | |
|---|---|---|---|
| @fileEntryLink(e) | { e.Size } | { e.ModTime } |
@fileActions(e)
|
| This folder is empty — drag & drop files or folders here, or use the upload buttons above. | |||