Archived
1
0
This commit is contained in:
Jeff Becker 2017-04-03 16:49:40 -04:00
parent 9c60901332
commit ce7170c438

View File

@ -443,6 +443,7 @@ func (self *templateEngine) genGraphs(prefix string, wr io.Writer, db Database)
// generate front page and board list // generate front page and board list
func (self *templateEngine) genFrontPage(top_count int, prefix, frontend_name string, indexwr, boardswr io.Writer, db Database) { func (self *templateEngine) genFrontPage(top_count int, prefix, frontend_name string, indexwr, boardswr io.Writer, db Database) {
/*
// the graph for the front page // the graph for the front page
var frontpage_graph boardPageRows var frontpage_graph boardPageRows
@ -476,7 +477,7 @@ func (self *templateEngine) genFrontPage(top_count int, prefix, frontend_name st
}) })
} }
} }
*/
models := db.GetLastPostedPostModels(prefix, 20) models := db.GetLastPostedPostModels(prefix, 20)
wr := indexwr wr := indexwr
@ -484,7 +485,7 @@ func (self *templateEngine) genFrontPage(top_count int, prefix, frontend_name st
param := make(map[string]interface{}) param := make(map[string]interface{})
param["overview"] = self.renderTemplate("overview.mustache", map[string]interface{}{"overview": overviewModel(models)}) param["overview"] = self.renderTemplate("overview.mustache", map[string]interface{}{"overview": overviewModel(models)})
/*
sort.Sort(posts_graph) sort.Sort(posts_graph)
param["postsgraph"] = self.renderTemplate("posts_graph.mustache", map[string]interface{}{"graph": posts_graph}) param["postsgraph"] = self.renderTemplate("posts_graph.mustache", map[string]interface{}{"graph": posts_graph})
sort.Sort(frontpage_graph) sort.Sort(frontpage_graph)
@ -493,6 +494,7 @@ func (self *templateEngine) genFrontPage(top_count int, prefix, frontend_name st
} else { } else {
param["boardgraph"] = frontpage_graph param["boardgraph"] = frontpage_graph
} }
*/
param["frontend"] = frontend_name param["frontend"] = frontend_name
param["totalposts"] = db.ArticleCount() param["totalposts"] = db.ArticleCount()
@ -503,13 +505,14 @@ func (self *templateEngine) genFrontPage(top_count int, prefix, frontend_name st
if err != nil { if err != nil {
log.Println("error writing front page", err) log.Println("error writing front page", err)
} }
/*
wr = boardswr wr = boardswr
param["graph"] = frontpage_graph param["graph"] = frontpage_graph
_, err = io.WriteString(wr, self.renderTemplate("boardlist.mustache", param)) _, err = io.WriteString(wr, self.renderTemplate("boardlist.mustache", param))
if err != nil { if err != nil {
log.Println("error writing board list page", err) log.Println("error writing board list page", err)
} }
*/
} }
func ReloadTemplates() { func ReloadTemplates() {