From 5b533f7b40dc5a5be2bfb3ab7d53c23471d789e0 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 18 Nov 2017 15:30:50 +1300 Subject: [PATCH] redesign the 'recent changes' page, include diff links, "new" display, hover rows --- rRecentChanges.go | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/rRecentChanges.go b/rRecentChanges.go index 13d218b..ad67dc4 100644 --- a/rRecentChanges.go +++ b/rRecentChanges.go @@ -37,26 +37,41 @@ func (this *WikiServer) routeRecentChanges(w http.ResponseWriter, r *http.Reques pto.CurrentPageName = "Recent Changes" content := `

Recent Changes


` + - `Showing up to ` + fmt.Sprintf("%d", this.opts.RecentChanges) + ` changes.
` + - `` + `Showing up to ` + fmt.Sprintf("%d", this.opts.RecentChanges) + ` changes.

` + + `
` + + `
` + + `` for _, rev := range recents { + + diffHtml := "" + diffRev, err := this.db.GetNextOldestRevision(int(rev.ID)) + if err != nil { + diffHtml = `[new]` + } else { + diffHtml = `diff` + } + content += `` + - `` + + `` + `` + `` + `` + `` } - content += `
PageActionsTimeAuthor
` + template.HTMLEscapeString(rev.Title) + `` + - ` [a]` + + `` + template.HTMLEscapeString(rev.Title) + `` + + `rev   ` + + diffHtml + + `` + string(this.formatTimestamp(rev.Modified)) + `` + template.HTMLEscapeString(rev.Author) + `
` + content += `
` + if pageNum > 1 { - content += `« Newer` + content += `« Newer` } - content += `` + if pageNum < maxPage { - content += `Older »` + content += `Older »` } - content += `` + content += `` pto.Content = template.HTML(content) this.servePageResponse(w, r, pto)