61 lines
1.5 KiB
Text
61 lines
1.5 KiB
Text
package web
|
|
|
|
import "git.jmbit.de/jmb/scanfile/server/internal/sqlc"
|
|
|
|
import "git.jmbit.de/jmb/scanfile/server/web/templui/components/table"
|
|
import "fmt"
|
|
|
|
templ FileList(files []sqlc.File) {
|
|
@table.Table() {
|
|
@table.Header() {
|
|
@table.Row() {
|
|
@table.Head() {
|
|
Nr
|
|
}
|
|
@table.Head() {
|
|
Name
|
|
}
|
|
@table.Head() {
|
|
Size
|
|
}
|
|
@table.Head() {
|
|
Uploaded
|
|
}
|
|
@table.Head() {
|
|
UUID
|
|
}
|
|
}
|
|
}
|
|
@table.Body() {
|
|
for i, file := range files {
|
|
@table.Row() {
|
|
@table.Cell() {
|
|
<a href={templ.SafeURL(fmt.Sprintf("/files/%s", file.ID.String()))}>
|
|
{fmt.Sprintf("%d", i)}
|
|
</a>
|
|
}
|
|
@table.Cell() {
|
|
<a href={templ.SafeURL(fmt.Sprintf("/files/%s", file.ID.String()))}>
|
|
{file.Name}
|
|
</a>
|
|
}
|
|
@table.Cell() {
|
|
<a href={templ.SafeURL(fmt.Sprintf("/files/%s", file.ID.String()))}>
|
|
{fmt.Sprintf("%d", file.Size)}
|
|
</a>
|
|
}
|
|
@table.Cell() {
|
|
<a href={templ.SafeURL(fmt.Sprintf("/files/%s", file.ID.String()))}>
|
|
{file.Created.Time.Format("2006-01-02 15:04:05 MST")}
|
|
</a>
|
|
}
|
|
@table.Cell() {
|
|
<a href={templ.SafeURL(fmt.Sprintf("/files/%s", file.ID.String()))}>
|
|
{file.ID.String()}
|
|
</a>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|