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

@ -8,6 +8,10 @@ import (
"gitlab.com/trantor/trantor/lib/database"
)
const (
searchItemsPage = 20
)
type searchData struct {
S Status
Found int
@ -50,7 +54,7 @@ func searchHandler(h handler) {
data.Prev = "/search/?q=" + req + "&p=" + strconv.Itoa(page-1) + "&num=" + strconv.Itoa(items_page)
}
loadTemplate(h, "search", data)
h.template.load(h, "search", data)
}
func itemsPage(r *http.Request) int {
@ -60,5 +64,5 @@ func itemsPage(r *http.Request) int {
return items_page
}
}
return SEARCH_ITEMS_PAGE
return searchItemsPage
}