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

@ -74,10 +74,11 @@ type webData struct {
Msg string
Query string
Path string
Paths core.Paths
Tags []string
Data interface{}
Path string
Paths core.Paths
Tags []string
Created string
Data interface{}
}
type loginData struct {

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,

View file

@ -151,16 +151,17 @@ const (
</div>
</div>
</div>
{{if .Tags}}
<div class="row">
<div class="alert alert-secondary full-width">
{{if .Tags}}
Tags
{{range $t := .Tags}}
<a href="/search?query=tags:{{$t}}" class="btn badge btn-primary tag">{{$t}}</a>
{{end}}
{{end}}
<span class="float-right">{{.Created}}</span>
</div>
</div>
{{end}}
<div class="row">
<embed src="{{.Data.Abs}}" toolbar="1" statusbar="1" navpanes="1"></embed>
</div>