ictgj-voting/admin_votes.go
Brian Buller ba35073d95 2017-06-22 Build
* Use 'https://github.com/mjibson/esc' for embedded assets
* Pull database name out of siteData object
* Load site config from database, if available
* Allow customizing site config from command line arguments
* Clean up some templates
* Update Readme (it still needs a lot of updating)
* Started work on vote accumulation/management
2017-06-22 10:34:57 -05:00

21 lines
382 B
Go

package main
import (
"net/http"
"github.com/gorilla/mux"
)
func handleAdminVotes(w http.ResponseWriter, req *http.Request, page *pageData) {
vars := mux.Vars(req)
page.SubTitle = "Votes"
switch vars["function"] {
default:
type votesPageData struct {
Votes []Vote
}
page.TemplateData = votesPageData{Votes: dbGetAllVotes()}
page.show("admin-votes.html", w)
}
}