package yatwiki3 import ( "database/sql" "fmt" "html/template" "net/http" "net/url" ) func (this *WikiServer) routeHistory(w http.ResponseWriter, r *http.Request, articleTitle string) { revs, err := this.db.GetRevisionHistory(articleTitle) if err != nil { if err == sql.ErrNoRows { this.serveErrorHTMLMessage(w, this.noSuchArticleError(articleTitle)) return } this.serveErrorMessage(w, err) return } pto := DefaultPageTemplateOptions(this.opts) pto.CurrentPageName = articleTitle pto.CurrentPageIsArticle = true content := `

Page History


` + `There have been ` + fmt.Sprintf("%d", len(revs)) + ` edits to the page "` + template.HTMLEscapeString(articleTitle) + `".` + `

` + `
` + `` compareRow := `` content += compareRow for _, rev := range revs { revIdStr := fmt.Sprintf("%d", rev.ID) content += `` + `` + `` + `` + `` } content += compareRow content += `
` + this.formatTimestamp(rev.Modified) + `` + template.HTMLEscapeString(rev.Author) + ` 
` pto.Content = template.HTML(content) this.servePageResponse(w, r, pto) return }