Convert config.go into command line params

This commit is contained in:
Las Zenow 2016-05-03 01:03:23 -04:00
parent 9d1f1ad5c0
commit 0e8f1e7b56
14 changed files with 217 additions and 189 deletions

View file

@ -6,6 +6,10 @@ import (
"gitlab.com/trantor/trantor/lib/database"
)
const (
numNews = 10
)
type newsData struct {
S Status
News []newsEntry
@ -27,9 +31,9 @@ func newsHandler(h handler) {
data.S = GetStatus(h)
data.S.Title = "News -- " + data.S.Title
data.S.News = true
data.News = getNews(NUM_NEWS, 0, h.db)
data.News = getNews(numNews, 0, h.db)
loadTemplate(h, "news", data)
h.template.load(h, "news", data)
}
func editNewsHandler(h handler) {
@ -42,7 +46,7 @@ func editNewsHandler(h handler) {
data.S = GetStatus(h)
data.S.Title = "Edit news -- " + data.S.Title
data.S.News = true
loadTemplate(h, "edit_news", data)
h.template.load(h, "edit_news", data)
}
func postNewsHandler(h handler) {