Add the statistics on the menu

This commit is contained in:
Las Zenow 2013-06-01 04:30:52 +02:00
parent 73f2f1f452
commit 4e703e03ce
3 changed files with 3 additions and 0 deletions

View file

@ -47,6 +47,7 @@ func statsWorker() {
func statsHandler(w http.ResponseWriter, r *http.Request, sess *Session) {
var data statsData
data.S = GetStatus(w, r)
data.S.Stats = true
data.Hourly = getHourlyVisits()
data.Daily = getDailyVisits()
data.Monthly = getMonthlyVisits()

View file

@ -12,6 +12,7 @@ type Status struct {
Home bool
About bool
Upload bool
Stats bool
}
func GetStatus(w http.ResponseWriter, r *http.Request) Status {

View file

@ -53,6 +53,7 @@
<li {{if .Home}}class="active"{{end}}><a href="/">Home</a></li>
<li {{if .About}}class="active"{{end}}><a href="/about/">About</a></li>
<li {{if .Upload}}class="active"{{end}}><a href="/upload/">Upload your epub</a></li>
<li {{if .Stats}}class="active"{{end}}><a href="/stats/">Statistics</a></li>
</ul>
<ul class="nav pull-right">