2021-11-22 09:06:23 +00:00
|
|
|
package handler
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Update struct {
|
|
|
|
|
UpdatedAgo string
|
|
|
|
|
Author string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (h *Handler) showIndexView(w http.ResponseWriter, r *http.Request) {
|
2021-11-22 17:12:07 +00:00
|
|
|
statuses, err := h.storage.LatestStatuses()
|
|
|
|
|
if err != nil {
|
|
|
|
|
serverError(w, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
h.renderLayout(w, "index", map[string]interface{}{
|
|
|
|
|
"statuses": statuses,
|
|
|
|
|
}, "")
|
2021-11-22 09:06:23 +00:00
|
|
|
}
|