Fix wiki page list not rendering after updatedunix changes (#3175)

tokarchuk/v1.17
Lauris BH 7 years ago committed by Lunny Xiao
parent 00bfa1d055
commit d3c5911ffc
  1. 14
      routers/repo/wiki.go

@ -9,7 +9,6 @@ import (
"io/ioutil" "io/ioutil"
"path/filepath" "path/filepath"
"strings" "strings"
"time"
"code.gitea.io/git" "code.gitea.io/git"
@ -19,6 +18,7 @@ import (
"code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/markup"
"code.gitea.io/gitea/modules/markup/markdown" "code.gitea.io/gitea/modules/markup/markdown"
"code.gitea.io/gitea/modules/util"
) )
const ( const (
@ -45,9 +45,9 @@ func MustEnableWiki(ctx *context.Context) {
// PageMeta wiki page meat information // PageMeta wiki page meat information
type PageMeta struct { type PageMeta struct {
Name string Name string
SubURL string SubURL string
Updated time.Time UpdatedUnix util.TimeStamp
} }
// findEntryForFile finds the tree entry for a target filepath. // findEntryForFile finds the tree entry for a target filepath.
@ -266,9 +266,9 @@ func WikiPages(ctx *context.Context) {
return return
} }
pages = append(pages, PageMeta{ pages = append(pages, PageMeta{
Name: wikiName, Name: wikiName,
SubURL: models.WikiNameToSubURL(wikiName), SubURL: models.WikiNameToSubURL(wikiName),
Updated: c.Author.When, UpdatedUnix: util.TimeStamp(c.Author.When.Unix()),
}) })
} }
ctx.Data["Pages"] = pages ctx.Data["Pages"] = pages

Loading…
Cancel
Save