web frontend for git (tangled's grandpa)
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

routes: sort repo index by last idle

+11 -1
+11 -1
routes/routes.go
··· 6 6 "net/http" 7 7 "os" 8 8 "path/filepath" 9 + "sort" 10 + "time" 9 11 10 12 "github.com/alexedwards/flow" 11 13 "github.com/dustin/go-humanize" ··· 25 27 return 26 28 } 27 29 28 - type info struct{ Name, Desc, Idle string } 30 + type info struct { 31 + Name, Desc, Idle string 32 + d time.Time 33 + } 29 34 30 35 infos := []info{} 31 36 ··· 51 56 Name: dir.Name(), 52 57 Desc: desc, 53 58 Idle: humanize.Time(c.Author.When), 59 + d: c.Author.When, 54 60 }) 55 61 } 62 + 63 + sort.Slice(infos, func(i, j int) bool { 64 + return infos[j].d.Before(infos[i].d) 65 + }) 56 66 57 67 tpath := filepath.Join(d.c.Dirs.Templates, "*") 58 68 t := template.Must(template.ParseGlob(tpath))