added index date to file page

This commit is contained in:
ston1th 2020-07-11 21:33:06 +02:00
commit 3f9b863171
5 changed files with 27 additions and 11 deletions

View file

@ -457,7 +457,15 @@ func dirHandler(ctx *Context) {
Title: "Document Viewer | " + path,
}
ctx.Template("fileHandler")
f := ctx.Srv.DB.IsIndexed(path)
//f := ctx.Srv.DB.IsIndexed(path)
id, err := ctx.Srv.DB.GetID(path)
f := err == nil
if id != "" {
d, err := ctx.Srv.DB.Index.Get(id)
if err == nil {
ctx.Data.Created = core.CreatedTime(d.Created)
}
}
ctx.Data.Data = core.Path{
Name: path,
Abs: core.RawPrefix + path,