Add the statistics on the menu
This commit is contained in:
parent
73f2f1f452
commit
4e703e03ce
3 changed files with 3 additions and 0 deletions
1
stats.go
1
stats.go
|
@ -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()
|
||||
|
|
|
@ -12,6 +12,7 @@ type Status struct {
|
|||
Home bool
|
||||
About bool
|
||||
Upload bool
|
||||
Stats bool
|
||||
}
|
||||
|
||||
func GetStatus(w http.ResponseWriter, r *http.Request) Status {
|
||||
|
|
|
@ -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">
|
||||
|
|
Reference in a new issue